check if the file exists before changing permission. need a better approach
Stephen Soltesz [Mon, 21 Sep 2009 17:59:01 +0000 (17:59 +0000)]
for these steps.

plcrt.spec

index c2fb0ff..ad1556a 100644 (file)
@@ -52,7 +52,11 @@ install -D -m 755 getpersons.py $RPM_BUILD_ROOT/%{_datadir}/%{name}/getpersons.p
 install -D -m 755 adduserstort.pl $RPM_BUILD_ROOT/%{_datadir}/%{name}/adduserstort.pl
 
 echo " * Installing cron scripts"
-chmod 755 $RPM_BUILD_ROOT/%{_datadir}/%{name}/cron.d/*.sh
+for file in $RPM_BUILD_ROOT/%{_datadir}/%{name}/cron.d/*.py $RPM_BUILD_ROOT/%{_datadir}/%{name}/cron.d/*.sh ; do 
+       if [ -f $file ] ; then
+        chmod 755 $file
+       fi
+done
 
 %clean
 rm -rf $RPM_BUILD_ROOT