[pacman-dev] [PATCH 1/2] makepkg: respect package depends for dep checks
Include package-specific and arch-specific dependencies when checking dependencies prior to the build. Fixes: https://bugs.archlinux.org/task/42191 --- scripts/makepkg.sh.in | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 0db9912..6565809 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -2537,6 +2537,22 @@ pkgbuild_get_attribute() { fi } +pkgbuild_get_all_for_arch() { + # $1: attribute name + # $2: architecture + # $3: output variable + local pkg __all l + + array_build __all "$1" + for pkg in "${pkgname[@]}"; do + pkgbuild_get_attribute "$pkg" "$1" 1 l && __all+=("${l[@]}") + pkgbuild_get_attribute "$pkg" "$1_$2" 1 l && __all+=("${l[@]}") + done + + mapfile -t __all < <(printf '%s\n' "${__all[@]}" | awk '!_[$0]++') + array_build "$3" __all +} + lint_pkgbase() { if [[ ${pkgbase:0:1} = "-" ]]; then error "$(gettext "%s is not allowed to start with a hyphen.")" "pkgname" @@ -3626,7 +3642,8 @@ else deperr=0 msg "$(gettext "Checking runtime dependencies...")" - resolve_deps ${depends[@]} || deperr=1 + pkgbuild_get_all_for_arch 'depends' "$CARCH" all_deps + resolve_deps "${all_deps[@]}" || deperr=1 if (( RMDEPS && INSTALL )); then original_pkglist=($(run_pacman -Qq)) # required by remove_dep -- 2.2.1
--- scripts/makepkg.sh.in | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 6565809..acff9b0 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -2920,14 +2920,8 @@ check_vcs_software() { return $ret fi - # we currently only use global depends/makedepends arrays for --syncdeps - for attr in depends makedepends; do - pkgbuild_get_attribute "$pkg" "$attr" 1 'deps' - all_deps+=("${deps[@]}") - - pkgbuild_get_attribute "$pkg" "${attr}_$CARCH" 1 'deps' - all_deps+=("${deps[@]}") - done + all_deps=("${makedepends[@]}") + pkgbuild_get_all_for_arch 'depends' "$CARCH" deps && all_deps+=("${deps[@]}") get_all_sources_for_arch 'all_sources' for netfile in ${all_sources[@]}; do -- 2.2.1
On 29/12/14 03:31, Dave Reisner wrote:
Include package-specific and arch-specific dependencies when checking dependencies prior to the build.
Thinking more about this... Requiring all dependencies installed will cause bootstrapping issues. e.g. pkgname=('gcc' 'gcc-ada') pkgver=4.9.1 package_gcc-ada() { depends=("gcc=$pkgver") } Allan
On Mon, Dec 29, 2014 at 01:21:20PM +1000, Allan McRae wrote:
On 29/12/14 03:31, Dave Reisner wrote:
Include package-specific and arch-specific dependencies when checking dependencies prior to the build.
Thinking more about this...
Requiring all dependencies installed will cause bootstrapping issues.
e.g. pkgname=('gcc' 'gcc-ada') pkgver=4.9.1
package_gcc-ada() { depends=("gcc=$pkgver") }
Allan
As we discussed on IRC, I think the way to solve this is: 1) make --assume-installed work for pacman -T 2) pass provisions of the PKGBUILD as --assume-installed I already have preliminary patches to do this. Need tests, documentation, etc. dR
participants (3)
-
Allan McRae
-
Dave Reisner
-
Dave Reisner