Skip to content

Commit

Permalink
python2-wrapper: Update wrapper scripts
Browse files Browse the repository at this point in the history
Use individual wrapper scripts instead of a hardlinked prototype which
forwards to $(basename "$0"), because this doesn't work if the user
links or hardlinks the wrapper to an unexpected command not available in
the package.
  • Loading branch information
donald committed Jan 21, 2021
1 parent 161fb57 commit c3ba32f
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions python2-wrapper.be0
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env beesh

# BEE_VERSION python2-wrapper-1.3-0
# BEE_VERSION python2-wrapper-1.4-0

## this file was created by bee init and should be executed to build a
## bee-package. (Additional hints are located at the end of this file.)
Expand Down Expand Up @@ -57,12 +57,15 @@ SRCURL[0]=""
# bee_configure
#}

mee_build() {
echo -e '#! /bin/bash\nprun python2 $(basename "$0") "$@"' >wrapper
chmod +x wrapper
#mee_buid() {
# bee_build
#}

echo -e '#! /bin/bash\nprun python-2.7 $(basename "$0") "$@"' >wrapper2.7
chmod +x wrapper2.7
create_bin_wrapper() {
cmd="$1"
target="${2:-$1}"
echo -e "#! /bin/bash\nprun python2 \"$target\" \"\$@\"" > "$D$BINDIR/$cmd"
chmod +x "$D$BINDIR/$cmd"
}

mee_install() {
Expand All @@ -76,14 +79,12 @@ mee_install() {
xml2po \
gnome-doc-tool \
pssh \
iotop
iotop \
python2.7
do
ln "$B/wrapper" "$D$BINDIR/$cmd"
create_bin_wrapper $cmd
done

ln "$B/wrapper2.7" "$D$BINDIR/python2.7"
}
## by default this may be 'make install DESTDIR="${D}"'

###############################################################################
##
Expand Down

0 comments on commit c3ba32f

Please sign in to comment.