diff options
author | Marcell Meszaros | 2023-08-08 12:26:09 +0200 |
---|---|---|
committer | Marcell Meszaros | 2023-08-08 12:26:09 +0200 |
commit | b4c8d287a210e7d0e573bad903520bdcf753aefa (patch) | |
tree | 81383f893b3eafb08e90e259806a2d224536d1a3 /fix-python-scripts.sh | |
parent | 82b6c25749ea6ddad4d0d6615939c05612045368 (diff) | |
download | aur-ros-build-tools-py3.tar.gz |
0.3.1-5: remove unneeded fix-python-scripts.sh
Diffstat (limited to 'fix-python-scripts.sh')
-rwxr-xr-x | fix-python-scripts.sh | 49 |
1 files changed, 0 insertions, 49 deletions
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 - |