Преглед на файлове

debian: Switch alternative database backups from xz to gzip

Switch the alternatives database backups from xz to gzip, as the latter
is Essential and we can rely on it being always present, using xz here
is not worth the trouble, disk space savings, or possible additional
dependencies.

Closes: #746354
Guillem Jover преди 12 години
родител
ревизия
6f2a7a736c
променени са 2 файла, в които са добавени 14 реда и са изтрити 1 реда
  1. 1 0
      debian/changelog
  2. 13 1
      debian/dpkg.cron.daily

+ 1 - 0
debian/changelog

@@ -3,6 +3,7 @@ dpkg (1.17.9) UNRELEASED; urgency=low
   [ Guillem Jover ]
   * Do not allow patch files with C-style encoded filenames. Closes: #746306
     Unconditionally fixes CVE-2014-0471.
+  * Switch alternative database backups from xz to gzip. Closes: #746354
 
   [ Updated scripts translations ]
   * French (Steve Petruzzello). Closes: #746350

+ 13 - 1
debian/dpkg.cron.daily

@@ -24,10 +24,22 @@ if cd /var/backups ; then
 
     # The alternatives database is independent from the dpkg database.
     dbalt=alternatives
+
+    # Switch the alternatives database backups from xz to gzip, as the latter
+    # is Essential and we can rely on it being always present, using xz here
+    # is not worth the trouble, disk space savings, or possible additional
+    # dependencies.
+    for dbseq in `seq 1 6` ; do
+        dbfile=${dbalt}.tar.${dbseq}
+        [ -e "${dbfile}.xz" ] || continue
+        unxz ${dbfile}.xz
+        gzip -9 $dbfile
+    done
+
     if ! test -e ${dbalt}.tar.0 ||
        ! tar -df ${dbalt}.tar.0 --warning=none -C $dbdir $dbalt >/dev/null ;
     then
         tar -cf ${dbalt}.tar --warning=none -C $dbdir $dbalt
-        savelog -c 7 -J ${dbalt}.tar >/dev/null
+        savelog -c 7 ${dbalt}.tar >/dev/null
     fi
 fi