[oe-commits] Martin Jansa : postinst_intercept: allow to pass variables with spaces

git at git.openembedded.org git at git.openembedded.org
Mon Sep 7 16:02:07 UTC 2015


Module: openembedded-core.git
Branch: master-next
Commit: c66d7d85b7225be8c838449324d506565dd0081d
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=c66d7d85b7225be8c838449324d506565dd0081d

Author: Martin Jansa <martin.jansa at gmail.com>
Date:   Fri Sep  4 14:22:27 2015 +0200

postinst_intercept: allow to pass variables with spaces

* 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.

Signed-off-by: Martin Jansa <Martin.Jansa at gmail.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 scripts/postinst-intercepts/postinst_intercept | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/postinst-intercepts/postinst_intercept b/scripts/postinst-intercepts/postinst_intercept
index a257198..b18e806 100755
--- a/scripts/postinst-intercepts/postinst_intercept
+++ b/scripts/postinst-intercepts/postinst_intercept
@@ -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



More information about the Openembedded-commits mailing list