[packages/python-Xlib] be more precise when updating python shebangs

atler atler at pld-linux.org
Wed Jan 13 10:59:17 CET 2021


commit 8e70f5e83354585c77e9c158c332337566255c6f
Author: Jan Palus <atler at pld-linux.org>
Date:   Wed Jan 13 10:56:42 2021 +0100

    be more precise when updating python shebangs
    
    single script requests for python3 interpreter however it is python2
    compatible

 python-Xlib.spec | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/python-Xlib.spec b/python-Xlib.spec
index e767288..7f5bc52 100644
--- a/python-Xlib.spec
+++ b/python-Xlib.spec
@@ -92,6 +92,7 @@ Dokumentacja API modułu Pythona Xlib.
 
 %prep
 %setup -q -n python-xlib-%{version}
+%undos examples/*.py
 
 %build
 %if %{with python2}
@@ -124,8 +125,8 @@ rm -rf $RPM_BUILD_ROOT
 
 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
 install examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
-%{__sed} -i -e '1s,/usr/bin/python,%{__python},' \
-	-e '1s,/usr/bin/env python,%{__python},' $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/*.py
+%{__sed} -i -e '1s,/usr/bin/python3\?$,%{__python},' \
+	-e '1s,/usr/bin/env python3\?$,%{__python},' $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}/*.py
 %endif
 
 %if %{with python3}
@@ -133,8 +134,8 @@ install examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
 
 install -d $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
 install examples/* $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}
-%{__sed} -i -e '1s,/usr/bin/python,%{__python3},' \
-	-e '1s,/usr/bin/env python,%{__python3},' $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}/*.py
+%{__sed} -i -e '1s,/usr/bin/python3\?$,%{__python3},' \
+	-e '1s,/usr/bin/env python3\?$,%{__python3},' $RPM_BUILD_ROOT%{_examplesdir}/python3-%{module}-%{version}/*.py
 %endif
 
 %clean
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-Xlib.git/commitdiff/8e70f5e83354585c77e9c158c332337566255c6f



More information about the pld-cvs-commit mailing list