summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorRaphaël Hertzog <hertzog@debian.org>2009-08-14 21:41:44 +0200
committerRaphaël Hertzog <hertzog@debian.org>2009-08-14 21:41:44 +0200
commit6c785595d189f65a59284796a9b1f60f16686e85 (patch)
tree813534b6344964eb54f179484b43b86ae7c886c3 /debian
parentd31094b551ec0e7eea5e389f6791ff835eab6760 (diff)
downloaddpkg-6c785595d189f65a59284796a9b1f60f16686e85.tar.gz
Add a dpkg cron.daily script to backup the status file
Create /etc/cron.daily/dpkg to handle the backup of /var/lib/dpkg/status in /var/backups. This is taken out of the cron package and need no conflicts/breaks as the code does nothing if the current status file is already backupped. Moving it out of the cron package makes it more visible for users inspecting the content of the dpkg package. Based-on-patch-by: Leo 'costela' Antunes <costela@debian.org>
Diffstat (limited to 'debian')
-rw-r--r--debian/changelog5
-rw-r--r--debian/dpkg.cron.daily10
-rwxr-xr-xdebian/rules3
3 files changed, 17 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index a3e10c80e..a735e5032 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -52,6 +52,11 @@ dpkg (1.15.4) UNRELEASED; urgency=low
Millan for the patch. Closes: #537559
* Update sample in dpkg-gensymbols(1) to give an accurate listing of
64 bit arches. Thanks to Julien Cristau for the patch. Closes: #540382
+ * Create /etc/cron.daily/dpkg to handle the backup of
+ /var/lib/dpkg/status in /var/backups. This is taken out of the cron
+ package and need no conflicts/breaks as the code does nothing if
+ the current status file is already backupped. Thanks to Leo 'costela'
+ Antunes <costela@debian.org> for the patch. Closes: #541412
[ Modestas Vainius ]
* Provide a meaningful label for dpkg-gensymbols diff.
diff --git a/debian/dpkg.cron.daily b/debian/dpkg.cron.daily
new file mode 100644
index 000000000..99f4f6be2
--- /dev/null
+++ b/debian/dpkg.cron.daily
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# Backup the 7 last versions of dpkg's status file
+if cd /var/backups ; then
+ if ! cmp -s dpkg.status.0 /var/lib/dpkg/status ; then
+ cp -p /var/lib/dpkg/status dpkg.status
+ savelog -c 7 dpkg.status >/dev/null
+ fi
+fi
+
diff --git a/debian/rules b/debian/rules
index 05c08ca58..b302e9346 100755
--- a/debian/rules
+++ b/debian/rules
@@ -84,6 +84,7 @@ binary-arch: install
dh_testdir -a
dh_testroot -a
dh_install --sourcedir=debian/tmp -a
+ dh_installcron -a
dh_installlogrotate -a
install -d debian/dpkg/sbin
@@ -107,7 +108,7 @@ binary-indep: install
dh_testdir -i
dh_testroot -i
dh_install --sourcedir=debian/tmp -i -XDpkg/Gettext.pm
-
+ dh_installcron -i
dh_installchangelogs -i ChangeLog*
dh_installdocs -i
dh_link -i