[Bug 966867] [NEW] debsign --debs-dir is broken due to incorrectly added quotes

Launchpad Bug Tracker 966867 at bugs.launchpad.net
Wed Mar 28 08:12:50 UTC 2012


You have been subscribed to a public bug by Steve Beattie (sbeattie):

debsign from devscripts in precise has broken the --debs-dir option:

  $ ls -ld ../source
  drwxrwxr-x 2 steve steve 4096 Mar 27 23:12 ../source
  $ debsign --debs-dir ../source
 debsign: could not find directory "../source"!

strace'ing debsign shows it trying to do:

  15372 stat("\"../source\"", 0x7fffbbc3bba0) = -1 ENOENT (No such file
or directory)

(notice the extra \" in there.)

Looking at the source, when handling the option, it does the following:

        --debs-dir)
            shift
            opt_debsdir="$(echo \"${1%/}\" | sed -e 's%/\+%/%g')"

note that this is slightly different than how the default directory is
generated

  DEBRELEASE_DEBS_DIR="`echo \"$DEBRELEASE_DEBS_DIR\" | sed -e
's%/\+%/%g; s%\(.\)/$%\1%;'`"

in that the latter uses shell backticks rather than $() to run
subcommands. This will behave differently, at least under dash:

$ cat dash.sh
#!/bin/sh

FOO="$(echo \"foo bar\")"
BAR="`echo \"foo bar\"`"

$ sh -xe dash.sh
+ echo "foo bar"
+ FOO="foo bar"
+ echo foo bar
+ BAR=foo bar

Bash behaves similarly. Changing the opt_debsdir definition line to the
following:

  opt_debsdir="$(echo "${1%/}" | sed -e 's%/\+%/%g')"

(i.e. removing the backslash escaping of ") causes things to work as
expected.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: devscripts 2.11.4ubuntu1
ProcVersionSignature: Ubuntu 3.2.0-17.27-generic 3.2.6
Uname: Linux 3.2.0-17-generic x86_64
ApportVersion: 1.95-0ubuntu1
Architecture: amd64
CheckboxSubmission: 9c15077a0ca11678d04e060687c26674
CheckboxSystem: 5dc75472945f57d094b84e90feb97396
Date: Tue Mar 27 23:05:42 2012
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64 (20110426)
ProcEnviron:
 TERM=screen
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: devscripts
UpgradeStatus: Upgraded to precise on 2012-01-30 (57 days ago)

** Affects: devscripts (Ubuntu)
     Importance: Undecided
         Status: New

** Affects: devscripts (Debian)
     Importance: Unknown
         Status: Unknown


** Tags: amd64 apport-bug precise
-- 
debsign --debs-dir is broken due to incorrectly added quotes
https://bugs.launchpad.net/bugs/966867
You received this bug notification because you are a member of Ubuntu Sponsors Team, which is subscribed to the bug report.



More information about the Ubuntu-sponsors mailing list