Skip to content

Commit

Permalink
fix({fetch-sources,package}.sh): install builddeps as a dummy (pacsta…
Browse files Browse the repository at this point in the history
…ll#1132)

Co-authored-by: ook37 <[email protected]>
  • Loading branch information
oklopfer and ook37 authored Jun 4, 2024
1 parent 788fd70 commit 862bde7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
22 changes: 15 additions & 7 deletions misc/scripts/fetch-sources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ function is_compatible_arch() {

function install_builddepends() {
# shellcheck disable=SC2034
local build_dep not_installed_yet_builddepends bdeps_array bdeps_str check_dep not_installed_yet_checkdepends cdeps_array
local build_dep not_installed_yet_builddepends bdeps_array bdeps_str check_dep not_installed_yet_checkdepends cdeps_array bcons_array bcons_str
if [[ -n ${makedepends[*]} ]]; then
for build_dep in "${makedepends[@]}"; do
if ! is_apt_package_installed "${build_dep}"; then
Expand Down Expand Up @@ -607,12 +607,20 @@ function install_builddepends() {
dep_const.comma_array bdeps_array bdeps_str
fancy_message info "${BLUE}$pkgname${NC} requires ${CYAN}${not_installed_yet_builddepends[*]}${NC} to build, and ${CYAN}${not_installed_yet_checkdepends[*]}${NC} to perform checks"
fi
if ((${#not_installed_yet_builddepends[@]} != 0)) || ((${#not_installed_yet_checkdepends[@]} != 0)); then
fancy_message sub "Fetching apt repositories"
# shellcheck disable=SC2015
sudo apt-get update -qq --allow-releaseinfo-change \
&& sudo apt-get satisfy -yq "${bdeps_str}" \
|| {
if ((${#not_installed_yet_builddepends[@]} != 0 || ${#not_installed_yet_checkdepends[@]} != 0 || ${#makeconflicts[@]} != 0 || ${#checkconflicts[@]} != 0 )); then
fancy_message sub "Creating build dependency/conflicts dummy package"
(
unset pre_{upgrade,install,remove} post_{upgrade,install,remove} priority provides conflicts replaces breaks gives enhances recommends custom_fields
# shellcheck disable=SC2030
pkgname="${PACKAGE}-dummy-builddeps"
sudo mkdir -p "${STAGEDIR}/${pkgname}/DEBIAN"
deblog "Depends" "${bdeps_str}"
# shellcheck disable=SC2034
bcons_array=("${makeconflicts[@]}" "${checkconflicts[@]}")
dep_const.comma_array bcons_array bcons_str
deblog "Conflicts" "${bcons_str}"
makedeb
) || {
fancy_message error "Failed to install build or check dependencies"
error_log 8 "install $PACKAGE"
clean_fail_down
Expand Down
3 changes: 3 additions & 0 deletions misc/scripts/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,9 @@ cd "$HOME" 2> /dev/null || (
fancy_message warn "Could not enter into ${HOME}"
)

if is_apt_package_installed "${PACKAGE}-dummy-builddeps"; then
sudo apt-get purge "${PACKAGE}-dummy-builddeps" -y > /dev/null
fi
makedeb

# Metadata writing
Expand Down

0 comments on commit 862bde7

Please sign in to comment.