diff options
Diffstat (limited to 'pbuilder-satisfydepends')
-rw-r--r-- | pbuilder-satisfydepends | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/pbuilder-satisfydepends b/pbuilder-satisfydepends index 92c1389..93b9a06 100644 --- a/pbuilder-satisfydepends +++ b/pbuilder-satisfydepends @@ -40,16 +40,29 @@ function checkbuilddep_versiondeps () { return 1; } +function expand_arch () { + local ARCH="$1" + local EXPANDED_ARCH + if echo "$ARCH" | grep "-" > /dev/null; then + EXPANDED_ARCH=$ARCH + else + EXPANDED_ARCH="linux-$ARCH" + fi + local WC1=$(echo $EXPANDED_ARCH | sed 's/^[^-]*/any/') + local WC2=$(echo $EXPANDED_ARCH | sed 's/[^-]*$/any/') + echo "$ARCH\\|$EXPANDED_ARCH\\|$WC1\\|$WC2" +} + function checkbuilddep_archdeps () { # returns FALSE on INSTALL local INSTALLPKG="$1" local ARCH="$2" - if echo "$INSTALLPKG" | sed 's/.*\(\[.*\]\)/\1/' | grep "[[/][!]$ARCH[]/]" > /dev/null; then + if echo "$INSTALLPKG" | sed 's/.*\(\[.*\]\)/\1/' | grep "[[/][!]\($(expand_arch $ARCH)\)[]/]" > /dev/null; then # if !$ARCH exists in there, ERROR. return 0; fi if ! echo "$INSTALLPKG" | sed 's/.*\(\[.*\]\)/\1/' | grep "[!]" > /dev/null; then - if ! echo "$INSTALLPKG" | sed 's/.*\(\[.*\]\)/\1/' | grep "[[/]$ARCH[]/]" > /dev/null; then + if ! echo "$INSTALLPKG" | sed 's/.*\(\[.*\]\)/\1/' | grep "[[/]\($(expand_arch $ARCH)\)[]/]" > /dev/null; then # if $ARCH does not exist, ERROR. return 0; fi |