diff --git a/lightdm-settings.spec b/lightdm-settings.spec index 118ae7e..96893b3 100644 --- a/lightdm-settings.spec +++ b/lightdm-settings.spec @@ -1,6 +1,6 @@ Name: lightdm-settings Version: 1.1.1 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Configuration tool for the LightDM display manager License: GPLv3+ @@ -48,14 +48,15 @@ f=".%{_bindir}/%{name}" %{__mv} -f ${f}.new ${f} # Use Python2 on EPEL <= 7. -%if (0%{?rhel} && 0%{?rhel} <= 7) -for f in .%{_bindir}/%{name} .%{_prefix}/lib/%{name}/%{name} ; do - %{__sed} -e 's~#!.*python3~#!/usr/bin/python2~g' \ - < ${f} > ${f}.new - /bin/touch -r ${f} ${f}.new - %{__mv} -f ${f}.new ${f} +%if (0%{?rhel} && 0%{?rhel} >= 7) +for f in $(%{__grep} -Rl '#!.*python3') ; do + %{__sed} -e 's~#!.*python3~#!/usr/bin/python2~g' < ${f} > ${f}.new + /bin/touch -r ${f}.new ${f} + mode="$(%{_bindir}/stat -c '%a' ${f})" + %{__mv} -f ${f}.new ${f} + %{__chmod} -c ${mode} ${f} done -%endif # (0%%{?rhel} && 0%%{?rhel} <= 7) +%endif # (0%%{?rhel} && 0%%{?rhel} >= 7) %build @@ -107,6 +108,9 @@ fi %changelog +* Thu Aug 31 2017 Björn Esser - 1.1.1-6 +- Preserve mode of files when changing hashbang + * Thu Aug 31 2017 Björn Esser - 1.1.1-5 - Fix hashbangs for EPEL