Skip to content

Commit

Permalink
python3-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 c3ba32f commit 89551f9
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions python3-wrapper.be0
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env beesh

# BEE_VERSION python3-wrapper-1.1-0
# BEE_VERSION python3-wrapper-1.2-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,20 +57,15 @@ SRCURL[0]=""
# bee_configure
#}

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

create_bin_wrapper() {
cmd="$1"
target="$2"
if [ -z "$target" ]; then
ln "$B/wrapper" "$D$BINDIR/$cmd"
else
echo -e "#! /bin/bash\nprun python3 \"$target\" \"\$@\"" > "$D$BINDIR/$cmd"
chmod +x "$D$BINDIR/$cmd"
fi
target="${2:-$1}"
echo -e "#! /bin/bash\nprun python3 \"$target\" \"\$@\"" > "$D$BINDIR/$cmd"
chmod +x "$D$BINDIR/$cmd"
}

mee_install() {
Expand Down Expand Up @@ -104,10 +99,9 @@ mee_install() {
rst2s5.py \
rstpep2html.py
do
ln "$B/wrapper" "$D$BINDIR/$cmd"
create_bin_wrapper $cmd
done
}
## by default this may be 'make install DESTDIR="${D}"'

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

0 comments on commit 89551f9

Please sign in to comment.