diff options
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 8 | ||||
-rwxr-xr-x | fix-python-scripts.sh | 49 |
3 files changed, 4 insertions, 57 deletions
@@ -1,7 +1,7 @@ pkgbase = ros-build-tools-py3 pkgdesc = Utilities for building Arch packages for ROS stacks. pkgver = 0.3.1 - pkgrel = 4 + pkgrel = 5 url = https://github.com/ros-melodic-arch/ros-build-tools-py3 arch = any license = BSD @@ -11,10 +11,8 @@ pkgbase = ros-build-tools-py3 optdepends = python-termcolor optdepends = python-certifi conflicts = ros-build-tools - source = fix-python-scripts.sh source = clear-ros-env.sh source = create_pkgbuild.py - sha256sums = 5528486d640d91136276edda2075aefc06f360e6297e556051bae57b9479aeda sha256sums = 9626b8e5f3865f5640660f4a7f6a00afc4db8448b95329b4d5a64bd691677a88 sha256sums = 6171500f4e807e170f3705277032107b3902502a7fcccf8ab5b300a35580ebf7 @@ -6,7 +6,7 @@ url="https://github.com/ros-melodic-arch/ros-build-tools-py3" pkgname='ros-build-tools-py3' pkgver='0.3.1' arch=('any') -pkgrel='4' +pkgrel='5' license=('BSD') makedepends=() optdepends=('python3' 'python-yaml' 'python-termcolor' 'python-certifi') @@ -16,12 +16,10 @@ conflicts=('ros-build-tools') pkg_destination_dir="/usr/share/ros-build-tools" -source=('fix-python-scripts.sh' - 'clear-ros-env.sh' +source=('clear-ros-env.sh' 'create_pkgbuild.py') -sha256sums=('5528486d640d91136276edda2075aefc06f360e6297e556051bae57b9479aeda' - '9626b8e5f3865f5640660f4a7f6a00afc4db8448b95329b4d5a64bd691677a88' +sha256sums=('9626b8e5f3865f5640660f4a7f6a00afc4db8448b95329b4d5a64bd691677a88' '6171500f4e807e170f3705277032107b3902502a7fcccf8ab5b300a35580ebf7') build() { return 0 diff --git a/fix-python-scripts.sh b/fix-python-scripts.sh deleted file mode 100755 index 9dcbec59834a..000000000000 --- a/fix-python-scripts.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash - -if [ -z "$1" ]; then - echo "Usage: $0 [-v/--version PYTHON_VERSION] <directory>" - echo "" - echo "Makes sure that all Python scripts use the right python command." - echo "PYTHON_VERSION: either 2 or 3 (default = 2)." - echo " -Note that according to PEP 394, developers should use \"python\" in -the shebang line for code compatible with both Python 2 and 3, but -since this may not be the case, we always overwrite the shebang line. -For more information: http://legacy.python.org/dev/peps/pep-0394/" - exit 1 -fi - -# Default Python version: 3 -PYTHON_VERSION=3 - -while [[ $# > 1 ]] -do - key="$1" - shift - - case $key in - -v|--version) - PYTHON_VERSION="$1" - shift - ;; - *) - # unknown option - ;; - esac -done - -# Check user input -if [[ "$PYTHON_VERSION" != "2" && "$PYTHON_VERSION" != "3" ]]; then - echo "Error: invalid Python version given: $PYTHON_VERSION" - exit 2 -fi - -for file in $(grep -rl -e 'env python *$' -e 'bin/python *$' $1); do - if [ -z "$file" ]; then - echo "Error finding files." - exit 1 - fi - sed -i "s,env python *$,env python${PYTHON_VERSION},g" $file - sed -i "s,/usr/bin/python *$,/usr/bin/env python${PYTHON_VERSION},g" $file -done - |