From 999358a4061a6246facd3999fa9bdc572a366fbe Mon Sep 17 00:00:00 2001 From: codehelp Date: Wed, 28 Jul 2010 18:30:44 +0000 Subject: [PATCH] Allow check-deps.sh to detect | dependencies. git-svn-id: http://emdebian.org/svn/current@7348 563faec7-e20c-0410-992a-a66f704d0ccd --- check-deps.sh | 34 ++++++++++++++++++++++++++++++---- debian/changelog | 3 ++- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/check-deps.sh b/check-deps.sh index aff9451..68e1a94 100755 --- a/check-deps.sh +++ b/check-deps.sh @@ -42,8 +42,8 @@ case "$1" in YES=1 ;; *) - echo "Unrecognised option: $1" - exit; + FILE=$1 + shift ;; esac done @@ -63,6 +63,14 @@ for pkg in $DEPS; do if [ "apt" = "$name" ]; then continue fi + orlist=$(echo $pkg|grep "|" || true) + while [ -n "$orlist" ]; do + ORPKG=`echo $pkg|cut -d'|' -f2|sed -e 's/^ //'` + ALTERNATE="$ALTERNATE $ORPKG" + orlist=$(echo $orlist | sed -e "s/.*$ORPKG//;s/^ *//;s/ *$//") + ALTERNATE=$(echo $ALTERNATE|sed -e 's/^ *//;s/ *$//') + pkg=$(echo $pkg|sed -e "s/|//;s/$ORPKG//;s/^ *//;s/ *$//") + done if [ -n `echo $pkg|grep '('` ]; then VERLIMIT=`echo $pkg|cut -d'(' -f2|tr -d ')'|tr -d '\n'|grep -v $name || true` VERCMP=`echo $VERLIMIT|sed -e 's/\(.*\) \(.*\)/\1/'` @@ -75,6 +83,24 @@ for pkg in $DEPS; do CHECK=`dpkg --compare-versions $POLICY "$VERCMP" $VERLIMIT ; echo $?` set -e fi + if [ -z "$CHECK" ]; then + VERLIMIT= + VERCMP= + name=$(echo $ALTERNATE|sed -e 's/^ //'|cut -d' ' -f1) + if [ -n `echo $ALTERNATE|grep '('` ]; then + VERLIMIT=`echo $ALTERNATE|cut -d'(' -f2|tr -d ')'|tr -d '\n'|grep -v $name || true` + VERCMP=`echo $VERLIMIT|sed -e 's/\(.*\) \(.*\)/\1/'` + VERLIMIT=`echo $VERLIMIT|sed -e 's/\(.*\) \(.*\)/\2/'` + fi + POLICY=`LC_ALL=C apt-cache policy $name 2>/dev/null|grep Candidate|cut -d':' -f2-3|tr -d ' '` + if [ -n "$POLICY" ]; then + if [ -n "$VERLIMIT" ]; then + set +e + CHECK=`dpkg --compare-versions $POLICY "$VERCMP" $VERLIMIT ; echo $?` + set -e + fi + fi + fi else ERR="$ERR $name " fi @@ -95,6 +121,6 @@ fi if [ -n "$INSTALL" ]; then eval apt-get install "$CMD" dpkg -i $FILE -else - echo apt-get install $CMD +elif [ -n "$CMD" ]; then + echo apt-get install ${CMD} fi diff --git a/debian/changelog b/debian/changelog index 0c21373..0cd0182 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,8 +6,9 @@ multistrap (2.1.6) unstable; urgency=low * Call dpkg --print-architecture for determination of host architecture. (Closes: #589713) * Add aptitude to crosschroot configs as pbuilder now requires it. + * Allow check-deps.sh to detect | dependencies. - -- Neil Williams Mon, 26 Jul 2010 22:53:39 +0100 + -- Neil Williams Wed, 28 Jul 2010 19:30:25 +0100 multistrap (2.1.5) unstable; urgency=low