[packages/python-llfuse] - fix shebangs in examples

baggins baggins at pld-linux.org
Wed Mar 3 23:11:09 CET 2021


commit e9a880371768e7365aff7caaeb91d26b1160be62
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Wed Mar 3 23:10:42 2021 +0100

    - fix shebangs in examples

 python-llfuse.spec | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/python-llfuse.spec b/python-llfuse.spec
index aaf71b6..23c470b 100644
--- a/python-llfuse.spec
+++ b/python-llfuse.spec
@@ -93,12 +93,16 @@ rm -rf $RPM_BUILD_ROOT
 %if %{with python2}
 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+
+%{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+python3(\s|$),#!%{__python}\1,' \
+      $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/*.py
 %endif
 %if %{with python3}
 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
-find $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version} -name '*.py' \
-	| xargs sed -i '1s|^#!.*python\b|#!%{__python3}|'
+
+%{__sed} -E -i -e '1s,#!\s*/usr/bin/env\s+python3(\s|$),#!%{__python3}\1,' \
+      $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}/*.py
 %endif
 
 %clean
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-llfuse.git/commitdiff/e9a880371768e7365aff7caaeb91d26b1160be62



More information about the pld-cvs-commit mailing list