- add apt-cron from FE package to contrib
authorpmatilai <pmatilai>
Tue, 9 May 2006 14:15:18 +0000 (14:15 +0000)
committerpmatilai <pmatilai>
Tue, 9 May 2006 14:15:18 +0000 (14:15 +0000)
Makefile.am
Makefile.in
contrib/apt-cron/apt.cron [new file with mode: 0644]
contrib/apt-cron/apt.init [new file with mode: 0644]
contrib/apt-cron/apt.sysconfig [new file with mode: 0644]

index cfa4573..60870df 100644 (file)
@@ -80,5 +80,9 @@ EXTRA_DIST += contrib/list-nodeps/list-nodeps.conf
 EXTRA_DIST += contrib/list-nodeps/list-nodeps.lua
 EXTRA_DIST += contrib/list-nodeps/README
 
+EXTRA_DIST += contrib/apt-cron/apt.cron
+EXTRA_DIST += contrib/apt-cron/apt.init
+EXTRA_DIST += contrib/apt-cron/apt.sysconfig
+
 EXTRA_DIST += buildlib/archtable
 EXTRA_DIST += buildlib/ostable
index 42e7df8..6d610ea 100644 (file)
@@ -256,7 +256,9 @@ EXTRA_DIST = AUTHORS.RPM COPYING.GPL rpmpriorities test/conf.cc \
        contrib/guess/README contrib/guess/guess.conf \
        contrib/guess/guess.lua contrib/list-nodeps/list-nodeps.conf \
        contrib/list-nodeps/list-nodeps.lua contrib/list-nodeps/README \
-       buildlib/archtable buildlib/ostable
+       contrib/apt-cron/apt.cron contrib/apt-cron/apt.init \
+       contrib/apt-cron/apt.sysconfig buildlib/archtable \
+       buildlib/ostable
 all: all-recursive
 
 .SUFFIXES:
@@ -456,7 +458,7 @@ distclean-tags:
 distdir: $(DISTFILES)
        $(am__remove_distdir)
        mkdir $(distdir)
-       $(mkdir_p) $(distdir)/buildlib $(distdir)/contrib/allow-duplicated $(distdir)/contrib/apt-files $(distdir)/contrib/apt-groupinstall $(distdir)/contrib/apt-wrapper $(distdir)/contrib/gpg-check $(distdir)/contrib/guess $(distdir)/contrib/install-devel $(distdir)/contrib/list-extras $(distdir)/contrib/list-nodeps $(distdir)/contrib/log $(distdir)/contrib/preserve-conf $(distdir)/contrib/proxypasswd $(distdir)/m4 $(distdir)/po $(distdir)/python $(distdir)/test
+       $(mkdir_p) $(distdir)/buildlib $(distdir)/contrib/allow-duplicated $(distdir)/contrib/apt-cron $(distdir)/contrib/apt-files $(distdir)/contrib/apt-groupinstall $(distdir)/contrib/apt-wrapper $(distdir)/contrib/gpg-check $(distdir)/contrib/guess $(distdir)/contrib/install-devel $(distdir)/contrib/list-extras $(distdir)/contrib/list-nodeps $(distdir)/contrib/log $(distdir)/contrib/preserve-conf $(distdir)/contrib/proxypasswd $(distdir)/m4 $(distdir)/po $(distdir)/python $(distdir)/test
        @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
        list='$(DISTFILES)'; for file in $$list; do \
diff --git a/contrib/apt-cron/apt.cron b/contrib/apt-cron/apt.cron
new file mode 100644 (file)
index 0000000..b55dab4
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+[ ! -f /var/lock/subsys/apt ] && exit 0
+
+[ -f /etc/sysconfig/apt ] && . /etc/sysconfig/apt
+
+[ $CHECK_ONLY == "yes" ] && OPTS="$OPTS --check-only"
+OPTS="$OPTS $EXTRA_OPTIONS"
+
+/usr/bin/apt-get -q update && /usr/bin/apt-get -q -y $OPTS dist-upgrade
diff --git a/contrib/apt-cron/apt.init b/contrib/apt-cron/apt.init
new file mode 100644 (file)
index 0000000..288b4ab
--- /dev/null
@@ -0,0 +1,70 @@
+#!/bin/bash
+#
+# apt           This shell script enables the automatic updates by APT
+#
+# Author:       Seth Vidal <skvidal@phy.duke.edu>
+# Modified for APT by Panu Matilainen <pmatilai@welho.com>
+#
+# chkconfig:   - 50 01
+#
+# description:  Enable daily run of apt, a program updater.
+# processname:  apt-get
+# config: /etc/apt/
+#
+
+# source function library
+. /etc/rc.d/init.d/functions
+
+lockfile=/var/lock/subsys/apt
+
+RETVAL=0
+
+start() {
+       echo -n $"Enabling nightly apt update: "
+       touch "$lockfile" && success || failure
+       RETVAL=$?
+       echo
+}
+
+stop() {
+       echo -n $"Disabling nightly apt update: "
+       rm -f "$lockfile" && success || failure
+       RETVAL=$?
+       echo
+}
+
+restart() {
+       stop
+       start
+}
+
+case "$1" in
+  start)
+       start
+       ;;
+  stop) 
+       stop
+       ;;
+  restart|force-reload)
+       restart
+       ;;
+  reload)
+       ;;
+  condrestart)
+       [ -f "$lockfile" ] && restart
+       ;;
+  status)
+       if [ -f $lockfile ]; then
+               echo $"Nightly apt update is enabled."
+               RETVAL=0
+       else
+               echo $"Nightly apt update is disabled."
+               RETVAL=3
+       fi
+       ;;
+  *)
+       echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}"
+       exit 1
+esac
+
+exit $RETVAL
diff --git a/contrib/apt-cron/apt.sysconfig b/contrib/apt-cron/apt.sysconfig
new file mode 100644 (file)
index 0000000..be1e912
--- /dev/null
@@ -0,0 +1,5 @@
+# Actually perform updates or only check what's available [yes|no]
+CHECK_ONLY=no
+
+# Any extra parameters you want to pass to dist-upgrade
+EXTRA_OPTIONS=