Subject: pkg/25451: patch for suggested improvements to lintpkgsrc
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <adrianp@stindustries.net>
List: pkgsrc-bugs
Date: 05/03/2004 23:32:22
>Number: 25451
>Category: pkg
>Synopsis: patch for suggested improvements to lintpkgsrc
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: pkg-manager
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Mon May 03 23:33:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator: Adrian Portelli
>Release: 1.6.2/i386
>Organization:
STIndustries
>Environment:
NetBSD apu.stindustries.org.uk 1.6.2 NetBSD 1.6.2 (APU) #0: Mon Apr 5 14:06:41 BST 2004 root@apu.stindustries.org.uk:/usr/src-1.6.1/sys/arch/i386/compile/APU i386
>Description:
'lintpkgsrc -or' will currently walk through distfiles and remove any
tarballs that are not the latest version. I thought it would be nice to expand this functionality a bit so that it could also remove any tarballs that are not installed.
Eg. You download a package to have a play with it but then decide to
remove it. This will leave the source tarball still in your local
distfile folder. Over time this could leave quite a few tarballs in
distfiles chewing up disk space (depending on how much you play with
pkgsrc :)).
So I've put together a patch to tell lintpkgsrc to remove any tarballs
from distfiles that are not part of a currently installed package.
In addition to this I've also added some functionality suggested by hubertf@ which is basically the inverse of the above i.e. removing all distfiles that belong to installed packages.
The patch is against the latest version of lintpkgsrc (v1.88). The patch is fairly complete but may need a bit of fudging with the 'r' option as I could not get it to play 100% nice when I used it.
>How-To-Repeat:
Well, it's not really a problem, this is just a suggestion for an enhancement.
>Fix:
begin 644 lintpkgsrc.diff
M+2TM(&QI;G1P:V=S<F,N;W)I9PE-;VX@36%Y("`S(#$P.C$Q.C`Y(#(P,#0*
M*RLK(&QI;G1P:V=S<F,)36]N($UA>2`@,R`Q-CHT-SHU-2`R,#`T"D!`("TS
M,2PQ,R`K,S$L,3,@0$`*(`H@)$5.5GM0051(?2`N/2`G.B]U<W(O<V)I;B<[
M"B`*+6EF("@A(&=E=&]P=',H)T)$13I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