From d296839c2ce999521612afc409a8c5a62f2c2bda Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Fri, 21 Jul 2017 15:29:52 +0000 Subject: [PATCH] pkg.sh log-install -W: Make python wrapper around python scripts Otherwise calls with /usr/bin/python /opt/package/bin/myscript.py fail with syntax error. Signed-off-by: Jan Lindemann --- scripts/pkg.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/pkg.sh b/scripts/pkg.sh index b15985f8..c1625b43 100644 --- a/scripts/pkg.sh +++ b/scripts/pkg.sh @@ -607,17 +607,17 @@ install_exe_wrapper() case $ext in py) - echo -e "#!/bin/bash\nexec /usr/bin/python \"$from\"" \"$to\" > "$tmp" + echo -e "#!/usr/bin/python\n\nimport sys\nimport subprocess\nargs=sys.argv; args[0] = \"$from\"\nsubprocess.call([ '/usr/bin/python' ] + args)" > "$tmp" ;; pl) - echo -e "#!/bin/bash\nexec /usr/bin/perl \"$from\"" \"$to\" > "$tmp" + echo -e "#!/bin/bash\n\nexec /usr/bin/perl \"$from\"" > "$tmp" ;; sh) - echo -e "#!/bin/bash\n. \"$from\"" \"$to\" > "$tmp" + echo -e "#!/bin/bash\n\n\"$from\"" > "$tmp" ;; *) if file "$from" | grep -qi executable; then - echo -e "#!/bin/bash\n. \"$from\"" \"$to\" > "$tmp" + echo -e "#!/bin/bash\n\n\"$from\"" > "$tmp" else ln -sf $from $to return