]> git.saurik.com Git - apt.git/commitdiff
Add APT::Periodic::Autoclean setting
authorMatt Zimmerman <matt.zimmerman@canonical.com>
Tue, 23 Nov 2004 20:52:13 +0000 (20:52 +0000)
committerMatt Zimmerman <matt.zimmerman@canonical.com>
Tue, 23 Nov 2004 20:52:13 +0000 (20:52 +0000)
  * Add APT::Periodic::Autoclean setting, to allow "apt-get autoclean" to
    be run periodically.  This is useful with
    APT::Periodic::Download-Upgradeable-Packages, and defaults to the same
    value, so that the cache size is bounded

debian/apt.cron.daily
debian/changelog

index bb6c0151e71413ab7ddfae1c983781db45e9a9ff..17fe8fb78658c8b3b71036ed7044396d3d1f3268 100644 (file)
@@ -38,8 +38,9 @@ update_stamp()
 
 UpdateInterval=0
 DownloadUpgradeableInterval=0
-RES=`apt-config shell UpdateInterval APT::Periodic::Update-Package-Lists DownloadUpgradeableInterval APT::Periodic::Download-Upgradeable-Packages`
-eval $RES
+eval $(apt-config shell UpdateInterval APT::Periodic::Update-Package-Lists DownloadUpgradeableInterval APT::Periodic::Download-Upgradeable-Packages)
+AutocleanInterval=$DownloadUpgradeableInterval
+eval $(apt-config shell AutocleanInterval APT::Periodic::Autoclean)
 
 # laptop check, on_ac_power returns:
 #       0 (true)    System is on mains power
@@ -68,3 +69,9 @@ if check_stamp $DOWNLOAD_UPGRADEABLE_STAMP $DownloadUpgradeableInterval; then
     apt-get -qq -d dist-upgrade 2>/dev/null
     update_stamp $DOWNLOAD_UPGRADEABLE_STAMP
 fi
+
+AUTOCLEAN_STAMP=/var/lib/apt/periodic/autoclean-stamp
+if check_stamp $AUTOCLEAN_STAMP $AutocleanInterval; then
+    apt-get -qq autoclean
+    update_stamp $AUTOCLEAN_STAMP
+fi
index 7a287ecb7a594638c757ec1712efa6074612c453..17bd395de199d664af072904dbfbe01ff18c6e45 100644 (file)
@@ -5,6 +5,10 @@ apt (0.5.31) unstable; urgency=low
   * Merge changes from Hoary (0.5.30,0.5.30ubuntu2]
   * Fix the example in apt_preferences(5) to match the text
     (Closes: #222267)
+  * Add APT::Periodic::Autoclean setting, to allow "apt-get autoclean" to
+    be run periodically.  This is useful with
+    APT::Periodic::Download-Upgradeable-Packages, and defaults to the same
+    value, so that the cache size is bounded
 
  --