rpms/yum-cron/devel yum-cron-0.3.checkonly.patch, NONE, 1.1 yum-cron.spec, 1.3, 1.4

Alec Thomas Habig (habig) fedora-extras-commits at redhat.com
Tue Aug 28 15:20:26 UTC 2007


Author: habig

Update of /cvs/pkgs/rpms/yum-cron/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4968/devel

Modified Files:
	yum-cron.spec 
Added Files:
	yum-cron-0.3.checkonly.patch 
Log Message:
Added Frank Wittig's patch to set check-only via an entry in the new
file /etc/sysconfig/yum-cron



yum-cron-0.3.checkonly.patch:

--- NEW FILE yum-cron-0.3.checkonly.patch ---
diff -Naur yum-cron-0.3/yum.cron.daily yum-cron-0.3_wwk/yum.cron.daily
--- yum-cron-0.3/yum.cron.daily	2007-06-19 17:34:58.000000000 +0200
+++ yum-cron-0.3_wwk/yum.cron.daily	2007-08-27 10:59:34.000000000 +0200
@@ -1,6 +1,20 @@
 #!/bin/sh
 
-if [ -f /var/lock/subsys/yum-cron ]; then
+if [ -f /var/lock/subsys/yum ]; then
+
+  if [ -f /etc/sysconfig/yum-cron ]; then
+    source /etc/sysconfig/yum-cron
+  fi
+
 	/usr/bin/yum -R 120 -e 0 -d 0 -y update yum
-	/usr/bin/yum -R 10 -e 0 -d 0 -y shell /etc/yum/yum-daily.yum
+
+  if [[ "x$CHECK_ONLY" == "xyes" ]]; then
+    if (! /usr/bin/yum -R 10 -e 0 -d 0 -y check-update >/dev/null); then
+      echo "New updates available for host `/bin/hostname`";
+      echo "`/usr/bin/yum -e 0 -d 0 -y -C check-update`^M"
+    fi
+  else
+    /usr/bin/yum -R 10 -e 0 -d 0 -y shell /etc/yum/yum-daily.yum
+  fi
+
 fi
diff -Naur yum-cron-0.3/yum-cron.sysconf yum-cron-0.3_wwk/yum-cron.sysconf
--- yum-cron-0.3/yum-cron.sysconf	1970-01-01 01:00:00.000000000 +0100
+++ yum-cron-0.3_wwk/yum-cron.sysconf	2007-08-27 11:46:51.000000000 +0200
@@ -0,0 +1,2 @@
+# Don't install, just check (valid: yes|no)
+CHECK_ONLY=no


Index: yum-cron.spec
===================================================================
RCS file: /cvs/pkgs/rpms/yum-cron/devel/yum-cron.spec,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- yum-cron.spec	21 Aug 2007 19:56:40 -0000	1.3
+++ yum-cron.spec	28 Aug 2007 15:19:53 -0000	1.4
@@ -1,7 +1,7 @@
 Summary: Files needed to run yum updates as a cron job
 Name: yum-cron
 Version: 0.3
-Release: 2%{?dist}
+Release: 3%{?dist}
 URL: http://linux.duke.edu/yum/
 # This is a Red Hat maintained package which is specific to
 # our distribution.  Thus the source is only available from
@@ -17,6 +17,7 @@
 Requires(preun): /sbin/service
 Requires(postun): /sbin/service
 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
+Patch0: yum-cron-0.3.checkonly.patch
 
 %description
 These are the files needed to run yum updates as a cron job.  They are
@@ -26,6 +27,7 @@
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 
@@ -35,6 +37,7 @@
 install -D -m 755 yum.cron.weekly $RPM_BUILD_ROOT/%{_sysconfdir}/cron.weekly/yum.cron
 install -D -m 755 yum-cron $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d/yum-cron
 install -D -m 644 yum-daily.yum $RPM_BUILD_ROOT/%{_sysconfdir}/yum/yum-daily.yum
+install -D -m 644 yum-cron.sysconf $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/yum-cron
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -87,8 +90,13 @@
 %{_sysconfdir}/cron.weekly/yum.cron
 %config(noreplace) %{_sysconfdir}/yum/yum-daily.yum
 %{_sysconfdir}/rc.d/init.d/yum-cron
+%config(noreplace) %{_sysconfdir}/sysconfig/yum-cron
 
 %changelog
+* Mon Aug 27 2007 Frank Wittig <fw at weisshuhn.de> - 0.3-3
+- Actual update action is now configurable. It does check-only now if
+  configured. Default behaviour is to do updates.
+
 * Tue Aug 21 2007 Alec Habig <ahabig at umn.edu> - 0.3-2
 - Changed over to dist tags, to play more nciely with the Fedora build system
 - License changed "GPL" to "GPLv2" since rpmlint now cares




More information about the fedora-extras-commits mailing list