distfiles cleaner

Julian H. Stacey jhs at berklix.com
Mon Oct 19 22:57:54 UTC 2015

Hi, Reference:
> From:		RW via freebsd-ports <freebsd-ports at freebsd.org>
> Date:		Mon, 19 Oct 2015 14:56:11 +0100

RW via freebsd-ports wrote:
> On Mon, 19 Oct 2015 14:16:37 +0200
> Julian H. Stacey wrote:
> > Hi ports@
> > What is the modern equivalent of this obsolete stuff please ?
> > 
> > http://www.freebsd.org/cgi/man.cgi?query=portsclean&sektion=1&apropos=0&manpath=FreeBSD+9.0-RELEASE+and+Ports
> > 	portsclean --distclean
> > 	Clean out all the distfiles that are not referenced by any
> > 	port in the ports tree.
> > 
> > https://wiki.freebsd.org/portupgrade
> > 	Portupgrade (aka pkgtools)
> > 	last edited 2012-08-01
> Why are you looking at the wiki?

I didnt know what tool to look for so a search engine took me to the wiki.

> The code was updated only a few months
> ago?

Err ? moved from wiki to which ports/ ?
Wiki has "It is currently maintained by BryanDrewery <bdrewery at FreeBSD.org>"
So I added to CC. If the wiki is obsolete I suggest it be deleted
or reduced to point to URL with new code.

>  https://svnweb.freebsd.org/ports/head/ports-mgmt/portupgrade/


[with current]
cd /usr/ports/ports-mgmt/portupgrade ; make install ; man portupgrade
	"To clean unreferenced distfiles, working directories and old shared
         libraries, use portsclean(1)"
which portsclean				# /usr/local/sbin/portsclean
pkg which /usr/local/sbin/portsclean		# portupgrade-2.4.14,2
pkg info portupgrade-2.4.14,2 | grep Origin 	# ports-mgmt/portupgrade

> I think the case for portupgrade and portsclean is now much stronger
> than it was before they were fully converted to pkg. That removed all
> the problems associated with maintaining a secondary database. The
> conversion to pkg replaced portmaster's best code and portupgrade's
> worst.

I'm lost. I presume portupgrade had some bad code,
replaced by good code from portmaster.

> BTW I recently switched from distviper to portsclean. I used to prefer
> distviper because of its speed, but that speed comes from assuming that
> all distinfo files are called distinfo, which isn't true. I found
> it was unconditionally removing the files for linux ports. 

Yes, confirmed below, distviper removed a great swathe of

> It's also
> never been converted to pkg which breaks its fast mode.  

Cloning my 58G current distfiles to test each method I found:

			distviper 				# 4.185918

			portmaster -t -y --clean-distfiles	# 4.231094

			portsclean --distclean 			# 4.078680

portsclean removed 50 files that portmaster did not, so I guess portmaster
may be best/ most conservative. A sample of 1 deletion by portsclean:
from devel/subversion18 (not something Ive just built or fetched BTW)

I ran find on all 3 stripped distfiles/ +
diff current.portsclean current.portmaster > cleanmaster.diff
wc -l *
	100 cleanmaster.diff
	751 current.distviper
	837 current.portmaster
	783 current.portsclean
All here for next few days in case of interest:

Thanks Lars, Kubilay, RW.

Julian Stacey,  BSD Linux Unix Sys. Eng. Consultant Munich http://berklix.com
 Reply After previous text to preserve context, as in a play script.
 Indent previous text with > 		Insert new lines before 80 chars.
 Use plain text, Not quoted-printable, Not HTML, Not base64, Not MS.doc.

More information about the freebsd-ports mailing list