mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 12:03:31 +01:00
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 <jan@janware.com>
This commit is contained in:
parent
a4ef394a95
commit
d296839c2c
1 changed files with 4 additions and 4 deletions
|
|
@ -607,17 +607,17 @@ install_exe_wrapper()
|
||||||
|
|
||||||
case $ext in
|
case $ext in
|
||||||
py)
|
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)
|
pl)
|
||||||
echo -e "#!/bin/bash\nexec /usr/bin/perl \"$from\"" \"$to\" > "$tmp"
|
echo -e "#!/bin/bash\n\nexec /usr/bin/perl \"$from\"" > "$tmp"
|
||||||
;;
|
;;
|
||||||
sh)
|
sh)
|
||||||
echo -e "#!/bin/bash\n. \"$from\"" \"$to\" > "$tmp"
|
echo -e "#!/bin/bash\n\n\"$from\"" > "$tmp"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
if file "$from" | grep -qi executable; then
|
if file "$from" | grep -qi executable; then
|
||||||
echo -e "#!/bin/bash\n. \"$from\"" \"$to\" > "$tmp"
|
echo -e "#!/bin/bash\n\n\"$from\"" > "$tmp"
|
||||||
else
|
else
|
||||||
ln -sf $from $to
|
ln -sf $from $to
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue