Re: [PATCH] kbuild: deb-pkg fix install scripts for posix sh

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sunday 05 July 2009, maximilian attems 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 $*.
[...]
> diff --git a/scripts/package/builddeb b/scripts/package/builddeb
> index b19f1f4..8b357b0 100644
> --- a/scripts/package/builddeb
> +++ b/scripts/package/builddeb
> @@ -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.

Acked-by: Frans Pop <elendil@xxxxxxxxx>


[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
--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux