kbuild: deb-pkg fix install scripts for posix sh
PATCH 1/1 kbuild: deb-pkg fix install scripts for posix sh
bash versus dash and posh disagree on expanding $@ within double quotes:
export x="$@"
see http://bugs.debian.org/381091 for details
just use the arglist with $*.
dpkg: error processing linux-image-2.6.31-rc1_2.6.31-rc1-18_i386.deb (--install):
subprocess pre-installation script returned error exit status 2
export: 6: 2.6.31-rc1-18: bad variable name
fixes http://bugzilla.kernel.org/show_bug.cgi?id=13567
seen on Ubuntu as there dash is the default sh, versus bash on Debian.
--- scripts/package/builddeb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
scripts/package/builddeb +1 -1
@@ -89,7 +89,7 @@ for script in postinst postrm preinst prerm ; do set -e # Pass maintainer script parameters to hook scripts -export DEB_MAINT_PARAMS="\$@" +export DEB_MAINT_PARAMS="\$*" test -d $debhookdir/$script.d && run-parts --arg="$version" $debhookdir/$script.d exit 0
Signature · 1 line
1.5.6.5
Quoted 4 lines · maximilian attems
bash versus dash and posh disagree on expanding $@ within double
quotes: export x="$@"
see http://bugs.debian.org/381091 for details
just use the arglist with $*.
[...]
scripts/package/builddeb for script in postinst postrm preinst prerm ; do · line 92
Quoted 10 lines
scripts/package/builddeb +1
-1@@ -89,7 +89,7 @@ for script in postinst postrm preinst prerm ; do set -e # Pass maintainer script parameters to hook scripts -export DEB_MAINT_PARAMS="\$@" +export DEB_MAINT_PARAMS="\$*"
Although blindly replacing "$@" by "$*" can cause regressions because they *do* expand differently [1], I do not see a problem in this case given that AFAIK Debian maintainer scripts only pass parameters without whitespace in them.
[1] $@ preserves quoting; try the following:
cat <<EOF >test.fjp
#! /bin/bash
for i in "$*"; do echo $i; done
for i in "$@"; do echo $i; done
EOF
chmod +x test.fjp
./test.fjp This "is a" test
Quoted 5 lines · On Sun, 5 Jul 2009 20:17:34 +0200 maximilian attems <[email protected]> wrote:
bash versus dash and posh disagree on expanding $@ within double
quotes: export x="$@"
see http://bugs.debian.org/381091 for details
just use the arglist with $*.
Quoted 8 lines
dpkg: error processing linux-image-2.6.31-rc1_2.6.31-rc1-18_i386.deb (--install): subprocess pre-installation script returned error exit status 2 export: 6: 2.6.31-rc1-18: bad variable name fixes http://bugzilla.kernel.org/show_bug.cgi?id=13567
seen on Ubuntu as there dash is the default sh,
versus bash on Debian.
This should be applied ASAP, as it breaks things for every ubuntu user who attempts to use 'make deb-pkg'.
Quoted 21 lines
Reported-by Pauli <[email protected]>Cc Frans Pop <[email protected]>Cc Andres Salomon <[email protected]>Signed-off-by maximilian attems <[email protected]>--- scripts/package/builddeb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)scripts/package/builddeb +1
-1@@ -89,7 +89,7 @@ for script in postinst postrm preinst prerm ; do set -e # Pass maintainer script parameters to hook scripts -export DEB_MAINT_PARAMS="\$@" +export DEB_MAINT_PARAMS="\$*" test -d $debhookdir/$script.d && run-parts --arg="$version"$debhookdir/$script.d exit 0
Quoted 10 lines · maximilian attems
bash versus dash and posh disagree on expanding $@ within double quotes:
export x="$@"
see http://bugs.debian.org/381091 for details
just use the arglist with $*.dpkg: error processing linux-image-2.6.31-rc1_2.6.31-rc1-18_i386.deb (--install):
subprocess pre-installation script returned error exit status 2
export: 6: 2.6.31-rc1-18: bad variable name
fixes http://bugzilla.kernel.org/show_bug.cgi?id=13567
Quoted 7 lines
seen on Ubuntu as there dash is the default sh, versus bash on Debian.
Reported-by Pauli <[email protected]>Cc Frans Pop <[email protected]>Cc Andres Salomon <[email protected]>Signed-off-by maximilian attems <[email protected]>
Applied to kbuild-fixes.git
Sam