| #!/bin/sh |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| if [ -z "$PYCOPY_PYTHON" ]; then |
| python='python' |
| else |
| python="$PYCOPY_PYTHON" |
| fi |
| |
| if [ -z "$PYCOPY_PREFIX" ]; then |
| prefix='/usr' |
| else |
| prefix="$PYCOPY_PREFIX" |
| fi |
| |
| if [ -z "$PYCOPY_DSTDIR" ]; then |
| dstdir='.' |
| else |
| dstdir="$PYCOPY_DSTDIR" |
| fi |
| |
| for pysrc in $@; do |
| basename=$(basename "$pysrc"); |
| |
| sed -e '1s@^#!.*@#!'" $prefix/bin/$python"'@g' \ |
| "$pysrc" > "$dstdir/$basename" || exit 2 |
| |
| if [ "$(head -n1 "$dstdir/$basename")" = "#! $prefix/bin/$python" ]; then |
| chmod +x "$dstdir/$basename" || exit 2 |
| fi |
| done |
| |
| exit 0 |