diff --git a/python-pyserial.changes b/python-pyserial.changes index a2e42f8..0c83dc3 100644 --- a/python-pyserial.changes +++ b/python-pyserial.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Aug 7 16:32:29 UTC 2017 - toddrme2178@gmail.com + +- Further fix shebangs + ------------------------------------------------------------------- Sun Aug 6 18:07:57 UTC 2017 - toddrme2178@gmail.com diff --git a/python-pyserial.spec b/python-pyserial.spec index 6e375bf..4d80c74 100644 --- a/python-pyserial.spec +++ b/python-pyserial.spec @@ -53,11 +53,11 @@ Documentation, examples, and help files for %{name}. %prep %setup -q -n pyserial-%{version} -sed -i "s|#\!\/usr\/bin\/env python||" serial/{serialposix,__init__}.py # Fix non-executable scripts +sed -i "s|^#\!\/usr\/bin\/env python$||" serial/{serialposix,__init__}.py # Fix non-executable scripts sed -i "s/\r//" examples/port_publisher.py # Fix EOL encoding -find examples -name '*.py' -exec sed -i "s|#!/usr/bin/env python|#!%__python3|" {} \; -find examples -name '*.py' -exec sed -i "s|#! /usr/bin/env python|#!%__python3|" {} \; -find examples -name '*.py' -exec sed -i "s|#! python|#!%__python3|" {} \; +find examples -name '*.py' -exec sed -i "s|^#!/usr/bin/env python$|#!%{__python3}|" {} \; +find examples -name '*.py' -exec sed -i "s|^#! /usr/bin/env python$|#!%{__python3}|" {} \; +find examples -name '*.py' -exec sed -i "s|^#! python$|#!%{__python3}|" {} \; %build %python_build @@ -73,10 +73,10 @@ rm documentation/_build/doctrees/environment.pickle %{python_expand pushd %{buildroot}%{$python_sitelib} # Fix wrong-script-interpreter -sed -i "s|#!/usr/bin/env python|#!%__$python|" serial/tools/*.py -sed -i "s|#!/usr/bin/env python|#!%__$python|" serial/threaded/__init__.py -sed -i "s|#!/usr/bin/env python|#!%__$python|" serial/rs485.py -sed -i "s|#! python||#!%__$python|" serial/tools/*.py +sed -i "s|^#!/usr/bin/env python$|#!%{__$python}|" serial/tools/*.py +sed -i "s|^#!/usr/bin/env python3$|#!%{__$python}|" serial/threaded/__init__.py +sed -i "s|^#!/usr/bin/env python$|#!%{__$python}|" serial/rs485.py +sed -i "s|^#! python$||#!%{__$python}|" serial/tools/*.py chmod a+x serial/tools/*.py chmod a-x serial/tools/__init__.py chmod a-x serial/tools/list_ports_windows.py