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

Re: Deleting uncompressed Info/Doc files at upgrades

Ben Armstrong wrote:

> A simple script be written to grep the output of 'dpkg -L packagename' for
> .gz files in man or doc directories, and test for the existence of
> ungzipped versions.  If it finds files ungzipped, it could gzip them back
> up.  This script could be run before upgrading a package. 
> If such a script were written, Peter could use it to manually fix up
> his "corrupted" ;) docs before upgrading.  If it works well, perhaps
> it could later be hooked into dpkg so that it is automatically run
> prior to upgrading a package.

Thanks Ben, that's a nice idea.

My suggestions was aimed towards the new users (rather than for myself) so
the script itself is of limited general use.  But I'm use if _I_ had such a
script I'd feel better about uncompressing more files and leaving them

The following _lists_ uncompressed files.  It would be trivial to add
re-compression.  I found some surprises running it! Uncompressed man pages
from a time I installed XFree from tar balls... So I wasn't reading
up-to-date man pages after all...

while (</var/lib/dpkg/info/*.list>) {
    open (FILE, "<$_");
    while (<FILE>) {
        if ((/(.+)\.gz$/) && (-e $1)) { 
            print "$1\n" }
    close FILE;

Peter Galbraith, research scientist          <GalbraithP@dfo-mpo.gc.ca>
Maurice Lamontagne Institute, Department of Fisheries and Oceans Canada
P.O. Box 1000, Mont-Joli Qc, G5H 3Z4 Canada. 418-775-0852 FAX: 775-0546
    6623'rd GNU/Linux user at the Counter - http://counter.li.org/ 

Reply to: