143 lines
5.0 KiB
Raw Normal View History

2022-05-28 16:49:56 +00:00
.TH prtwash 1 "May 28, 2022" "prtwash 1.2.1" ""
\fBprtwash \fP- a script to clean the port dirs in CRUX.
.fam C
\fBprtwash\fP [-p] [-b] [-d] [-s] [-t] [-q] [-a] <path> [<path> ...]
.fam T
\fBprtwash\fP is a perl script to clean the ports tree of a CRUX
distribution. You can clean a single directory, multiple directories,
or the entire ports tree. With the given options it is possible to
choose what kind of files the program should delete.
A test mode is provided.
\fBprtwash\fP was inspired by Martin Opel's prtsweep script.
By default prtwash will NOT delete the following items
in a port directory:
.IP \(bu 3
The Pkgfile
.IP \(bu 3
The sources (as stated in the Pkgfile)
.IP \(bu 3
The built package
.IP \(bu 3
The .signature, .footprint, .32bit and .nostrip files
.IP \(bu 3
Additional files: README, FAQ, pre-install, post-install
All items not included in the previous list WILL be deleted
(e.g.: the 'work' dir of pkgmk, if present).
You can choose to delete some of the above by passing the proper
also remove the built package (current version)
also remove other built packages (older versions)
also remove the add-on files provided by CRUX maintainers
(patches and initscripts downloaded with \fBports -u\fP)
also remove the upstream sources (those NOT obtained via \fBports -u\fP)
(test mode) display the target files without deleting
(quiet mode) suppress messages about files that are kept;
basically the same as \fBprtwash [OPTIONS] | grep -v "keeping"\fP
(automatic mode) take the port collections from the
/etc/prt-get.conf file and do a recursive cleaning;
if omitted, the command line must contain at least one <path> specifying
a valid port directory
Misc options
Display usage information
Display version
In automatic mode, \fBprtwash\fP gets a list of repositories from
/etc/prt-get.conf, and for each repository descends into the
individual port directories to read the associated Pkgfiles. In non-automatic
mode, \fBprtwash\fP only cleans the paths given on the command line. Directories
without a Pkgfile are skipped entirely, and a warning is given unless you
pass the option \fB\-q\fP. After reading the Pkgfile and /etc/pkgmk.conf,
\fBprtwash\fP will know the source filenames, the package filename, and the
distinction between sources under CRUX version control and sources downloaded
directly from upstream.
Sources under CRUX version control are only deleted if you pass the
option \fB\-d\fP. Sources from upstream are only deleted if you pass the
option \fB\-s\fP.
The current version of the package is only deleted if you pass the
option \fB\-p\fP. Older versions of the package are only deleted if you
pass the option \fB\-b\fP. Note that if the compression mode defined
in /etc/pkgmk.conf has been changed since you last built the package,
\fBprtwash\fP will not recognize the tarball in its regexp search.
Because \fBprtwash\fP reads the location of port collections from \fB/etc/prt-get.conf\fP(5),
you can easily control which collections are cleaned in automatic mode by commenting
or uncommenting the appropriate \fIprtdir\fP directives in that file. This detection
algorithm makes it easy to wash all your locally-curated repositories, in contrast
to the algorithm in \fBprtsweep\fP(1) which looks at the sup files used by \fBports\fP(8).
Another contrast between the two tools is that \fBprtwash\fP sources each Pkgfile to
generate its keep list, whereas \fBprtsweep\fP reads the signatures file. Spawning an
external bash shell for each port should in theory make \fBprtwash\fP slower
than \fBprtsweep\fP (which does everything in native perl), but on modern hardware the
difference is basically undetectable.
Neither \fBprtwash\fP nor \fBprtsweep\fP will ever touch anything outside your ports tree
or the directories passed on the command line. If you have centralized directories outside
the ports tree for all downloaded sources and built packages, you might find
\fBoldfiles\fP(1) more useful. Nevertheless, the pace of CRUX port updates is fast enough that
some cruft is bound to accumulate in the ports tree, and for this reason \fBprtwash\fP and
\fBprtsweep\fP still have their place in a CRUX admin's toolbox.
.B prtwash \-a \-t
does a default wash action on the entire port tree;
doesn't really delete the files
.B prtwash \-a \-p \-s
now we're getting serious: removes all downoaded files
and built packages from the entire port tree
.B prtwash \-a \-p \-s \-d
same as the above, but also removes patches, initscripts, etc
.B prtwash \-p \-s /usr/ports/contrib/sitecopy
removes all downoaded files
and built packages from the sitecopy directory
.B prtwash /usr/ports/contrib/*
does the default wash action on the entire contrib collection
Simone Rota <sip at varlock dot com>, John McQuah <jmcquah at disroot dot org>
\fBprtsweep\fP(1), \fBoldfiles\fP(1)