The following commit has been merged in the master branch:
commit 0772286fc912d523f8b134d32a902f96d3aef0d6
Author: Christoph Berg <[email protected]>
Date:   Sat Aug 18 21:42:57 2012 +0200

    dcmd: Reimplement endswith() with case.
    
    The original missed quoting and made my brain hurt. Luckily, case doesn't 
need
    any quoting here.

diff --git a/debian/changelog b/debian/changelog
index d90c705..d4155c0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -33,6 +33,8 @@ devscripts (2.12.2) UNRELEASED; urgency=low
     various sources, and unpack it
   * po4a/Makefile: use po4a --keep=0 so the build system doesn't die with
     untranslated scripts
+  * dcmd: Reimplement endswith() with case. The original missed quoting and
+    made my brain hurt.
 
  -- Benjamin Drung <[email protected]>  Thu, 26 Jul 2012 12:17:51 +0200
 
diff --git a/scripts/dcmd.sh b/scripts/dcmd.sh
index 72289e2..bc62176 100755
--- a/scripts/dcmd.sh
+++ b/scripts/dcmd.sh
@@ -51,7 +51,10 @@ usage()
 
 endswith()
 {
-    [ $(basename "$1" $2)$2 = $(basename "$1") ]
+    case $1 in
+       *$2) return 0 ;;
+       *) return 1;;
+    esac
 }
 
 # Instead of parsing the file completely as the previous Python

-- 
Git repository for devscripts

_______________________________________________
devscripts-devel mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/devscripts-devel

Reply via email to