From 05b41b3d2dd82112bce5df8b2a00ac3da70c1bda Mon Sep 17 00:00:00 2001 From: Martin Panter Date: Mon, 21 Nov 2011 11:25:42 +0000 Subject: [PATCH] Only consider installing specified architecture version of package Otherwise, if for example --x86_64.pkg.tar.xz exists, but the PKGBUILD file has arch=(any), "makepkg --install" would still install the x86-64 version. Problem probably introduced with commit c7e4d10 "makepkg: allow overriding arch in split packages" in Pacman 3.4. Needs fixing for split packages --- scripts/makepkg.sh.in | 28 ++++++++++++++++------------ 1 files changed, 16 insertions(+), 12 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index f39e9d1..639a35d 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -253,6 +253,14 @@ get_full_version() { fi } +get_pkgarch() { + if [[ $arch = "any" ]]; then + PKGARCH="any" + else + PKGARCH=$CARCH + fi +} + ## # Checks to see if options are present in makepkg.conf or PKGBUILD; # PKGBUILD options always take precedence. @@ -1222,11 +1230,7 @@ create_package() { nameofpkg="$1" fi - if [[ $arch = "any" ]]; then - PKGARCH="any" - else - PKGARCH=$CARCH - fi + get_pkgarch write_pkginfo $nameofpkg > .PKGINFO @@ -1403,11 +1407,9 @@ install_package() { local fullver pkg pkglist for pkg in ${pkgname[@]}; do fullver=$(get_full_version $pkg) - if [[ -f $PKGDEST/${pkg}-${fullver}-${CARCH}${PKGEXT} ]]; then - pkglist+=" $PKGDEST/${pkg}-${fullver}-${CARCH}${PKGEXT}" - else - pkglist+=" $PKGDEST/${pkg}-${fullver}-any${PKGEXT}" - fi + + # TODO: Determine correct $PKGARCH for split packages + pkglist+=" $PKGDEST/${pkg}-${fullver}-${PKGARCH}${PKGEXT}" done if ! run_pacman -U $pkglist; then @@ -2168,10 +2170,10 @@ if [[ $SIGNPKG == 'y' ]]; then fi +get_pkgarch if (( ! SPLITPKG )); then fullver=$(get_full_version) - if [[ -f $PKGDEST/${pkgname}-${fullver}-${CARCH}${PKGEXT} \ - || -f $PKGDEST/${pkgname}-${fullver}-any${PKGEXT} ]] \ + if [[ -f $PKGDEST/${pkgname}-${fullver}-${PKGARCH}${PKGEXT} ]] \ && ! (( FORCE || SOURCEONLY || NOBUILD )); then if (( INSTALL )); then warning "$(gettext "A package has already been built, installing existing package...")" @@ -2187,6 +2189,8 @@ else somepkgbuilt=0 for pkg in ${pkgname[@]}; do fullver=$(get_full_version $pkg) + + # TODO: Only check for the specified architecture if [[ -f $PKGDEST/${pkg}-${fullver}-${CARCH}${PKGEXT} \ || -f $PKGDEST/${pkg}-${fullver}-any${PKGEXT} ]]; then somepkgbuilt=1 -- 1.7.7