]> code.ossystems Code Review - openembedded-core.git/commitdiff
postinst_intercept: allow to pass variables with spaces
authorMartin Jansa <martin.jansa@gmail.com>
Fri, 4 Sep 2015 12:22:27 +0000 (14:22 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 19 Sep 2015 10:51:11 +0000 (11:51 +0100)
* trying to pass foo="a b" through postinst_intercept ends
  with the actual script header to containing:
  b
  foo=a
  which fails because "b" command doesn't exist.

(From OE-Core rev: c66d7d85b7225be8c838449324d506565dd0081d)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster@mvista.com>
scripts/postinst-intercepts/postinst_intercept

index 27c256834ce6cde7cc8fddabfbfc5c11a7f3a877..517ee101d252f740a61b52738b3d6704cd6e5f58 100755 (executable)
@@ -48,7 +48,7 @@ if [ -n "$pkgs_line" ]; then
                sed -i -e "s/##PKGS:.*/\0${package_name} /" $intercept_script
        fi
 else
-       for var in $@; do
+       for var in "$@"; do
                sed -i -e "\%^#\!/bin/.*sh%a $var" $intercept_script
        done
        echo "##PKGS: ${package_name} " >> $intercept_script