Package: devscripts
Version: 2.10.6
Severity: important
Tags: patch

Hello.

I found a couple of bugs while trying to use deb-reversion. Pretty
useful when combined with "-k zsh", so thanks for it. ;-)

The first bug is that -v is not honored at all: the new version is
always what the program calculates.

The second is that when it's honored, it is used within single quotes, 
resulting in package names like python_'2.5-1'_all.deb.

The attached patch fixes the issue for me; I added "eval" to the other
functions as well, since it seems they would be needed. I'm not sure of
the interaction of that when -k contains an argument with spaces,
though.

HTH,

-- 
Adeodato Simó                                     dato at net.com.org.es
Debian Developer                                  adeodato at debian.org
 
                                  Listening to: Kiko Veneno - Hace calor
--- /usr/bin/deb-reversion	2007-06-30 16:18:14.000000000 +0200
+++ /home/adeodato/bin/deb-reversion	2007-07-17 16:16:24.000000000 +0200
@@ -69,10 +69,10 @@
 DEB=
 for opt in $@; do
   case "${OPT_STATE:-}" in
-    SET_OLD_VERSION) OLD_VERSION="$opt";;
-    SET_NEW_VERSION) NEW_VERSION="$opt";;
-    SET_STRING) VERSTR="$opt";;
-    SET_HOOK) HOOK="$opt";;
+    SET_OLD_VERSION) eval OLD_VERSION="$opt";;
+    SET_NEW_VERSION) eval NEW_VERSION="$opt";;
+    SET_STRING) eval VERSTR="$opt";;
+    SET_HOOK) eval HOOK="$opt";;
     *) :;;
   esac
   [ -n "${OPT_STATE:-}" ] && unset OPT_STATE && continue
@@ -189,7 +189,7 @@
 }
 
 [ -z "${OLD_VERSION:-}" ] && OLD_VERSION="$(get_version $DEB)"
-NEW_VERSION="$(bump_version $OLD_VERSION)"
+[ -z "${NEW_VERSION:-}" ] && NEW_VERSION="$(bump_version $OLD_VERSION)"
 
 if [ $CALCULATE -eq 1 ]; then
   eval echo $NEW_VERSION

Reply via email to