]> git.ipfire.org Git - people/ms/pakfire.git/commitdiff
QA: Fix replacing all sorts of python interpreters.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 21 Oct 2012 11:47:18 +0000 (13:47 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 21 Oct 2012 11:47:18 +0000 (13:47 +0200)
tools/quality-agent.d/050-invalid-interpreters

index 09d0ba55e5ecf07086914d75ca5452b64344fe46..deac7a31b51525c00cec6088da8760675ea06143 100755 (executable)
@@ -22,10 +22,11 @@ check() {
                        fi
 
                        # Search for bad /usr/bin/env
-                       if [ "$(basename ${interpreter})" = "env" ]; then       
+                       interp=$(basename ${interpreter} 2>/dev/null)
+                       if [ "${interp}" = "env" ]; then
                                # Autofix that crap
                                sed -i ${file} \
-                                       -e "s,/usr/bin/env python.\..,/usr/bin/python," \
+                                       -e "s,/usr/bin/env python\(.*\),/usr/bin/python\1," \
                                        -e "s,/usr/bin/env python,/usr/bin/python," \
                                        -e "s,/usr/bin/env perl,/usr/bin/perl,"