[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#855126: apt.systemd.daily: fails to delete old packages



Package: apt
Version: 1.4~rc1
Severity: normal
Tags: patch

Dear Maintainer,

My /var/cache/apt/archives grew to a size much larger then set in
APT::Periodic::MaxSize. When investigating the problem I disovered, a
problem with the delete code.

The old packages are sorted by mtime and then deleted iff ctime and mtime
are below the given MinAge. Otherwise the delete loop is aborted.
Due to this no files will be deleted if the oldest file (by mtime) has a
ctime smaller than MinAge.

This can be fixed by using continue instead of break.

--- apt.systemd.daily
+++ apt.systemd.daily
@@ -202,7 +202,7 @@
                fi
                if [ $delta -le $MinAge ]; then
                    debug_echo "skip remove by archive size:  $file, delta=$delta < $MinAge"
-                   break
+                   continue
                else
                    # delete oldest file
                    debug_echo "remove by archive size: $file, delta=$delta >= $MinAge (sec), size=$size >= $MaxSize"


best wishes
Nicola


Reply to: