|
|
@@ -4,17 +4,58 @@
|
|
|
#set -e
|
|
|
#
|
|
|
# This file understands the following apt configuration variables:
|
|
|
+# Values here are the default.
|
|
|
+# Create /etc/apt/apt.conf.d/02periodic file to set your preference.
|
|
|
#
|
|
|
-# "APT::Periodic::Update-Package-Lists=1"
|
|
|
+# Dir "/";
|
|
|
+# - RootDir for all configuration files
|
|
|
+#
|
|
|
+# Dir::Cache "var/apt/cache/";
|
|
|
+# - Set apt package cache directory
|
|
|
+#
|
|
|
+# Dir::Cache::Archive "archives/";
|
|
|
+# - Set package archive directory
|
|
|
+#
|
|
|
+# APT::Periodic::Enable "1";
|
|
|
+# - Enable the update/upgrade script (0=disable)
|
|
|
+#
|
|
|
+# APT::Periodic::BackupArchiveInterval "0";
|
|
|
+# - Backup after n-days if archive contents changed.(0=disable)
|
|
|
+#
|
|
|
+# APT::Periodic::BackupLevel "3";
|
|
|
+# - Backup level.(0=disable), 1 is invalid.
|
|
|
+#
|
|
|
+# Dir::Cache::Backup "backup/";
|
|
|
+# - Set periodic package backup directory
|
|
|
+#
|
|
|
+# APT::Archives::MaxAge "0"; (old, deprecated)
|
|
|
+# APT::Periodic::MaxAge "0"; (new)
|
|
|
+# - Set maximum allowed age of a cache package file. If a cache
|
|
|
+# package file is older it is deleted (0=disable)
|
|
|
+#
|
|
|
+# APT::Archives::MinAge "2"; (old, deprecated)
|
|
|
+# APT::Periodic::MinAge "2"; (new)
|
|
|
+# - Set minimum age of a package file. If a file is younger it
|
|
|
+# will not be deleted (0=disable). Usefull to prevent races
|
|
|
+# and to keep backups of the packages for emergency.
|
|
|
+#
|
|
|
+# APT::Archives::MaxSize "0"; (old, deprecated)
|
|
|
+# APT::Periodic::MaxSize "0"; (new)
|
|
|
+# - Set maximum size of the cache in MB (0=disable). If the cache
|
|
|
+# is bigger, cached package files are deleted until the size
|
|
|
+# requirement is met (the biggest packages will be deleted
|
|
|
+# first).
|
|
|
+#
|
|
|
+# APT::Periodic::Update-Package-Lists "0";
|
|
|
# - Do "apt-get update" automatically every n-days (0=disable)
|
|
|
#
|
|
|
# "APT::Periodic::Download-Upgradeable-Packages=0",
|
|
|
# - Do "apt-get upgrade --download-only" every n-days (0=disable)
|
|
|
-#
|
|
|
-# "APT::Periodic::AutocleanInterval"
|
|
|
-# - Do "apt-get autoclean" every n-days (0=disable)
|
|
|
#
|
|
|
-# "APT::Periodic::Unattended-Upgrade"
|
|
|
+# APT::Periodic::Download-Upgradeable-Packages-Debdelta "1";
|
|
|
+# - Use debdelta-upgrade to download updates if available (0=disable)
|
|
|
+#
|
|
|
+# APT::Periodic::Unattended-Upgrade "0";
|
|
|
# - Run the "unattended-upgrade" security upgrade script
|
|
|
# every n-days (0=disabled)
|
|
|
# Requires the package "unattended-upgrades" and will write
|
|
|
@@ -301,12 +342,18 @@ if ! which apt-config >/dev/null ; then
|
|
|
exit 0
|
|
|
fi
|
|
|
|
|
|
+# check if the user really wants to do something
|
|
|
+AutoAptEnable=1 # default is yes
|
|
|
+eval $(apt-config shell AutoAptEnable APT::Periodic::Enable)
|
|
|
+
|
|
|
+if [ $AutoAptEnable -eq 0 ]; then
|
|
|
+ exit 0
|
|
|
+fi
|
|
|
+
|
|
|
# Set VERBOSE mode from apt-config (or inherit from environment)
|
|
|
+VERBOSE=0
|
|
|
eval $(apt-config shell VERBOSE APT::Periodic::Verbose)
|
|
|
debug_echo "verbose level $VERBOSE"
|
|
|
-if [ -z "$VERBOSE" ]; then
|
|
|
- VERBOSE="0"
|
|
|
-fi
|
|
|
if [ "$VERBOSE" -le 2 ]; then
|
|
|
# quiet for 0,1,2
|
|
|
XSTDOUT=">/dev/null"
|
|
|
@@ -367,6 +414,9 @@ eval $(apt-config shell AutocleanInterval APT::Periodic::AutocleanInterval)
|
|
|
BackupArchiveInterval=0
|
|
|
eval $(apt-config shell BackupArchiveInterval APT::Periodic::BackupArchiveInterval)
|
|
|
|
|
|
+Debdelta=1
|
|
|
+eval $(apt-config shell Debdelta APT::Periodic::Download-Upgradeable-Packages-Debdelta)
|
|
|
+
|
|
|
# check if we actually have to do anything
|
|
|
if [ $UpdateInterval -eq 0 ] &&
|
|
|
[ $DownloadUpgradeableInterval -eq 0 ] &&
|
|
|
@@ -432,6 +482,9 @@ fi
|
|
|
# download all upgradeable packages (if it is requested)
|
|
|
DOWNLOAD_UPGRADEABLE_STAMP=/var/lib/apt/periodic/download-upgradeable-stamp
|
|
|
if [ $UPDATED -eq 1 ] && check_stamp $DOWNLOAD_UPGRADEABLE_STAMP $DownloadUpgradeableInterval; then
|
|
|
+ if [ $Debdelta -eq 1 ]; then
|
|
|
+ debdelta-upgrade >/dev/null 2>&1 || true
|
|
|
+ fi
|
|
|
if eval apt-get $XAPTOPT -y -d dist-upgrade $XSTDERR; then
|
|
|
update_stamp $DOWNLOAD_UPGRADEABLE_STAMP
|
|
|
debug_echo "download upgradable (success)"
|