Control: reassign -1 localepurge
Hi, 2012-09-30 18:55 Mark Caglienzi:
Package: aptitude Version: 0.6.8.1-2 Severity: normal Dear Maintainer, I have localepurge installed, and when I do something like: # aptitude install $package and the package name is misspelled,
If the package is misspelled, in recent versions of aptitude, it aborts quickly so localepurge is not run.
or if the package is already installed and not upgradable (i.e. the installed version is the same as the repository version), aptitude calls localepurge, which seems like a waste of time. For example, assuming that python-sqlite is already installed: # aptitude install python-sqlite No packages will be installed, upgraded, or removed. 0 packages upgraded, 0 newly installed, 0 to remove and 1 not upgraded. Need to get 0 B of archives. After unpacking 0 B will be used. localepurge: Disk space freed in /usr/share/locale: 0 KiB localepurge: Disk space freed in /usr/share/man: 0 KiB localepurge: Disk space freed in /usr/share/gnome/help: 0 KiB localepurge: Disk space freed in /usr/share/omf: 0 KiB localepurge: Disk space freed in /usr/share/doc/kde/HTML: 0 KiB Total disk space freed by localepurge: 0 KiB
Sometimes aptitude invokes the whole chain of processes even if no actual installation will happen. The reasons are not straightforward and not to discuss here, and yes, this can be a small waste of time, but I think that it's a harmless / negligible issue (see later for more on this). So from the aptitude side of things, I don't think that we should do anything regarding this issue.
I'm not 100% sure that it's a bug in aptitude instead of localepurge, please excuse me if I'm pointing in the wrong direction. If I use apt-get instead of aptitude, the behaviour is different: no localepurge invocation.
I can see other potential problems with the script "/etc/apt/apt.conf.d/99-localepurge", though. It contains: ################## // Get rid of unneeded locale files after each package installation DPkg { Post-Invoke {"if [ -x /usr/sbin/localepurge ] && [ $(ps w -p $PPID | egrep -c '(remove|purge)') != 1 ]; then /usr/sbin/localepurge; else exit 0; fi";}; }; ################## However, I think that this assumes that it will be invoked with apt (I suppose, since it's the most important tool of the ecosystem), and it will avoid running when the command line contains "remove" or "purge". For aptitude, and perhaps other tools of the ecosystem, this is not very accurate. For example, aptitude can install new packages with: aptitude purge libabc1+ and can perform a remove operation with: aptitude install libabc1- That is, the "purge" or "install" is mostly a "default action" for packages that are not explicitly qualified with their own actions. Even with the folloging, if there is nothing to ugprade and there are scheduled actions that only remove or purge files, it will not "install" anything: aptitude install aptitude upgrade aptitude full-upgrade ... I think that this is mostly a theoretical problem. Since many packages don't have any locale files to purge whatsoever, many of the invocations of localepurge are a waste of time, in a way. And I don't think that the cases where it misses to run are a real problem either. Even if localepurge doesn't get to act in a given occasion, it will act in the next runs -- it will eventually set things right, all by itself. So finally, I am reassigning this report to localepurge, to see if the maintainer wants to say something about this (e.g. propose changes in aptitude, if needed) or change things on their side, in localepurge. Cheers. -- Manuel A. Fernandez Montecelo <manuel.montez...@gmail.com>