Public bug reported:

Binary package hint: apt

cron apt script assumes that CacheArchive directory is inside CacheDir. 
However, apt allows configuration when CacheArchive is outside CacheDir (for 
example, I use it because of space shortage in /var).
Some changes to /etc/cron.daily/apt like this would be useful...

--- /etc/cron.daily/apt 2010-04-17 11:42:26.000000000 +0400
+++ tmp/apt     2010-04-17 11:45:38.000000000 +0400
@@ -181,7 +181,11 @@
        exit
     fi
     
-    Cache="${Dir%/}/${CacheDir%/}/${CacheArchive%/}/"
+    if [ "x$CacheArchive" != "x${CacheArchive#/}" ]; then
+       Cache="${CacheArchive%/}/";
+    else
+       Cache="${Dir%/}/${CacheDir%/}/${CacheArchive%/}/";
+    fi
 
     # check age
     if [ ! $MaxAge -eq 0 ] && [ ! $MinAge -eq 0 ]; then
@@ -279,7 +283,13 @@
        return
     fi
 
-    Cache="${Dir}/${CacheDir}/${CacheArchive}/"
+    
+    if [ "x$CacheArchive" != "x${CacheArchive#/}" ]; then
+       Cache="${CacheArchive%/}/";
+    else
+       Cache="${Dir%/}/${CacheDir%/}/${CacheArchive%/}/";
+    fi
+
     Back="${Dir}/${CacheDir}/${CacheBackup}/"
     BackX="${Back}${CacheArchive}/"
     for x in $(seq 0 1 $((${BackupLevel}-1))); do

** Affects: apt (Ubuntu)
     Importance: Undecided
         Status: New

-- 
/etc/cron.daily/apt assumes that CacheArchive inside CacheDir
https://bugs.launchpad.net/bugs/565229
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to