summaryrefslogtreecommitdiff
path: root/prtsweep.1
blob: 2272d2ba63b39bac542c80501847d6db8ede059d (plain)
    1 .\" 
    2 .\" prtsweep manual page.
    3 .\" (C) 2e003 by Martin Opel
    4 .\" Revised 2021 by John McQuah
    5 .\"
    6 .TH prtsweep 1
    7 .SH NAME
    8 prtsweep \- sweep old files from the ports directories
    9 .SH SYNOPSIS
   10 .PP
   11 .B prtsweep
   12 [\-a] [\-d] [\-n] [PORTDIR ...]
   13 .SH DESCRIPTION
   14 
   15 The \fIprtsweep\fP program sweeps port directories, deleting unneeded files.
   16 "Unneeded" here means not found in the Pkgfile source array, and not the
   17 built package
   18 .PP
   19 .nf
   20 	name#version-release.pkg.tar.gz
   21 .fi
   22 .PP
   23 All other files are removed. If a port directory is empty, the whole directory
   24 can be removed with the \fI\-d\fP option.
   25 
   26 .SH OPTIONS
   27 The following options are supported:
   28 .TP
   29 .I "\-a"
   30 This is the automatic mode. In this mode \fIprtsweep\fP reads the ports
   31 directories from the rsync and httpup files in /etc/ports and cleans all ports 
   32 in these directories.
   33 .TP
   34 .I "\-d"
   35 Removes empty directories completely. This happens when ports are moved for
   36 example from opt to contrib or vice versa. Note that this option only
   37 deletes empty directories, so accidently removing whole directory trees
   38 should not happen, even if you use
   39 .IP
   40 .nf
   41 	prtsweep \-d /
   42 .fi
   43 .IP
   44 To remove these moved ports completely you have to run \fIprtsweep\fP twice
   45 to first remove the files and second remove the empty directory.
   46 .TP
   47 .I "\-p"
   48 Also removes the built package.
   49 .TP
   50 .I "\-n"
   51 Dry-run. Do not remove anything really.
   52 .TP
   53 .I "\-q"
   54 Quiet mode. Do not pause to inform the user when analysis of the config file
   55 indicates that clutter from building ports might still remain elsewhere
   56 in the filesystem.
   57 .SH ENVIRONMENT
   58 In automatic mode, \fBprtsweep\fP reads from /etc/pkgmk.conf 
   59 any custom settings for PKGMK_SOURCE_DIR and PKGMK_PACKAGE_DIR
   60 to determine where the clutter from a pkgmk build is likely to
   61 appear. If the directories potentially cluttered by pkgmk builds
   62 are shared among many ports, e.g., by setting a nonempty
   63 PKGMK_SOURCE_DIR with no reference to the port name, then
   64 \fBprtsweep\fP will pause and inform the user that a follow-up
   65 cleaning using other tools might be needed. This warning can be suppressed
   66 by passing the \fB\-q\fP option.
   67 .PP
   68 \fBprtsweep\fP then gets a list of active port collections
   69 from /etc/ports/*.{rsync,httpup}, and for each collection descends into the
   70 individual port directories to read the associated Pkgfiles.
   71 After reading the Pkgfile, \fBprtsweep\fP will know the source filenames and
   72 the package filename. \fBprtsweep\fP then compares the contents of the port
   73 directory with this list of needed files, and any non-matching filename is
   74 deleted (or just printed to stderr if dry-run mode is enabled).
   75 .PP
   76 After a real cleaning by \fBprtsweep\fP (not dry-run mode), each port
   77 directory should contain only the Pkgfile, source files obtained
   78 by rsync or httpup, and the built package (if present, and option -p was
   79 not given on the command line).
   80 
   81 .SH EXAMPLES
   82 
   83 You can call \fIprtsweep\fP with one port:
   84 .PP
   85 .nf
   86 	root@hostname:/root # prtsweep /usr/ports/opt/dialog
   87 	=======> /usr/ports/opt/dialog
   88 	+ removing file dialog-0.9b-20020814.tgz
   89 .fi
   90 .PP
   91 Or you could call the automatic mode, which scans your supfiles in /etc/ports
   92 for all ports directories and cleans them automatically:
   93 .PP
   94 .nf
   95 	root@hostname:/root # prtsweep -a
   96 	=======> /usr/ports/clc/stable/atop
   97 	+ removing file atop-1.8.tar.gz
   98 	=======> /usr/ports/clc/stable/coldsync
   99 	+ removing file coldsync-2.2.5-gcc3.diff
  100 	+ removing file coldsync-2.2.5.tar.gz
  101 	=======> /usr/ports/clc/stable/dnsmasq
  102 	+ removing file dnsmasq-1.10.tar.gz
  103 	...
  104 .fi
  105 
  106 .SH AUTHORS
  107 Martin Opel <mo at obbl-net dot de>, John McQuah <jmcquah at disroot dot org>
  108 .SH "SEE ALSO"
  109 prtwash(1)

Generated by cgit