Skip to content

Commit

Permalink
Merge pull request #2031 from mariux64/update-python-wrapper
Browse files Browse the repository at this point in the history
Update python wrapper

- Install individual wrappers for each command, so that the wrappers work even with an unexpected "$0" when linked to another name
- Remove the dysfunctional /usr/bin/pyenv3
donald committed Feb 3, 2021
2 parents 616bfdd + aa315d1 commit b102e65
Showing 2 changed files with 20 additions and 26 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.)
@@ -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() {
@@ -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}"'

###############################################################################
##
23 changes: 8 additions & 15 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.)
@@ -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() {
@@ -80,7 +75,6 @@ mee_install() {
create_bin_wrapper pydoc3
create_bin_wrapper python3-config
create_bin_wrapper python3
create_bin_wrapper pyenv3 pyenv-3.3

create_bin_wrapper ipython3
create_bin_wrapper meson
@@ -104,10 +98,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}"'

###############################################################################
##

0 comments on commit b102e65

Please sign in to comment.