rpms/pm-utils/F-7 pm-utils-0.99.4-logfile.patch, NONE, 1.1 pm-utils.spec, 1.66, 1.67 pm-utils-0.19-vidhooks.patch, 1.6, NONE

Till Maas (till) fedora-extras-commits at redhat.com
Wed Sep 19 23:26:21 UTC 2007


Author: till

Update of /cvs/pkgs/rpms/pm-utils/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv31586

Modified Files:
	pm-utils.spec 
Added Files:
	pm-utils-0.99.4-logfile.patch 
Removed Files:
	pm-utils-0.19-vidhooks.patch 
Log Message:
sync with devel


pm-utils-0.99.4-logfile.patch:

--- NEW FILE pm-utils-0.99.4-logfile.patch ---
There is no need to remove the logfile, because the ">" after exec in the next line
already truncates the logfile to zero length. Also removing is wrong, because it
destroys the selinux context of the logfile. Bugzilla Reports:
https://bugzilla.redhat.com/show_bug.cgi?id=237840
https://bugzilla.redhat.com/show_bug.cgi?id=238068

diff -up pm-utils-0.99.4/pm/functions.logfile pm-utils-0.99.4/pm/functions
diff -up pm-utils-0.99.4/pm/functions.logfile pm-utils-0.99.4/pm/functions
--- pm-utils-0.99.4/pm/functions.logfile	2007-05-15 16:55:58.000000000 +0200
+++ pm-utils-0.99.4/pm/functions	2007-09-20 00:53:51.000000000 +0200
@@ -137,7 +137,6 @@ do_suspend_hybrid()
 pm_main()
 {
 	if [ -n "$PM_LOGFILE" ]; then
-		[ -f "$PM_LOGFILE" ] && rm -f "$PM_LOGFILE"
 		exec > "$PM_LOGFILE" 2>&1
 	fi
 	take_suspend_lock || exit 1


Index: pm-utils.spec
===================================================================
RCS file: /cvs/pkgs/rpms/pm-utils/F-7/pm-utils.spec,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -r1.66 -r1.67
--- pm-utils.spec	11 Sep 2007 14:11:56 -0000	1.66
+++ pm-utils.spec	19 Sep 2007 23:25:48 -0000	1.67
@@ -2,7 +2,7 @@
 Summary: Power management utilities and scripts for Fedora
 License: GPLv2
 Version: 0.99.4
-Release: 2%{?dist}
+Release: 3%{?dist}
 Group: System Environment/Base
 URL: http://pm-utils.freedesktop.org
 ExclusiveArch: i386 x86_64 ia64 ppc ppc64 %{?arm}
@@ -29,8 +29,8 @@
 BuildRequires: dbus-devel >= 0.90
 
 Patch0: pm-utils-0.99.3-disable.patch
-#Patch1: pm-utils-0.19-vidhooks.patch
 Patch2: pm-utils-0.99.3-cfg.patch
+Patch3: pm-utils-0.99.4-logfile.patch
 
 
 %description
@@ -41,8 +41,8 @@
 %setup -q 
 
 %patch0 -p1 -b .disable
-#%patch1 -p1 -b .vidhooks
 %patch2 -p1 -b .cfg
+%patch3 -p1 -b .logfile
 
 
 %build
@@ -70,29 +70,33 @@
 	ln -sf consolehelper $x
 done
 popd
-install -d -m 755 $RPM_BUILD_ROOT/var/log
-install -m 600 /dev/null $RPM_BUILD_ROOT/var/log/pm-suspend.log
+install -D -m 0600 /dev/null $RPM_BUILD_ROOT%{_localstatedir}/log/pm-suspend.log
+
+
 
 %clean
 %{__rm} -rf $RPM_BUILD_ROOT
 
+
 %pre
-if [ -f /etc/sysconfig/pm ]; then
-	mkdir -p /etc/pm/config.d
-	mv /etc/sysconfig/pm /etc/pm/config.d/01oldconfig
+if [ -f %{_sysconfdir}/sysconfig/pm ]; then
+	mkdir -p %{_sysconfdir}/pm/config.d
+	mv %{_sysconfdir}/sysconfig/pm %{_sysconfdir}/pm/config.d/01oldconfig
 fi
 
+
 %post
-if [ -f /etc/pm/config.rpmsave ]; then
-	mkdir -p /etc/pm/config.d
-	mv /etc/pm/config.rpmsave /etc/pm/config.d/02oldconfig
+if [ -f %{_sysconfdir}/pm/config.rpmsave ]; then
+	mv %{_sysconfdir}/pm/config.rpmsave %{_sysconfdir}/pm/config.d/02oldconfig
 fi
-if [ ! -a /var/log/pm-suspend.log ] ; then
-	install -m 600 /dev/null /var/log/pm-suspend.log
+if [ -f %{_localstatedir}/log/pm-suspend.log ] ; then
+	chmod 0600 %{_localstatedir}/log/pm-suspend.log
+	[ -x /sbin/restorecon ] && restorecon  %{_localstatedir}/log/pm-suspend.log > /dev/null 2>&1
 fi
 
+
 %files
-%defattr(-,root,root)
+%defattr(-,root,root,-)
 %{_sysconfdir}/pm/
 %{_sysconfdir}/security/console.apps/*
 %{_sysconfdir}/pam.d/*
@@ -109,9 +113,17 @@
 %{_sbindir}/pm-suspend-hybrid
 
 %{_mandir}/man*/*
-%ghost %verify(not md5 size mtime) /var/log/pm-suspend.log
+%ghost %verify(not md5 size mtime) %{_localstatedir}/log/pm-suspend.log
 
 %changelog
+* Thu Sep 20 2007 Till Maas <opensource till name> - 0.99.4-3
+- remove unused patch (vidhooks)
+- add patch to keep logfile (RH #237840 (f7), #238068 (devel)), 
+  to keep selinux context
+- simplify spec
+- restore selinux context of logfile in %%post 
+- use rpmmacros more often
+
 * Tue Sep 11 2007 Till Maas <opensource till name> - 0.99.4-2
 - Require vbetool not on ppc and ppc64
 


--- pm-utils-0.19-vidhooks.patch DELETED ---




More information about the scm-commits mailing list