diff options
author | Nicolás Reynolds <fauno@endefensadelsl.org> | 2014-01-09 00:50:19 -0300 |
---|---|---|
committer | Nicolás Reynolds <fauno@endefensadelsl.org> | 2014-01-09 00:50:19 -0300 |
commit | 3fababaa704ea9cd0ed06c62a9af1b83301b9302 (patch) | |
tree | 47d3d9ea5401e1ac1442b7748f85c078cf6ca65c | |
parent | fb5ee96054490596e4febdf459e5f5bd1b70e807 (diff) |
dagpkg: correctly handle variables
-rwxr-xr-x | dagpkg | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -43,13 +43,15 @@ trap 'trap_exit "An unknown error has occurred. Exiting..."' ERR source_pkgbuild() { # Source this PKGBUILD, if it doesn't exist, exit + unset pkgbase pkgname depends makedepends + unset pkgrel pkgver epoch if ! source ./PKGBUILD &>/dev/null ; then error "No PKGBUILD in %s" "$PWD" exit 1 fi # Save resources - unset pkgdesc arch license groups backup install md5sums sha1sums \ + unset pkgdesc license groups backup install md5sums sha1sums \ sha256sums source options &>/dev/null unset build package &>/dev/null @@ -93,6 +95,10 @@ visit_pkgbuild() { local name source_pkgbuild + # If it's already built we don't bother + is_built ${pkgname[0]} $(get_fullver ${epoch:-0} ${pkgver} ${pkgrel}) && + return + # Detect cycle or already visited package case "${marks[$name]:-0}" in 1) msg2 "cycle found with %s depending on %s" $prev $name @@ -100,19 +106,16 @@ visit_pkgbuild() { 2) return;; esac - # If it's already built we don't bother - is_built ${pkgname[0]} $(get_fullver ${epoch:-0} ${pkgver} ${pkgrel}) && - return + msg "%s (%s)" ${name} ${prev} - echo "${arch[@]}" | grep -qw "$CARCH" || warning "%s isn't ported to %s yet" ${name} ${CARCH} + echo "${arch[@]}" | grep -qw "$CARCH" || + warning "%s isn't ported to %s yet" ${name} ${CARCH} # If the envvar I contains this package, ignore it and exit echo "$I" | grep -qw "$name" && msg2 "%s ignored" ${name} && return - msg "%s (%s)" ${name} ${prev} - # Mark the package as being visited marks[$name]=1 |