--- ../makepkg.old 2012-08-15 15:43:57.351829482 +0200 +++ /usr/bin/makepkg 2012-08-15 16:20:54.665256206 +0200 @@ -2100,6 +2100,8 @@ # Source the config file; fail if it is not found if [[ -r $MAKEPKG_CONF ]]; then + unset GLOBALUSE + declare -A GLOBALUSE source "$MAKEPKG_CONF" else error "$(gettext "%s not found.")" "$MAKEPKG_CONF" @@ -2216,6 +2218,8 @@ unset pkgname pkgbase pkgver pkgrel epoch pkgdesc url license groups provides unset md5sums replaces depends conflicts backup source install changelog build unset makedepends optdepends options noextract +unset USE +declare -A USE BUILDFILE=${BUILDFILE:-$BUILDSCRIPT} if [[ ! -f $BUILDFILE ]]; then @@ -2244,6 +2248,11 @@ shopt -s extglob fi +# overwrite USE flags with GLOBALUSE flags +for i in "${!GLOBALUSE[@]}"; do + USE[$i]=${GLOBALUSE[$i]} +done + # set defaults if they weren't specified in buildfile pkgbase=${pkgbase:-${pkgname[0]}} epoch=${epoch:-0} @@ -2289,6 +2298,9 @@ elif [[ $SPLITPKG -eq 0 ]] && declare -f package_${pkgname} >/dev/null; then SPLITPKG=1 fi +if declare -f generate_deps >/dev/null; then + generate_deps +fi if [[ -n "${PKGLIST[@]}" ]]; then unset pkgname