Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 164544 - app-admin/localepurge-0.5.3.3 reports wrong total disk space freed
Summary: app-admin/localepurge-0.5.3.3 reports wrong total disk space freed
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High minor with 1 vote (vote)
Assignee: Wim Muskee
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2007-01-30 14:03 UTC by davide.angelocola
Modified: 2012-12-04 22:36 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch to improve calculation of freed space (localepurge-0.5.3.3-improvespacecalc.patch,3.82 KB, patch)
2012-12-01 21:14 UTC, Wim Muskee
Details | Diff
Err, forgot to add the sum for each directory. (localepurge-0.5.4-too-little-freed-space.patch,799 bytes, patch)
2012-12-04 22:20 UTC, Wim Muskee
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description davide.angelocola 2007-01-30 14:03:01 UTC
Sometime localepurge reports wrong total disk space freed:

>  * Running localepurge...
>  * localepurge: processing locale files in /usr/share/locale ...
>  * localepurge: processing locale files in /usr/kde/3.5/share/locale ...
>  * localepurge: processing locale files in /usr/lib/locale ...
>  * localepurge: processing man pages in /usr/share/man ...
>  * localepurge: Disk space freed in /usr/share/man: 128K
>  * localepurge: processing man pages in /usr/local/share/man ...
>  * localepurge: processing man pages in /opt/sun-jdk-1.5.0.10/man ...
>  * localepurge: processing man pages in /opt/sun-jdk-1.6.0/man ...
> 
>  * Total disk space freed by localepurge: 8K
Comment 1 José Alberto Suárez López (RETIRED) gentoo-dev 2007-04-01 18:29:11 UTC
sorry for all this time, my workstation is not working well lately.
I will try to find the bug :)
Comment 2 Pacho Ramos gentoo-dev 2012-03-18 19:29:04 UTC
Is this a regression over 0.5.2?
Comment 3 Pacho Ramos gentoo-dev 2012-03-21 11:59:20 UTC
A patch for this is needed (or maybe reverting the changes related with this to behave like old 0.5.2.2 version)
Comment 4 Wim Muskee 2012-11-28 20:25:27 UTC
The differences in the report are very minute (128K vs 8K). Perhaps something else changed on the filesystem while running the script.

I think either LOCALETOTAL or MANTOTAL could evaluate to a negative number and subtract rather than add when adding both for the TOTAL.

To minimize the risk of this happening, a TOTAL calculation would only have to occur right before and after something has been deleted.
Comment 5 Wim Muskee 2012-12-01 21:14:26 UTC
Created attachment 331156 [details, diff]
patch to improve calculation of freed space

With this patch, the freed space is only calculated when a dir is actually removed. This minimizes the risk of something altering the diskspace during the process.

Also, a freed space amount gets only added to the total when it's higher than zero. Before, this check was only applied to the freed space message output.
Comment 6 Markos Chandras (RETIRED) gentoo-dev 2012-12-02 01:05:51 UTC
(In reply to comment #5)
> Created attachment 331156 [details, diff] [details, diff]
> patch to improve calculation of freed space
> 
> With this patch, the freed space is only calculated when a dir is actually
> removed. This minimizes the risk of something altering the diskspace during
> the process.
> 
> Also, a freed space amount gets only added to the total when it's higher
> than zero. Before, this check was only applied to the freed space message
> output.

Hi. Thanks for the patch. I wonder where this script is maintained nowadays so we can include this patch on the tarball.
Comment 7 Nikoli 2012-12-04 09:56:16 UTC
app-admin/localepurge-0.5.4 does not work fine:
 * localepurge: processing locale files in /usr/share/locale ...
удалён «/usr/share/locale/ast/LC_MESSAGES/poedit.mo»
удалён «/usr/share/locale/be@latin/LC_MESSAGES/poedit.mo»
удалён «/usr/share/locale/ca@valencia/LC_MESSAGES/audacity.mo»
удалён «/usr/share/locale/ca@valencia/LC_MESSAGES/poedit.mo»
удалён «/usr/share/locale/fur/LC_MESSAGES/poedit.mo»
удалён «/usr/share/locale/km/LC_MESSAGES/audacity.mo»
удалён «/usr/share/locale/my/LC_MESSAGES/audacity.mo»
удалён «/usr/share/locale/sr_RS/LC_MESSAGES/audacity.mo»
 * localepurge: Disk space freed in /usr/share/locale: 813K
 * localepurge: processing locale files in /usr/lib/locale ...
 * localepurge: processing locale files in /usr/share/binutils-data/x86_64-pc-linux-gnu/2.22/locale ...
 * localepurge: processing locale files in /usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.4/locale ...
удалён «/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.4/locale/de/LC_MESSAGES/libstdc++.mo»
удалён «/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.4/locale/fr/LC_MESSAGES/libstdc++.mo»
 * localepurge: Disk space freed in /usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.4/locale: 2K
 * localepurge: processing man pages in /usr/share/man ...

 * Total disk space freed by localepurge: 2K
Comment 8 Markos Chandras (RETIRED) gentoo-dev 2012-12-04 11:37:33 UTC
(In reply to comment #7)
> app-admin/localepurge-0.5.4 does not work fine:
>  * localepurge: processing locale files in /usr/share/locale ...
> удалён «/usr/share/locale/ast/LC_MESSAGES/poedit.mo»
> удалён «/usr/share/locale/be@latin/LC_MESSAGES/poedit.mo»
> удалён «/usr/share/locale/ca@valencia/LC_MESSAGES/audacity.mo»
> удалён «/usr/share/locale/ca@valencia/LC_MESSAGES/poedit.mo»
> удалён «/usr/share/locale/fur/LC_MESSAGES/poedit.mo»
> удалён «/usr/share/locale/km/LC_MESSAGES/audacity.mo»
> удалён «/usr/share/locale/my/LC_MESSAGES/audacity.mo»
> удалён «/usr/share/locale/sr_RS/LC_MESSAGES/audacity.mo»
>  * localepurge: Disk space freed in /usr/share/locale: 813K
>  * localepurge: processing locale files in /usr/lib/locale ...
>  * localepurge: processing locale files in
> /usr/share/binutils-data/x86_64-pc-linux-gnu/2.22/locale ...
>  * localepurge: processing locale files in
> /usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.4/locale ...
> удалён
> «/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.4/locale/de/LC_MESSAGES/
> libstdc++.mo»
> удалён
> «/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.4/locale/fr/LC_MESSAGES/
> libstdc++.mo»
>  * localepurge: Disk space freed in
> /usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.4/locale: 2K
>  * localepurge: processing man pages in /usr/share/man ...
> 
>  * Total disk space freed by localepurge: 2K

I think this is a separate bug and should be discussed in 445910
Comment 9 Wim Muskee 2012-12-04 22:20:58 UTC
Created attachment 331456 [details, diff]
Err, forgot to add the sum for each directory.

This patch applies to 0.5.4, whereas the previous patch was for 0.5.3.3-r1.
Comment 10 Markos Chandras (RETIRED) gentoo-dev 2012-12-04 22:36:56 UTC
+*localepurge-0.5.4-r1 (04 Dec 2012)
+
+  04 Dec 2012; Markos Chandras <hwoarang@gentoo.org>
+  +files/localepurge-0.5.4-directorysum.patch,
+  +files/localepurge-0.5.4-parentdir.patch, +localepurge-0.5.4-r1.ebuild,
+  -localepurge-0.5.4.ebuild:
+  Revbump. Fixes bug #164544 and #445910
+