Просмотр исходного кода

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
Родитель
Сommit
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 ]
   [ Guillem Jover ]
   * Do not allow patch files with C-style encoded filenames. Closes: #746306
   * Do not allow patch files with C-style encoded filenames. Closes: #746306
     Unconditionally fixes CVE-2014-0471.
     Unconditionally fixes CVE-2014-0471.
+  * Switch alternative database backups from xz to gzip. Closes: #746354
 
 
   [ Updated scripts translations ]
   [ Updated scripts translations ]
   * French (Steve Petruzzello). Closes: #746350
   * 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.
     # The alternatives database is independent from the dpkg database.
     dbalt=alternatives
     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 ||
     if ! test -e ${dbalt}.tar.0 ||
        ! tar -df ${dbalt}.tar.0 --warning=none -C $dbdir $dbalt >/dev/null ;
        ! tar -df ${dbalt}.tar.0 --warning=none -C $dbdir $dbalt >/dev/null ;
     then
     then
         tar -cf ${dbalt}.tar --warning=none -C $dbdir $dbalt
         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
 fi
 fi