prt-get/doc/prt-get.8
John McQuah ffe29e224e update man-page with fresh examples
drop from INSTALL the outdated autotools instructions
2023-09-03 16:11:29 -04:00

821 lines
29 KiB
Groff

.\" man page for prt-get
.\" original work by Johannes Winkelmann, jw at tks6 dot net
.\"
.\" extended in 2013 by Alan Mizrahi, alan at mizrahi dot com dot ve
.\" and in 2023 by John McQuah, jmcquah at disroot dot org
.\"
.\" .PU
.TH "prt-get" "8" "" "" ""
.SH "NAME"
.LP
prt\-get \- an advanced package management tool to be used with
pkgutils from CRUX (see http://www.crux.nu)
.SH "SYNOPSIS"
.B prt\-get command [options] <arguments>
.br
.SH "DESCRIPTION"
prt\-get is a package management tool which provides additional
functionality to the CRUX package management system. It works with the
local ports tree and is therefore fully compatible with ports(8) and
pkgmk(8)/pkgadd(8)/pkgrm(8). It offers the following features:
.PP
.TP
\ \ \ \(bu
abstract ports installation/update from file system
.TP
\ \ \ \(bu
install/update a list of packages with one command
.TP
\ \ \ \(bu
list dependencies for a list of packages
.TP
\ \ \ \(bu
show information about ports
.TP
\ \ \ \(bu
search within the ports
.PP
What prt\-get basically does is build, install/upgrade, and remove packages, using
pkgmk, pkgadd, and pkgrm. Additionally, you don't have be in the port's
directory to call prt\-get. prt\-get will search for the respective port
itself in a list of directories specified in /etc/prt\-get.conf. This
allows you to just install or update a package, without caring where
it actually is located on your file system.
.PP
prt\-get also lets you search for ports by name,
find information about ports (without installing them of course),
or print the dependencies of a port (as a space- or newline-separated list,
or a formatted tree). Note that dependencies are no
requirement for crux packages and therefore not always accurate.
.PP
prt\-get has a test mode so you can see what effect an install/update
operation would have. Use the \-\-test switch for this (more details in
the \fBOPTIONS\fP section below).
.SH "RETURN VALUE"
prt\-get returns 0 on success and a non-zero value otherwise (exact
value -> meaning mapping to be determined...)
.SH "COMMANDS"
prt\-get uses so\-called commands, which always have to be the first
non-option argument passed. This is very similar to
.B cvs(1).
[command] can be one of the following:
.TP
.B install [\-\-margs] [\-\-aargs] [\-\-log] <package1> [<package2> ...]
Install all packages in the listed order. Note that you can do this
from any directory.
.TP
.B depinst [\-\-margs] [\-\-aargs] [\-\-log] [\-\-softdeps] <package1> [<package2> ...]
Install all packages given on the command line, including their dependencies.
Note that already-installed packages will be left at their current version,
even if out of date. prt\-get depinst behaves this way because all of its
child pkgadd processes will \fBlack\fP the \-u flag, which is needed when
updating an already-installed package.
Passing the --softdeps flag tells \fBprt-get\fP to consider also the optional
dependencies when sorting. The --softdeps flag does NOT affect the
calculation of the minimal set of packages needed to satisfy the
transaction; only hard dependencies are used when constructing this set. But
if there are any optional dependency relationships among the ports in the
resulting set, they will be respected when prt-get determines the sequence
in which to build.
.TP
.B update [\-\-margs] [\-\-aargs] [\-\-log] <package1> [<package2> ...]
Update all packages listed in this order. Note: if the latest version of a
package has acquired dependencies that were not needed by the
currently-installed version and are not present on the system, the update
command will not attempt to resolve this omission. prt-get update behaves
this way because pkgadd invocations inherit the flag -u for every package in
the transaction, causing an error if the package is not already installed.
You can follow the CRUX mailing list or the IRC channels to stay informed of
the situations where an update will require manual intervention, or filter
the output of
.B prt\-get quickdep $(prt\-get quickdiff)
through \fBprt\-get isinst\fP to get a list of packages suitable for an
\fBinstall\fP or \fBupdate\fP command.
See the \fBEXAMPLES\fP section below for details.
.TP
.B remove <package1> [<package2> ...]
Remove packages listed in this order
.TP
.B sysup [\-\-softdeps] [\-\-nodeps]
Update all installed packages which are outdated. Sorts by hard dependencies
by default. Passing the --softdeps switch tells \fBprt\-get\fP to also consider
optional dependencies when sorting. Passing the --nodeps switch tells prt-get
not to sort by dependencies at all, for approximately the same effect as
.B prt\-get update $(prt\-get quickdiff).
As with an \fBupdate\fP command, the child \fBpkgadd\fP processes will
inherit the \-u flag, so if a port has acquired new dependencies since
its last successful build, those new dependencies will be omitted from
the transaction (unless they happen to be installed for some other reason and
are also in need of an update). See the \fBEXAMPLES\fP section for a way to
automate the resolution of such omissions. Also see the
.B lock
and
.B unlock
commands to keep the currently installed versions, even if there are
changes in the ports tree. If you want to update only diffs which have
a lower version installed than the one in the ports tree, use the
--prefer-higher option.
.TP
.B lock <package1> [<package2>...]
Do not update these packages in a
.B sysup
operation
.TP
.B unlock <package1> [<package2>...]
Remove lock from these packages
.TP
.B listlocked [-v|-vv]
List names of packages which are locked. As always,
.B -v
will additionally show the version, and
.B -vv
also includes the description from the Pkgfile. Note that the
.B -vv
switch will slow down the operation remarkably.
.TP
.B diff [\-\-all] [\-\-prefer\-higher] [<package1> <package2> ...]
Show differences between installed packages and ports in the ports
tree. If arguments are given, shows only differences for these
packages, otherwise all differences are shown. It's also possible to use
shell-like
.B wildcards
for the diff command. Make sure you escape where needed. Locked
packages are only displayed if you use the --all switch. If you want
to see only diffs which have a lower version installed than the one in
the ports tree, use the --prefer-higher option.
.TP
.B quickdiff
Print a simple list of packages which have a different version in the
ports tree than what is installed. The output is sorted alphabetically,
but you can generate a (larger) list sorted by dependencies using
.B prt\-get quickdep $(prt\-get quickdiff).
Note that the resulting list is usually a mix of installed and
not-installed packages, so it must be filtered by
.B prt\-get isinst
before being passed as argument to prt\-get install or prt\-get update. See the
.B EXAMPLES
section below.
If you want to see only diffs which have a lower version installed than the one in
the ports tree, use the --prefer-higher option.
.TP
.B search [\-v|\-vv] [\-\-path] [\-\-regex] <expr>
Search the ports tree for
.B expr
in their name
.TP
.B dsearch [\-v|\-vv] [\-\-path] [\-\-regex] <expr>
Search the ports tree (both name and description) for the pattern
.B expr
(which can be a shell-like wildcard pattern or a regexp). The search in
the description is not case sensitive. Note that this requires prt\-get
to read every Pkgfile, which makes it rather slow. If you like searching by
description, consider using the cache functionality, so you only have to
read all the Pkgfiles after each update of the ports tree.
.TP
.B fsearch [\-\-full] [\-\-regex] <pattern>
Search the ports tree for
.B pattern
as file name in their footprint. When called without '--full', strips
the directories from the file names before matching.
Pattern can be a shell-like wildcard pattern (e.g. prt-get fsearch "*.h")
or a regular expression (e.g. prt-get fsearch --regex 'liblz(o2|ma).*')
.TP
.B info <port>
Print available info for a port
.TP
.B path <port>
Print the path of a port
.TP
.B readme <port>
Print the port's README file if it exists; if set, uses $PAGER
.TP
.B depends [\-\-softdeps] <package1> [<package2> ...]
Print a recursive list of dependencies needed to install the packages
passed as argument. It shows a list of the dependencies that were found in
the ports tree, plus a list of the dependencies that could not be found.
Pass the --softdeps flag if you want the sorting algorithm to consider
optional dependencies too.
.TP
.B quickdep [\-\-softdeps] <package1> [<package2> ...]
Same output as \fBdepends\fP, but separated by spaces rather than newlines,
and stripped of any dependencies that could not be found in the ports tree.
Useful in case the list of dependencies is too large to fit on one screen,
or if you don't want to filter out manually the ports that are invalid
targets for installation. For example, instead of
.B prt\-get depinst xorg-server
you might micromanage the process as follows:
.B for i in $(prt\-get quickdep xorg-server); do if prt\-get isinst $i 2>/dev/null; then prt\-get update \-fr $i; else prt\-get install $i; fi; done
which ensures that the latest version of each dependency is built.
Note: It might be useful to run
.B prt\-get depends <package1> | grep \(dq\-\- missing packages\(dq
as a first step, in order to ensure that your ports tree has everything needed
for successful builds.
.TP
.B deptree [\-\-softdeps] <package>
Print a tree of the dependencies of the package
.B <package>.
Pass the --softdeps flag to also show the installed packages that might
have been eagerly linked, if they were present when
.B <package>
(or its dependencies) were built.
Subtrees already shown are marked with '-->' to save some space. In
order to show them all, add the --all switch.
.SH ""
.TP
.B dependent [\-\-recursive] [\-\-softdeps] [\-\-all] [\-\-tree] <package>
Print a list of ports whose "Depends on:" line contains
.B <package>
(or its dependents, if --recursive was passed). Use the --softdeps flag to
also search the "Optional:" lines for \fB<package>\fP.
By default, output is restricted to ports that are installed. To see all
the dependencies, use the --all switch. Use --tree to get a nicely indented
list.
.TP
.B dup [-v] [format]
List ports which can be found in multiple directories configured in
.B /etc/prt-get.conf
Use the \fB\-v\fP switch to see a verbose report, which will show for each
dup the port that takes precedence, and the port that is hidden (including
full path and version info). The verbose switch is basically an alias for a
particular combination of the recognized format symbols, namely
.B '* %n\en %p1 %v1 precedes over\en %p2 %v2\en'.
You can customize the output by passing a different format string, whose
symbols will be replaced as follows.
.TP
\ \ \ \(bu
%n -> name of the port
.TP
\ \ \ \(bu
%p1 -> Full path (including name) to port taking precedence
.TP
\ \ \ \(bu
%p2 -> Full path (including name) to port being hidden
.TP
\ \ \ \(bu
%v1 -> Version of port taking precedence
.TP
\ \ \ \(bu
%v2 -> Version of port being hidden
.TP
\ \ \ \(bu
%M1 -> maintainer of port taking precedence
.TP
\ \ \ \(bu
%M2 -> maintainer of port being hidden
.TP
\ \ \ \(bu
%u1 -> URL of port taking precedence
.TP
\ \ \ \(bu
%u2 -> URL of port being hidden
.TP
.B list [\-v|\-vv] [\-\-path] [\-\-regex] [filter]
List ports available in the ports tree. It's basically the same as
.B ports \-l
but looks in all directories specified in
.B /etc/prt\-get.conf.
It's also possible to use shell-like
.B wildcards
for the list command. Make sure you escape where needed
.TP
.B printf <format string1> [\-\-sort=<format string2>] [\-\-filter=<filter>]
Print formatted port list format string can contain variables, which
are replaced like this:
.TP
\ \ \ \(bu
%n -> name
.TP
\ \ \ \(bu
%p -> path
.TP
\ \ \ \(bu
%v -> version
.TP
\ \ \ \(bu
%r -> release
.TP
\ \ \ \(bu
%d -> description
.TP
\ \ \ \(bu
%e -> dependencies
.TP
\ \ \ \(bu
%P -> optional dependencies
.TP
\ \ \ \(bu
%u -> URL
.TP
\ \ \ \(bu
%M -> Maintainer
.TP
\ \ \ \(bu
%R -> Readme ("yes"/"no")
.TP
\ \ \ \(bu
%E -> pre-install script ("yes"/"no")
.TP
\ \ \ \(bu
%O -> post-install script ("yes"/"no")
.TP
\ \ \ \(bu
%l -> is locked ("yes"/"no")
.TP
\ \ \ \(bu
%i -> "no" if not installed, "yes" if it's installed and
up to date and "diff" if it's installed and a new version is in the
ports tree.
Use "\\n" and "\\t" to format your output (no additional format symbols
suported). The optional format string2 can contain the same variables
as format string1 and is used to sort the output. You can specify a
.B wildcard filter
to filter by package name.
.TP
.B listinst [\-v|\-vv] [\-\-regex] [\-\-depsort] [filter]
List installed ports. It's basically the same as
.B pkginfo \-i,
but omits version when called without verbose (-v, -vv) switch. Plus
it is notably faster in my tests. -v adds version information, -vv
adds version and description.
.B Warning:
-vv will slow down the process because it requires prt-get to scan
both the ports database and the ports tree.
It's also possible to use shell-like
.B wildcards
for the listinst command. Make sure you escape where needed. By default
it's sorted alphabetically; use the --depsort switch to sort by
dependencies.
.TP
.B listorphans [\-v|\-vv|\-\-softdeps]
List installed ports which do not appear in the "Depends on:" line of
any other port currently installed. Pass the --softdeps flag to also exclude
ports that are listed as optional dependencies of currently-installed ports.
Output appears alphabetically separated by newlines, making it suitable for
process substitution as shown in the
.B EXAMPLES
section below. Note that some core ports might be runtime
dependencies despite their absence in the "Depends on:" line; see \fBPkgfile(5)\fP
for an explanation of this practice.
.TP
.B isinst <package1> [<package2> ...]
Check whether each package given on the command line is installed. Output in
the case of multiple arguments is separated by newlines, suitable for
processing by awk or grep. Similar to
.B pkginfo \-i|grep \-E '^(package1|package2|...)'
but does not print the version information. This command has a return value of
0 if all packages given as argument are installed, otherwise a return value
greater than 0.
.TP
.B current <package>
Show the currently-installed version of <package>, or a message
that <package> is not installed. Unlike
.B prt\-get isinst package1 package2,
this command does \fBnot\fP accept more than one package as argument. Use
.B pkginfo \-i| grep \-E '^(package1|package2|...)'
to work around this limitation.
.TP
.B ls [\-\-path] <package>
List the contents of the port's directory
.TP
.B cat <package> [<file>]
Print the file to stdout. If <file> is not specified, 'Pkgfile' is used. If set, uses $PAGER.
.TP
.B edit <package> [<file>]
Edit the file using the editor specified in the $EDITOR environment variable.
If <file> is not specified, 'Pkgfile' is used.
.TP
.B help
Show a help screen
.TP
.B dumpconfig
Dump the configuration to the current terminal
.TP
.B version
Show the current version of prt-get
.TP
.B cache
Create a cache file from the ports tree to be used by prt-get using the
--cache option. Remember to run prt-get cache each time you update the
ports tree.
.SH "OPTIONS"
The following options are primarily useful for install/update transactions.
.TP
.B \-g, \-\-group
Stop install or update operation if one package fails (patch by Alan Mizrahi)
.TP
.B \-f, \-fi
Force install; Implies 'pkgadd -f'; same as --aargs=-f
.TP
.B \-fr
Force rebuild, Implies 'pkgmk -f'; same as --margs=-f
.TP
.B \-um
Update md5sum, implies 'pkgmk -um'; same as --margs=-um
.TP
.B \-im
Ignore md5sum, implies 'pkgmk -im'; same as --margs=-im
.TP
.B \-us
Update signature, implies 'pkgmk -us'; same as --margs=-us
.TP
.B \-is
Ignore signature, implies 'pkgmk -is'; same as --margs=-is
.TP
.B \-uf
Update footprint, implies 'pkgmk -uf'; same as --margs=-uf
.TP
.B \-if
Ignore footprint, implies 'pkgmk -if'; same as --margs=-if
.TP
.B \-ns
No stripping, implies 'pkgmk -ns'; same as --margs=-ns
.TP
.B \-kw
Keep working directory, implies 'pkgmk -kw'; same as --margs=-kw
.TP
.B \-\-margs="...", e.g. \-\-margs="\-im"
additional arguments to be passed to pkgmk;
note that \-d is already passed to pkgmk anyway
.TP
.B \-\-aargs="...", e.g. \-\-aargs="\-f"
additional arguments to be passed to pkgadd
.TP
.B \-\-rargs="..."
arguments to be passed to pkgrm; currently not used, implemented for
future uses and consistency reasons
.TP
.B \-\-ignore=<package1,package2,...>
Don't install these packages, even if they're listed as dependencies
.TP
.B \-\-softdeps
Consider optional dependencies when determining the order in which to build
the packages passed as arguments (in a \fBdepinst\fP or \fBsysup\fP operation).
Also affects the output of \fBdeptree\fP, \fBdependent\fP, and \fBlistorphans\fP.
.TP
.B \-\-cache
Use cache file for this command
.TP
.B \-\-test
Dry run, don't actually install anything, mostly interesting for
.B prt\-get install, prt\-get update, prt\-get sysup
.TP
.B \-\-pre-install
Execute pre-install script if it's there
.TP
.B \-\-post-install
Execute post-install script if it's there
.TP
.B \-\-install-scripts
Execute pre-install and post-install script if they're there
The options --pre-install, --post-install, and --install-scripts offer a
convenient way to temporarily override the prt-get.conf directive 'runscripts
no', which was the historical default. Starting with CRUX 3.7, prt-get.conf is
being shipped with 'runscripts yes'. To override this default at the command
line, you have to pass the more cumbersome option --config-set=\(dqrunscripts
no\(dq, or point prt-get to an alternative configuration file using
--config=<file>. (see below for the documentation of these options)
.TP
.B \-\-install-root=<dir>
Use <dir> as root directory for your installation; allows you to install
the requested packages onto a different directory than '/'. In daily usage,
this option is not required; it's primarily interesting if you're developing
an independent installation.
Pre- and post-install scripts will not be executed if the target root directory
lacks a copy of the ports tree. So if you're maintaining an installation on a
volume mounted somewhere other than '/', it's not enough to have the
line 'runscripts yes' in your prt-get.conf; you also have to ensure that
the pre- and post-install scripts can be found in the same location
relative to <dir>.
The setting for --install-root determines which package database is used for
reading/writing (so <dir>/var/lib/pkg/db must exist), and where the pkg.tar.?z
archives get unpacked, but the relevant prt-get.conf and ports tree are those
on the parent filesystem. Therefore it is not necessary for <dir> to contain
its own copy of the ports tree (unless 'runscripts yes' is desired, as
explained above). But each \fBpkgmk(8)\fP process will take place on the parent
filesystem, inspecting \fIthe parent filesystem\fP's environment for
information about installed ports and available shared libraries. The
\fBpkgmk(8)\fP process might therefore draw the wrong conclusions about what
functionality should be enabled for an installation to <dir>. If the parent
filesystem is more richly populated than <dir>, with respect to installed
packages, then the built package might exhibit breakage when \fBpkgadd\fP
unpacks it into <dir>.
When setting --install-root=<dir>, install or update commands might behave
unexpectedly if <dir>/etc/pkgadd.conf exists and is different from
/etc/pkgadd.conf . In order to preserve the \fBpkgadd.conf(5)\fP settings from
the host system, append the option --aargs='-c /etc/pkgadd.conf' to your
\fBprt-get install\fP command, or just copy the desired directives into
<dir>/etc/pkgadd.conf .
.TP
.B \-\-log
Write build output to log file. Basically a convenient alias for
\fB\-\-config\-set=\(dqwritelog enabled\(dq\fP. Note that there is no similar
alias allowing you to temporarily override the one configuration directive
\(dqwritelog enabled\(dq; you have to resort to \fB\-\-config\-set=\(dqwritelog
disabled\(dq\fP if that is your intention.
.TP
.B \-\-no-std-config
Don't parse the default configuration file
.TP
.B \-\-config-prepend=<string>
Prepend <string> to configuration
.TP
.B \-\-config-append=<string>
Append <string> to configuration
.TP
.B \-\-config-set=<string>
Set <string> in configuration, overriding configuration file
.TP
.B \-\-config=<file>
Use <file> to read configuration directives, rather than /etc/prt-get.conf.
.SH ""
The following options are primarily useful for non-install (information-seeking)
transactions, although some of them affect the behaviour of install/upgrade
transactions as well.
.TP
.B \-v, \-vv
(verbosity level) Show version of a port (\-v), or show both version
and description (\-vv). Passing more than one of these options is equivalent to \-vv.
.TP
.B \-\-path
Show path info for the ports found by a search or a dependency calculation
.TP
.B \-\-regex
Interpret filter and search pattern as regular expression
.TP
.B \-\-prefer\-higher, \-ph
Make prt-get parse the version strings and prefer the higher version,
even if the one found in the ports tree is lower. Also used during
a sysup operation.
.TP
.B \-\-strict\-diff, \-sd
Override the 'preferhigher' configuration option. Equivalent to
.B \-\-config\-set=\(dqpreferhigher no\(dq
.SH "CONFIGURATION"
.TP
See man prt\-get.conf(5)
.SH "EXAMPLES"
.TP
.B prt\-get install irssi
Download, build and install irssi, with one simple command
.TP
.B prt\-get install paper yasm
Install paper and yasm. Abort with an informative error message if either
package is already installed, allowing you to issue a revised command.
.TP
.B prt\-get update \-fr openssh
Update your current version of openssh, forcing a rebuild even if no version difference is detected.
Useful if there was a major version change in one of its dependencies, and \fBrevdep openssh\fP
indicates a broken package. :\-)
.TP
.B MISSLIBS=$(revdep \-vvv mpv | awk \-v FS=: '/(missing library)/ {print $3}'); [ \-n \(dq${MISSLIBS[@]}\(dq ] && for i in ${MISSLIBS[@]}; do prt\-get fsearch $i; done
(adapted from a script by ppetrov^) Check for the presence of the runtime libraries needed by mpv.
If any are absent, search the footprints to determine which ports provide the missing libraries.
.TP
.B prt\-get isinst $(prt\-get info ffmpeg | awk \-v FS=: '/^Optional/ {gsub(/,/,\(dq \(dq,$2); print $2}') | awk \-v FS=\(dq \(dq '/not installed/ {print $2}'
Show all the optional dependencies of ffmpeg that are not currently installed.
.TP
.B prt\-get isinst $(prt\-get info ffmpeg | awk \-v FS=: '/^Optional/ {gsub(/,/,\(dq \(dq,$2); print $2}') | awk \-v FS=\(dq \(dq '/not installed/ {print $2}' | xargs prt\-get depinst \-\-group \-\-softdeps ffmpeg
Extension of the above. Installs ffmpeg and all its optional dependencies, in
the order that guarantees a maximal feature set. The --group flag tells
\fBprt\-get\fP to abort the operation if any port fails to build, so as not to
spend any resources on ffmpeg until all of its optional dependencies are in
place.
.TP
.B prt\-get isinst $(if grep \-qE '^ffmpeg:' /etc/prt\-get.softdeps 2>/dev/null; then grep \-E '^ffmpeg:' /etc/prt\-get.softdeps | cut \-d: \-f2 | tr ',' ' '; else prt\-get info ffmpeg | awk \-v FS=: '/^Optional/ {gsub(/,/,\(dq \(dq,$2); print $2}'; fi) | awk \-v FS=\(dq \(dq '/not installed/ {print $2}' | xargs prt\-get depinst \-\-group \-\-softdeps ffmpeg
Extension of the above (addressing a use case envisioned by ivandi). The
user can create the file /etc/prt-get.softdeps containing a line like
.B ffmpeg: x264 x265
and then the above command will perform a depinst --group operation to ensure that
at least x264 and x265 (but not necessarily any of the other optional
dependencies) are present before trying to build ffmpeg. In the absence of such
a .softdeps config, the operation reverts to the behaviour of the preceding
example (maximal feature set). Implementing Gentoo USE flags with such an
awkward one-liner might draw criticism from advocates of the KISS principle.
.TP
.B prt\-get search \-\-regex '^(m|n|p)c.*'
Return a list of all ports whose names start with "mc", "nc", or "pc"
.TP
.B prt\-get dsearch irc
Return a list of all ports having "irc" in their name or description
.TP
.B prt\-get fsearch \-\-full \(dq/usr/etc/*\(dq | awk '/^Found in/ { $0=gensub(/Found in .*\e/(.+):/,\(dq\e\e1\(dq,\(dqg\(dq); print;}'
Return a list of all ports that store their configs in /usr/etc. Omit the
pipe to awk if you also want a detailed list of the files that matched.
.TP
.B comm \-13 <(ls /usr/ports/core) <(prt\-get listorphans)
(based on comments from Romster and jue) Filter out the core ports from the list of orphans, in
shells (like bash) that support process substitution
.TP
.B comm \-13 <(cat ~/.keepers <(ls /usr/ports/core) | sort) <(prt\-get listorphans) | xargs prt\-get remove
(system-hosing extension of the above) A one-liner inspired by \fBpkg\-clean\fP
and \fBpkgfoster\fP, but without the safeguard of interactivity. \fBDo not try this on a
mission-critical system.\fP
.TP
.B prt\-get isinst $(prt\-get quickdep $(prt\-get quickdiff)) | awk '/not installed/ {print $2}'
(adapted from a comment by Fun) After updating your ports tree, print out a list of dependencies
that were not needed the last time you built your currently-installed ports, but are needed now by
the newer versions of these ports. The output of this command is sorted by dependencies, therefore
suitable for piping to \fBxargs prt\-get install\fP.
.TP
.B prt\-get isinst $(prt\-get quickdep $(prt\-get quickdiff)) | awk '/is installed/ {print $2}'
Same as above, but only print the dependencies that are already installed. The output of this
command is suitable for piping to \fBxargs prt\-get update\fP.
.TP
.B prt\-get isinst $(prt\-get quickdep i3) | awk '/not installed/ { print $2 }' | xargs prt\-get depinst \-\-softdeps \-\-test
(inspired by a troubleshooting session with hestia) Assemble a set of install
targets needed to build the i3 window manager; sort the list, respecting both
hard and soft dependencies; then print how the installation would proceed. The
awk filter in the middle is needed to prevent the command from failing with the
error message "already installed".
.TP
.B comm \-3 <(prt\-get printf \(dq%i:%n %v\-%r\en\(dq | grep \-v ^no | cut \-d: \-f2 | sort) <(pkginfo \-i | sort)
(inspired by a bug report from teodor) an alternative to \fBprt\-get diff\fP.
In the output, left-justified lines show the version available in the
repositories, while indented lines show the version installed. On a
reasonably up-to-date system, the two processes in the above command will
return many identical lines; these are suppressed by the -3 flag to
\fBcomm(1)\fP.
.TP
.B for L in /var/log/pkgbuild/*.log; do P=${L%__*}; P=${P##*/}; VR=${L##*__}; VR=${VR%.log}; if ! prt\-get isinst $P >/dev/null; then mv $L /var/log/uninstalled; elif [ \(dq$(prt\-get current $P)\(dq != \(dq$VR\(dq ]; then mv $L /var/log/oldbuild/; fi; done
(based on a feature request by samsep10l) a command you can put into a script
called by root's crontab, in order to mimic Slackware's tidy directory listings
(the main logdir only contains build logs of the latest installed packages;
other logs are moved to a separate directory). This particular command relies
on declaring \(dqlogfile /var/log/pkgbuild/%n__%v-%r.log\(dq and \(dqwritelog
enabled\(dq in \fBprt\-get.conf(5)\fP. Logs saved with a different filename
pattern will require slight adjustments to the command.
.TP
.B prt\-get printf \(dq%p\et%u\en\(dq | awk '($1 ~ /\e/myrepo$/) { print $2 }'
Print the upstream URL for each port in the collection \(dqmyrepo\(dq, perhaps
as the first step in keeping your personal overlay up to date.
.TP
.B prt\-get printf \(dq%M\et%n\en\(dq | grep \-c ^Tim
Count how many ports our most-overworked core team member claims responsibility for.
.TP
.B comm \-13 <(prt\-get depends firefox\-bin |tail \-n +2 |sort) <(prt\-get depends firefox |tail \-n +2 |sort)
Find the build-time dependencies of firefox. Runtime dependencies would also appear in the list generated by
the first process substitution, and \fBcomm -13\fP will suppress what the two lists have in common.
.TP
.B prt\-get listinst \-\-depsort | xargs prt\-get install \-\-install\-root=/mnt
Sort the list of installed packages by dependencies, and then install all
those packages onto a backup filesystem (mounted at /mnt). If you have a customized
pkgadd.conf that you want applied to this operation, either copy it to
/mnt/etc where pkgadd will be looking for it, or pass the additional option \-\-aargs=\(dq\-c
/etc/pkgadd.conf\(dq to the install command.
.TP
.B prt\-get list \-\-path \-\-regex '^xorg.*' | grep \-v \(dq/usr/ports/xorg\(dq
Show the ports whose names begin with xorg, but which appear outside the xorg port collection.
(At the time of writing, this command returned at least two font ports.)
.SH "AUTHORS"
Johannes Winkelmann <jw@tks6.net>, and others cited inline
.SH "SEE ALSO"
prt\-get.conf(5), prt\-cache(8), Pkgfile(5), pkgmk(8), pkgadd(8), ports(8)