#783112 MaxAge files are not removed by order of size

Package:
apt
Source:
apt
Description:
commandline package manager
Submitter:
Jens Rantil
Date:
2015-04-22 11:36:16 UTC
Severity:
normal
#783112#5
Date:
2015-04-22 11:35:05 UTC
From:
To:
Background: The top of /etc/cron.daily/apt states

#  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).

Problem: Reading the code further down it looks like cleanup loop for
MaxSize is removing oldest-first, not biggest first:

       # reverse-sort by mtime
        for file in $(ls -rt $Cache/*.deb 2>/dev/null); do

So, it looks like the documentation is incorrect on this matter.

Let me know if I've misunderstood something.

Cheers,
Jens