diff options
Diffstat (limited to 'pbuilder-satisfydepends-experimental')
-rwxr-xr-x | pbuilder-satisfydepends-experimental | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/pbuilder-satisfydepends-experimental b/pbuilder-satisfydepends-experimental index d0cf38e..d544f28 100755 --- a/pbuilder-satisfydepends-experimental +++ b/pbuilder-satisfydepends-experimental @@ -114,17 +114,22 @@ function versioneddep_to_aptcmd () { PACKAGEVERSIONS="$( package_versions "$PACKAGE" | tac | xargs )" CANDIDATE_VERSION="$( candidate_version "$PACKAGE" )" - # try the candidate version, then all available versions (asc) COMPARESTRING="$(echo "$INSTALLPKG" | tr "/" " " | sed 's/^.*([ ]*\(<<\|<=\|>=\|=\|<\|>>\|>\)[ ]*\(.*\)).*$/\1/')" DEPSVERSION="$(echo "$INSTALLPKG" | tr "/" " " | sed 's/^.*([ ]*\(<<\|<=\|>=\|=\|<\|>>\|>\)[ ]*\(.*\)).*$/\2/')" - for VERSION in $CANDIDATE_VERSION $PACKAGEVERSIONS; do - if dpkg --compare-versions "$VERSION" "$COMPARESTRING" "$DEPSVERSION"; then - if [ $VERSION != $CANDIDATE_VERSION ]; then - PACKAGE_WITHVERSION="$PACKAGE=$VERSION" + # if strictly versionned, we skip to outputting that version + if [ "=" = "$COMPARESTRING" ]; then + PACKAGE_WITHVERSION="$PACKAGE=$DEPSVERSION" + else + # try the candidate version, then all available versions (asc) + for VERSION in $CANDIDATE_VERSION $PACKAGEVERSIONS; do + if dpkg --compare-versions "$VERSION" "$COMPARESTRING" "$DEPSVERSION"; then + if [ $VERSION != $CANDIDATE_VERSION ]; then + PACKAGE_WITHVERSION="$PACKAGE=$VERSION" + fi + break; fi - break; - fi - done + done + fi fi echo "$PACKAGE_WITHVERSION" |