Skip to content

Commit

Permalink
repack.d/generic.sh: more common python -> python2 shebang suport
Browse files Browse the repository at this point in the history
  • Loading branch information
George V. Kouryachy (Fr. Br. George) authored and vitlav committed Aug 6, 2022
1 parent 16fded6 commit 4437824
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion repack.d/generic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ done

for i in $BUILDROOT/usr/bin/* ; do
[ -f "$i" ] || continue
grep -q '^#!/usr/bin/python' $i && flag_python3=1
grep -Eq '^#!/usr/bin/python|^#!/usr/bin/env python' $i && flag_python3=1
subst 's|^#!/usr/bin/python$|#!/usr/bin/python3|' $i
subst 's|^#!/usr/bin/env python$|#!/usr/bin/env python3|' $i
done

# check for .py scripts
find $BUILDROOT -name "*.py" | grep -q "\.py$" && flag_python3=1
find $BUILDROOT -name "*.py" -exec subst '1{/python3/n};1i#!/usr/bin/python3' {} \;

if [ -n "$flag_python3" ] ; then
epm install --skip-installed rpm-build-python3
Expand Down

0 comments on commit 4437824

Please sign in to comment.