control: tag -1 patch On Sun, Dec 14, 2014 at 5:50 PM, Adam D. Barratt wrote: > Control: reopen -1 > > On Sun, 2014-12-14 at 21:48 +0000, Michael Gilbert wrote: >> cmtk (3.2.2-1.1) unstable; urgency=medium >> . >> * Non-maintainer upload. >> * Fix bashisms in shell scripts (closes: #772217). > > Unfortunately the fixes are incorrect in some cases: > > +- if [[ "${line}" =~ ^\} ]]; then > ++ if [ "${line}" =~ ^\} ]; then > > Even bash doesn't support =~ outside of its [[ extension.
Thanks for pointing that out. I'm attaching a proposed revision that uses expr those comparisons. Please let me know if that looks ok, and I'll upload to deferred if it is. Best wishes, Mike
diff -Nru cmtk-3.2.2/debian/changelog cmtk-3.2.2/debian/changelog --- cmtk-3.2.2/debian/changelog 2014-09-21 09:31:19.000000000 +0000 +++ cmtk-3.2.2/debian/changelog 2014-12-14 23:36:32.000000000 +0000 @@ -1,3 +1,24 @@ +cmtk (3.2.2-1.3) unstable; urgency=medium + + * Non-maintainer upload. + * Use expr for posix-compliant regex comparison (closes: #772217). + + -- Michael Gilbert <mgilb...@debian.org> Sun, 14 Dec 2014 23:29:49 +0000 + +cmtk (3.2.2-1.2) unstable; urgency=medium + + * Non-maintainer upload. + * Correct typo in previous upload. + + -- Michael Gilbert <mgilb...@debian.org> Sun, 14 Dec 2014 22:20:04 +0000 + +cmtk (3.2.2-1.1) unstable; urgency=medium + + * Non-maintainer upload. + * Fix bashisms in shell scripts (closes: #772217). + + -- Michael Gilbert <mgilb...@debian.org> Sun, 14 Dec 2014 21:18:47 +0000 + cmtk (3.2.2-1) unstable; urgency=medium * New upstream minor bugfix release diff -Nru cmtk-3.2.2/debian/patches/fix-bashisms.patch cmtk-3.2.2/debian/patches/fix-bashisms.patch --- cmtk-3.2.2/debian/patches/fix-bashisms.patch 1970-01-01 00:00:00.000000000 +0000 +++ cmtk-3.2.2/debian/patches/fix-bashisms.patch 2014-12-14 23:35:16.000000000 +0000 @@ -0,0 +1,69 @@ +Author: Michael Gilbert <mgilb...@debian.org> +Description: Fix bashisms in shell scripts +Bugs-Debian: http://bugs.debian.org/772217 + +--- a/scripts/cmtk_functions.sh.in ++++ b/scripts/cmtk_functions.sh.in +@@ -32,9 +32,9 @@ export CMTK_BINARY_DIR=${CMTK_BINARY_DIR + + # Check whether we have "lockfile" tool available and include proper script with locking functions + if which lockfile > /dev/null; then +- source ${CMTK_BINARY_DIR}/cmtk_locking_procmail.sh ++ . ${CMTK_BINARY_DIR}/cmtk_locking_procmail.sh + else +- source ${CMTK_BINARY_DIR}/cmtk_locking.sh ++ . ${CMTK_BINARY_DIR}/cmtk_locking.sh + fi + + # For convenience and readability +--- a/scripts/correct_dwi_distortion_and_motion.in ++++ b/scripts/correct_dwi_distortion_and_motion.in +@@ -121,7 +121,7 @@ for bX in ${b0FwdCorr} ${bXlist}; do + bXUnwarp=${outdir}/${base} + pref=`echo ${base} | sed 's/\..*//g'` + +- if [ "${bX}" == "${b0FwdCorr}" ]; then ++ if [ "${bX}" = "${b0FwdCorr}" ]; then + if CMTK_needs_update_and_lock ${outdir}/motion/${base} ${b0FwdCorr}; then + cmtk convertx ${b0FwdCorr} ${outdir}/motion/${base} + CMTK_lockfile_delete ${outdir}/motion/${base} +--- a/scripts/groupwise_reformat.in ++++ b/scripts/groupwise_reformat.in +@@ -45,8 +45,8 @@ fi + + # put all arguments starting with "-" into reformat options + reformatOptions="" +-while [[ "$1" =~ ^- ]]; do +- reformatOptions+="$1 " ++while expr "$1" : ^- >/dev/null; do ++ reformatOptions="${reformatOptions}$1 " + shift + done + +@@ -89,7 +89,7 @@ make_output_path() + base=`basename $dir | sed 's/\.,*//g'` + dir=`dirname $dir` + +- ((++idx)) ++ $((idx=idx+1)) + done + + echo ${pattern} +@@ -103,7 +103,7 @@ process_target() + echo "! TYPEDSTREAM 1.1" > ${tmp} + + while IFS="" read line; do +- if [[ "${line}" =~ ^\} ]]; then ++ if expr "${line}" : ^\} >/dev/null; then + break; + fi + +@@ -123,7 +123,7 @@ process_target() + parse_xform_file() + { + while read line; do +- if [[ "${line}" =~ "target" ]]; then ++ if expr "${line}" : "target" >/dev/null; then + target=`echo ${line} | sed 's/target \"//g; s/\".*//g'` + process_target ${target} + fi diff -Nru cmtk-3.2.2/debian/patches/series cmtk-3.2.2/debian/patches/series --- cmtk-3.2.2/debian/patches/series 2014-09-21 09:31:19.000000000 +0000 +++ cmtk-3.2.2/debian/patches/series 2014-12-14 21:32:29.000000000 +0000 @@ -1 +1,2 @@ up_assure_no_as_needed_for_checklibdep +fix-bashisms.patch