Documentation/man8/prt-auf.8

766 lines
29 KiB
Groff
Raw Permalink Normal View History

2022-06-10 11:17:22 -04:00
.\" man page for prt-auf
.\" last edited May 2023 by John McQuah, jmcquah at disroot dot org
2022-06-10 11:17:22 -04:00
.\"
.\" based on original work by Johannes Winkelmann, jw at tks6 dot net
.\"
.\" .PU
.TH "prt-auf" "8" "" "" ""
.SH "NAME"
.LP
prt-auf - add/upgrade frontend to the CRUX pkgutils, inspired by \fBprt\-get\fP(8).
2022-06-10 11:17:22 -04:00
(see http://www.crux.nu for an overview of CRUX ports and pkgutils)
.SH "SYNOPSIS"
.B prt\-auf subcommand [options] <arguments>
.br
.SH "DESCRIPTION"
prt-auf is a frontend to the CRUX pkgutils, orchestrating their operation
2022-06-10 11:17:22 -04:00
behind the scenes and letting the user focus on higher-level objectives. It
scans both the local ports tree and the installed package database, to
resolve dependency relationships and to determine which installed packages
are out of date. \fBprt\-auf\fP is especially relevant when you want to:
.PP
.TP
\ \ \ \(bu
add/update a package without first determining where in the ports tree
its build instructions and dependencies are located
.TP
\ \ \ \(bu
pass multiple packages on one command line for an add/update operation
.TP
\ \ \ \(bu
show all the dependencies that would be needed by a set of packages
.TP
\ \ \ \(bu
search for ports by name, by description, or by the files they provide
.TP
\ \ \ \(bu
show the upstream url or the maintainer contact information
.PP
\fBprt\-auf\fP basically serves as an intermediary between your high-level
objectives and the specific calls to pkgmk, pkgadd, and pkgrm that would
achieve them. prt\-auf will search for the necessary information itself in
all the port collections specified in its config file. This allows you to
just request a package for installation, without caring where it actually is
located on your file system. prt\-auf was inspired by \fBprt\-get\fP(8) and
offers an essentially identical user experience.
.PP
prt-auf automates the process of tracking down dependencies of the ports you
want to install. The result of these recursive calculations can be printed as
2022-06-10 11:17:22 -04:00
a space- or newline-separated list, or with indentation to represent the
tree structure. Note that prt-auf trusts the port maintainer to provide an
2022-06-10 11:17:22 -04:00
accurate list of dependencies; if this list is incomplete for any of the
ports in your collections, the build might fail.
.PP
prt-auf 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
2022-06-10 11:17:22 -04:00
the \fBOPTIONS\fP section below).
.SH "RETURN VALUE"
Calling prt-auf within a shell script sometimes requires you to check its
exit status. Like most Unix tools, prt-auf returns 0 on success and a
2022-06-10 11:17:22 -04:00
non-zero value otherwise. A typical usage is:
.B if prt\-auf isinst $SOME_PORT; then $TAKE_THIS_ACTION; fi
.SH "SUBCOMMANDS"
prt-auf uses so-called subcommands, which always have to be the first
2022-06-10 11:17:22 -04:00
non-option argument passed. This is very similar to
.B git(1).
\fBsubcommand\fP can be one of the following:
2022-06-10 11:17:22 -04:00
.TP
.B install [\-\-group] [\-fr] [\-\-softdeps] [\-\-nodeps] [\-\-margs=] [\-\-aargs=] <package1> [<package2> ...]
calculate the minimal set of packages needed to satisfy the dependencies of
packages passed on the command line, and then proceed to install or
update each package in the (sorted) list. Pass the --group flag to abort the
operation if any package fails.
The --nodeps flag tells \fBprt\-auf\fP to leave the list of targets as-is,
without injecting or sorting by dependencies. The --softdeps flag tells
the sorting algorithm to also consider any optional dependency relationships
among the packages passed as argument (not injecting all possible optionals,
only the ones already installed or given on the command line). The default
behaviour is to inject (and sort by) hard dependencies only.
Pass the -fr flag to force a rebuild, even if a requested package appears
up to date. This flag will be inherited by all \fBpkgmk\fP processes. In
order not to tax your system resources unnecessarily, \fBprt\-auf\fP will
interpret the -fr flag to also imply --nodeps. You can pass --depsort
\fIafter\fP -fr, if you really want to force a rebuild of every package in
the dependency chain.
Normally \fBprt\-auf\fP will skip the compilation step and proceed straight
to \fBpkgadd(8)\fP if it finds an existing package (of the same version as
what's in the repository) in the expected location. This shortcut is taken
in case the user chose to run \fBpkgmk\fP manually, rather than as a child
process of \fBprt\-auf\fP. To avoid short-circuiting the rebuild on the next
run of \fBprt\-auf\fP (after a transaction that failed due to a footprint
mismatch), any built package with a mismatched footprint will be renamed with
the "CHECKME" suffix. You can inspect this built package using \fBpkginfo
-f\fP, and \fBpkgadd\fP it if the footprint mismatch is deemed
unproblematic.
2022-06-10 11:17:22 -04:00
.TP
.B depinst [\-\-group] [\-fr] [\-\-softdeps] [\-\-margs=] [\-\-aargs=] <package1> [<package2> ...]
essentially a synonym for \fBinstall\fP (without the --nodeps flag). Support
for this subcommand is retained as a convenience for long-time prt-get
users, who might not be accustomed to the automatic dependency injection of
prt-auf. A helpful way to summarize this aspect of 'prt-auf install'
is that prt-auf never "silently assumes the user didn't want a particular
dependency" [1]. The user has to actively turn off the dependency resolver
(using the --nodeps flag) in order to mimic the classic behaviour of prt-get.
[1] https://lists.crux.nu/pipermail/crux/2008-June/001784.html
2022-06-10 11:17:22 -04:00
.TP
.B update [\-\-group] [\-fr] [\-\-softdeps] [\-\-nodeps] [\-\-margs=] [\-\-aargs=] <package1> [<package2> ...]
essentially a synonym for \fBinstall\fP. Support for this subcommand is
retained as a convenience for long-time prt-get users, who might not be
accustomed to the mixed install/update mode of prt-auf.
2022-06-10 11:17:22 -04:00
.TP
.B remove [\-\-rargs=] <package1> [<package2> ...]
remove packages listed in this order (and delete them from the lockfile, if
locked). The only relevant option you might want to pass to \fBpkgrm\fP(8)
is --root (or -r), used when you're managing a CRUX installation on a
temporarily mounted filesystem. In order not to confuse the argument parser
(which splits on whitespace), you should format such a request as
2022-06-10 11:17:22 -04:00
.B prt\-auf remove \-\-rargs=\-\-root=/path/to/mounted/crux <package1> [<package2> ...]
and \fBprt\-auf\fP will clean up the -r switch so that \fBpkgrm\fP(8) does what
you want. Even easier is to pass the --install-root option (see below).
2022-06-10 11:17:22 -04:00
.TP
.B sysup [\-\-group] [\-\-softdeps] [\-\-test]
Update all installed packages which are outdated and not locked. Essentially
the same as
.B prt\-auf quickdiff | tr ' ' '\n' | grep -v -F -f /etc/prt-get.locker | xargs prt\-auf depinst
but more convenient to type. Pass the --group flag in order to stop the
operation at the first port that fails to update. Pass the --softdeps flag in
order to consider optional dependencies when constructing and sorting the list
of targets.
2022-06-10 11:17:22 -04:00
.TP
.B lock <package1> [<package2>...]
Exempt these packages from any subsequent
2022-06-10 11:17:22 -04:00
.B sysup
operation (i.e., keep them at their currently-installed version).
2022-06-10 11:17:22 -04:00
.TP
.B unlock <package1> [<package2>...]
Remove lock from these packages.
2022-06-10 11:17:22 -04:00
.TP
.B listlocked
List names of packages which are locked.
.TP
.B diff [\-\-all]
Show differences between installed packages and versions available in the
active repositories.
Locked packages are only displayed if you use the --all switch.
2022-06-10 11:17:22 -04:00
.TP
.B quickdiff
Print a simple list of packages whose installed version differs from the
version available in the repositories.
2022-06-10 11:17:22 -04:00
.TP
.B search [\-\-path] [\-\-regex] <expr>
Search the repositories for ports that contain
2022-06-10 11:17:22 -04:00
.B expr
in their name.
2022-06-10 11:17:22 -04:00
.TP
.B dsearch [\-\-path] [\-\-regex] <expr>
Search the ports tree (both name and description) for the pattern
<expr>. The search in the description is not case sensitive. Note that
this requires prt-auf to read every Pkgfile, which makes it rather slow; if
you like searching by dependencies, consider using the cache functionality,
so you only have to recurse through the ports collections after each update
of the ports tree, not whenever you conduct a description search.
2022-06-10 11:17:22 -04:00
.TP
.B fsearch [\-\-path] [\-\-regex] <pattern>
Search the repositories for ports whose footprints contain a match for
<pattern>. By default, the full path is tested against <pattern>, so if you
want to avoid spurious matches involving the parent directories, use --regex
with the end-of-line anchor ($) or the leading path separator (\e/)
delimiting the sought-after filename.
.SH ""
When using the --regex switch with 'search', 'dsearch', or 'fsearch',
\fIpattern\fP should be a Perl-compatible regular expression (e.g. prt-auf
fsearch --regex 'liblz(o2|ma).*'). You can omit the --regex switch if your
search pattern contains no metacharacters (such as: +, *, ., / ). Shell
globbing (with the * and ? wildcards) is \fINOT\fP supported.
2022-06-10 11:17:22 -04:00
.TP
.B info <port>
Print available info for a port.
2022-06-10 11:17:22 -04:00
.TP
.B path <port>
Print the path of a port.
2022-06-10 11:17:22 -04:00
.TP
.B readme <port>
Print the port's README file if it exists.
2022-06-10 11:17:22 -04:00
.SH ""
The subcommands 'info', 'path', and 'readme' expect as their argument an exact
match for one of the ports in the active repositories. If you are not sure that
a port by that name exists, you should first use 'search', 'dsearch',
or 'fsearch' to generate a list of possible arguments. The info or readme
will come from the highest-priority port in the active repositories (the
same port that would be built by an 'install' command).
2022-06-10 11:17:22 -04:00
.TP
.B depends [\-\-softdeps] <package1> [<package2> ...]
Print a sorted list of dependencies needed to install the packages passed
as argument. Packages that need to be installed first are listed first. It
shows a list of the dependencies that were found in the ports tree, followed by
a list of the dependencies that could not be found. Pass the --softdeps flag if
you want optional dependencies to be considered when constructing and sorting
the output.
2022-06-10 11:17:22 -04:00
.TP
.B quickdep [\-\-softdeps] <package1> [<package2> ...]
Mostly the same output as depends, but stripped of the installation status
indicator, and separated by spaces rather than newlines. Also, ports that
cannot be found in the ports tree are omitted from the results. This formatting
is useful in command substitution, e.g. instead of running
2022-06-10 11:17:22 -04:00
.B prt\-auf depinst xorg-server
you might micromanage the process with a gratuitous loop:
.B for i in $(prt\-auf quickdep xorg-server); do if prt\-auf isinst $i; then prt\-auf install \-fr $i; else prt\-auf install $i; fi; done
2022-06-10 11:17:22 -04:00
Note: In case there are dependencies not available in your active port
collections, it might be useful to run
2022-06-10 11:17:22 -04:00
.B prt\-auf depends <package1> | grep \(dq\-\- missing packages\(dq
as a first step, in order to ensure that your port collections have everything
needed for successful builds.
2022-06-10 11:17:22 -04:00
.TP
.B deptree [\-\-softdeps] <package>
Print a tree of the dependencies of
.B <package>.
2022-06-10 11:17:22 -04:00
Pass the --softdeps flag if you want optional dependencies to appear in the
resulting tree. Only the optional dependencies that are currently installed will
be shown, allowing you to see at a glance what might have been linked to
\fB<package>\fP. Because \fBprt\-auf\fP has no mechanism for inspecting the
history of the package database (specifically at the moment \fB<package>\fP was
built), there is no reliable way to know whether the automagic linking actually
took place. This subcommand should therefore be paired with
.B pkginfo -f <package>
and the build log, if present, in order to ascertain the actual linking that
occurred.
2022-06-10 11:17:22 -04:00
.TP
.B dependent [\-\-softdeps] [\-\-all] [\-\-recursive] [\-\-tree] <package>
Print a list of ports whose "Depends on:" line contains
.B <package>
(or its dependents, if --recursive is given). To also search the "Optional:"
lines, pass the --softdeps flag. By default, output is restricted to ports
that are installed. To see all the dependencies, add the --all switch. Use
--tree to get a nicely indented list (similar to the 'deptree' subcommand).
2022-06-10 11:17:22 -04:00
.TP
.B ls [--path] <port>
Print out a listing of the port's directory.
.TP
.B cat <port> [<file>]
Print out the file to stdout. If <file> is not specified, 'Pkgfile' is used.
.TP
.B edit <port> [<file>]
Edit the file using the editor specified in the $EDITOR environment variable.
If <file> is not specified, 'Pkgfile' is used.
.SH ""
Similar to 'info', 'path', and 'readme', a non-exhaustive search is performed
to satisfy an 'edit', 'cat', or 'ls' command. This behaviour ensures that your
edits or directory listings pertain to the port that would be built by
a 'prt-auf install' command. Meanwhile, 'prt-auf dup' will let you know if any
port in the active repositories is hidden by another port of the same name, but
the 'dup' command offers convenient access to only some of the fields
that 'info' or 'readme' would print.
2022-06-10 11:17:22 -04:00
.TP
2022-06-11 14:26:19 -04:00
.B dup [format string]
2022-06-10 11:17:22 -04:00
List ports which can be found in multiple directories configured in
.B /etc/prt-get.conf
2022-06-11 14:26:19 -04:00
The optional format string can contain any of the following variables,
allowing you to see at a glance how the ports differ.
.TP
\ \ \ \(bu
%n \-> name
.TP
\ \ \ \(bu
%p1, %p2 \-> path to the {higher, lower}-priority port
.TP
\ \ \ \(bu
%v1, %v2 \-> version of the {higher, lower}-priority port
.TP
\ \ \ \(bu
%u1, %u2 \-> upstream URL of the {higher, lower}-priority port
.TP
\ \ \ \(bu
%M1, %M2 \-> maintainer of the {higher, lower}-priority port
2022-06-10 11:17:22 -04:00
.TP
.B list [\-v|\-vv]
List ports available in the ports tree. It's basically the same as
.B ports \-l
but looks in all directories specified in the config file.
2022-06-11 14:26:19 -04:00
.TP
.B printf <format string> [\-\-regex] [\-\-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
%u \-> URL
.TP
\ \ \ \(bu
%P \-> optional dependencies
2022-06-11 14:26:19 -04:00
.TP
\ \ \ \(bu
%M \-> Maintainer
2022-06-11 14:26:19 -04:00
.TP
\ \ \ \(bu
%R \-> Readme ("yes"/"no")
2022-06-11 14:26:19 -04:00
.TP
\ \ \ \(bu
%E \-> pre-install script ("yes"/"no")
2022-06-11 14:26:19 -04:00
.TP
\ \ \ \(bu
%O \-> post-install script ("yes"/"no")
2022-06-11 14:26:19 -04:00
.TP
\ \ \ \(bu
%l \-> is locked ("yes"/"no")
2022-06-11 14:26:19 -04:00
.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. To restrict the list to package names
matching a desired pattern, you can specify \fB<filter>\fP.
2022-06-11 14:26:19 -04:00
Metacharacters in the filter are only respected if you pass the --regex option,
in which case your filter should be a Perl-compatible regular expression.
2022-06-10 11:17:22 -04:00
.TP
.B listinst [\-v|\-vv]
List installed ports. It's basically the same as
.B pkginfo \-i,
but omits version when called without verbose (\-v, \-vv) switch.
\-v adds version information, \-vv adds version and description.
2022-06-10 11:17:22 -04:00
.TP
.B listorphans [\-\-softdeps]
2022-06-10 11:17:22 -04:00
List installed ports which do not appear in the "Depends on:" line of
any other port currently installed. To also exclude ports that appear in the
"Optional:" lines of installed ports, pass the --softdeps flag. 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.
Removing a non-core package returned by this command might require a
2022-06-10 11:17:22 -04:00
rebuild of other packages; use revdep(1) to locate such breakage.
.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
2022-06-10 11:17:22 -04:00
.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.
2022-06-10 11:17:22 -04:00
.TP
.B current <package1> [<package2> ...]
Show the currently-installed version of <package1>, or a message
2022-06-10 11:17:22 -04:00
that <package1> is not installed. Also takes more than one package as
argument.
.TP
.B help
Show a help screen
2022-06-10 11:17:22 -04:00
.TP
.B version
Show the current version of prt\-auf
2022-06-10 11:17:22 -04:00
.TP
.B cache
Create a cache file from the ports tree, which will be used whenever
\fBprt\-auf\fP is invoked with the --cache option. Remember to run
\fBprt\-auf cache\fP each time you update the ports tree, or automate this
step by appending a line to the \fBports\fP(8) script. If you invoke
\fBprt\-auf\fP from a symbolic link that ends in 'cache', \fBprt\-auf\fP
will act as if it saw the --cache option on the command line, so the
symbolic link \fBprt\-cache\fP -> \fBprt\-auf\fP will save you the hassle of
typing '--cache' each time. Cache files generated by \fBprt\-auf\fP are
compatible with those generated by the equivalent version of
\fBprt\-get\fP(8).
2022-06-10 11:17:22 -04:00
.SH "OPTIONS"
The following options are primarily useful for install/update transactions.
.TP
.B \-\-test
Do not actually run pkgmk/pkgadd/pkgrm, just print the list of ports that would
be affected by the operation.
.TP
.B \-fr
Force rebuild. Implies 'pkgmk -f'; same as --margs=-f
In the most common uses of \fB\-fr\fP, it is not desired to rebuild all the
dependencies too, even the ones that are out of date. Hence the \fB\-fr\fP flag
will be interpreted to imply also \fB\-\-nodeps\fP. But you can override this
side effect by passing \fB\-\-depsort\fP AFTER the \fB\-fr\fP flag.
2022-06-10 11:17:22 -04:00
.TP
.B \-us
Update signature. Implies 'pkgmk -us'; same as --margs=-us
2022-06-10 11:17:22 -04:00
.TP
.B \-is
Ignore signature. Implies 'pkgmk -is'; same as --margs=-is
2022-06-10 11:17:22 -04:00
.TP
.B \-uf
2022-06-10 11:17:22 -04:00
Update footprint, implies 'pkgmk -uf'; same as --margs=-uf
.TP
.B \-if
2022-06-10 11:17:22 -04:00
Ignore footprint, implies 'pkgmk -if'; same as --margs=-if
.TP
.B \-ns
2022-06-10 11:17:22 -04:00
No stripping, implies 'pkgmk -ns'; same as --margs=-ns
.TP
.B \-kw
2022-06-10 11:17:22 -04:00
Keep working directory, implies 'pkgmk -kw'; same as --margs=-kw
.TP
.B \-\-margs="...", e.g. \-\-margs="\-im"
Pass these additional arguments to pkgmk;
note that \-d is already passed to pkgmk anyway.
2022-06-10 11:17:22 -04:00
.TP
.B \-\-aargs="...", e.g. \-\-aargs="\-f"
Pass these additional arguments to pkgadd
2022-06-10 11:17:22 -04:00
.TP
.B \-\-install\-root=<dir>, e.g. \-\-install\-root="/mnt"
Specify a mountpoint other than '/', where the built packages are to be
installed. This setting affects the package database that is subject to
read/write operations, but not the ports tree (which remains governed by
the prtdir directives in \fBprt-get.conf(5)\fP).
2023-06-20 11:58:23 -04:00
Pre- and post-install scripts will not be executed if the requested
root directory lacks a copy of the ports tree. So if you're maintaining an
installation mounted somewhere different than '/', it's not enough to put
the line 'runscripts yes' in your configuration file; you also have to
ensure that the pre- and post-install scripts can be found in the same
location relative to <dir>.
2022-06-10 11:17:22 -04:00
.TP
.B \-\-cache
Use cache file for this command
2022-06-10 11:17:22 -04:00
.TP
.B \-\-config=<file>
Read configuration directives from <file>, rather than \fI/etc/prt-get.conf\fP.
.TP
.B \-\-pre\-install, \-\-post\-install, \-\-run\-scripts
Execute pre-install, post-install, or both, if found in the port directory.
Each of these flags can be used as a one-time override of 'runscripts no' in
the configuration file. Basically equivalent to using --config=... with a
custom file that differs from your usual \fIprt-get.conf\fP only in
the 'runscripts' directive.
2022-06-10 11:17:22 -04:00
.SH ""
The following options affect the output of non-install (information-seeking)
transactions.
2022-06-10 11:17:22 -04:00
.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 \-\-filter=<pattern>
Restrict the output of a 'search' or 'list' command, showing only the ports
that match <pattern>. Basically a convenience for users who prefer not to
launch a separate process (awk or grep) to trim the search results.
2022-06-10 11:17:22 -04:00
.TP
.B \-\-path
Show path info for the ports found by a search or a dependency calculation.
2022-06-10 11:17:22 -04:00
.TP
.B \-\-regex
Interpret filter and search pattern as regular expression.
2022-06-10 11:17:22 -04:00
.SH "CONFIGURATION"
Most of the directives available in \fBprt\-get.conf(5)\fP are also
recognized and respected by \fBprt\-auf\fP. Notably, you can specify the
active port collections by ensuring that they appear on lines where 'prtdir'
is the first non-whitespace string. You can also toggle the running of
pre-/post-install scripts by editing the line that contains 'runscripts'.
You can specify alternatives to the default pkgutils programs (
/usr/bin/pkgmk, /usr/bin/pkgadd, /usr/bin/pkgrm, /bin/sh ) by editing the lines
for 'makecommand', 'addcommand', 'removecommand', 'runscriptcommand',
respectively. Lastly, you can control whether the pkgmk output is saved in a
log file, using the directives 'writelog <enabled|disabled>', 'logmode
<append|overwrite>', and 'logfile <path>'. The <path> in a 'logfile'
directive can contain any of the variables "%n", "%v", "%r", and "%p", which
are automatically replaced by the port's name, version, release, and full
path in the ports tree, respectively.
2022-06-10 11:17:22 -04:00
.SH "TECHNICAL DETAILS"
\fBprt\-auf\fP aims to recreate the familiar experience of \fBprt\-get\fP(8),
in a tidy Perl program that novice CRUX hackers would find less intimidating.
By keeping its inner workings entirely within one file, \fBprt\-auf\fP makes it
easier for CRUX newcomers to understand the architecture of the \fBports\fP(8)
system and the \fBpkgutils\fP.
One intended consequence of the less-intimidating code base is that bug reports
and feature requests can receive the attention of more CRUX users, rather than
just the handful of developers who have C++ experience. In order to facilitate
the insertion of new code to satisfy any feature requests, this section
provides an outline of the \fBprt\-auf\fP design.
The program begins by declaring all the variables that are shared among
subroutines. Some of these variables are initialized right away, but other
variables are only initialized once the program knows the requested action.
After all the arguments are parsed (and screened for validity), the hash maps
\fI%opkg\fP, \fI%odepends\fP, \fI%osearch\fP, and \fI%olog\fP will
retain in memory the user's desired settings. Then the relevant data structures
are populated from the files on disk (the cache, if --cache was passed on the
command line, the database of installed packages in /var/lib/pkg, the list of
locked ports, the list of aliases, or each \fBPkgfile\fP(5) found in the ports
tree).
Control is now passed to the subroutine that satisfies the given request. Many
of these subroutines return a simple array of strings, most notably the
subroutions \fIlist_ports()\fP, \fIdeporder()\fP, and \fIport_diff()\fP. But
the \fIup_inst()\fP subroutine returns references to five different arrays, so
that post-processing can provide informative output regarding which ports were
successfully installed, and which ports failed.
The final section of the main program (post-processing) considers the
distinctive output of each subroutine and customizes the handling of the
\fI@results\fP array accordingly. This section is also where the verbose switch
(-v|-vv) is taken into account, appending to each element of \fI@results\fP the
version or description of the ports found in the search.
2022-06-10 11:17:22 -04:00
.SH "CONTRASTS BETWEEN PRT-AUF and PRT-GET"
Although taking inspiration from \fBprt\-get\fP for its interface and
configuration, \fBprt\-auf\fP diverges from its predecessor in a few notable
ways. Some of these differences are mere omissions, which can easily be
incorporated at a later date. Long-time users of \fBprt\-get\fP will quickly
observe the following differences:
2022-06-10 11:17:22 -04:00
.PP
.TP
.B mixed install/update mode.
Packages given on the command line can be installed or not, and \fBprt\-auf\fP
will figure out the right way to call \fBpkgadd\fP(8) for each one.
2022-06-10 11:17:22 -04:00
.TP
.B new dependencies are automatically handled by sysup.
One benefit of the mixed install/update mode is that the sysup operation does
not restrict itself to only those ports currently installed. If the dependency
resolver finds ports that the maintainer has added as dependencies since the
last update, then sysup will insert them into the list of installation targets
in the appropriate positions.
2022-06-10 11:17:22 -04:00
.TP
.B no version comparator.
One of the main reasons to run CRUX is to stay current with the latest stable
versions endorsed by the port maintainers. (They subscribe to the upstream
mailing lists so you don't have to.) If you want to keep a particular piece of
software at a different version than the one chosen by its original maintainer,
you can maintain a shadow port in your own overlay (and put that overlay
higher in the config file).
2022-06-11 14:26:19 -04:00
.TP
.B no wildcards or shell globbing in the search commands.
Being written in Perl, \fBprt\-auf\fP automatically inherits a rich set of
routines for dealing with regular expressions. When paired with the
case-insensitive pattern matching of purely-alphanumeric queries, the Perl
regexp engine offers CRUX users enough flexibility to find any port they're
looking for, without needing to clutter the code base by reimplementing shell
wildcards.
2022-06-11 14:26:19 -04:00
.TP
.B no \-\-config\-prepend, \-\-config\-append, or \-\-config\-set switches.
Users of \fBprt\-get\fP might find it inconvenient not to have such a
mechanism for overriding the config file settings on a temporary basis. The
workaround is to create different variations of the config file, and use the
\fB\-\-config=\fP switch to select the appropriate file whenever a
non-default setting is desired.
.TP
.B no \-\-ignore switch.
This feature is easy enough to add at a later date, but a newcomer to CRUX will
likely be confused at having such fine-grained control over the automatic
dependency resolution. The two main reasons to use "--ignore" (an erroneous
"Depends on" line, or a satisfaction of the dependency by manual installations
that pkgutils is not aware of), are both more properly addressed by a long-term
solution rather than a one-time fix. If the "Depends on" line is truly in
error, the CRUX user should contact the port maintainer and get it fixed for
everybody, rather than passing the "--ignore" option and letting the error go
uncorrected. If the dependency was satisfied by a manual installation outside
of pkgutils, a better response is to make a dummy port and create an entry in
the aliases file. That way prt-auf will treat the dependency as satisfied for
any subsequent installations on the same machine, and passing the "--ignore"
option will be unnecessary for all future ports with the same dependency. The
canonical example of a line in the aliases file is
\ \ \ \ \ rust-bin: rust
which tells \fBprt\-auf\fP that an installed copy of rust-bin is sufficient to
proceed with the compilation of a port that mentions rust in its "Depends on"
line.
2022-06-10 11:17:22 -04:00
.SH "EXAMPLES"
.TP
.B prt\-auf install irssi
Download, build and install irssi, with one simple command
.TP
.B prt\-auf install \-\-group paper yasm
Install paper and yasm, but abort if paper fails to build or install.
2022-06-10 11:17:22 -04:00
.TP
.B prt\-auf install -fr openssh
2022-06-10 11:17:22 -04:00
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 prt\-auf info glib-networking
Show info about glib-networking
.TP
.B MISSLIBS=$(revdep -vvv mpv | awk -F ':' '/(missing library)/ {print $3}'); [ -n \(dq${MISSLIBS[@]}\(dq ] && for i in ${MISSLIBS[@]}; do prt\-auf 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.
2022-06-10 11:17:22 -04:00
.TP
.B prt\-get search --regex '^(m|n|p)c.*'
Return a list of all ports whose names start with "mc", "nc", or "pc"
2022-06-10 11:17:22 -04:00
.TP
.B prt\-auf dsearch irc
Return a list of all ports having "irc" in their name or description
.TP
.B comm -13 <(ls /usr/ports/core) <(prt-auf 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
2022-06-10 11:17:22 -04:00
.TP
.B comm -13 <(cat ~/.keepers <(ls /usr/ports/core) | sort) <(prt\-auf listorphans) | xargs prt\-auf 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
2022-06-10 11:17:22 -04:00
.TP
.B prt\-auf isinst $(prt\-auf quickdep $(prt\-auf 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\-auf install\fP or \fBxargs prt\-auf
grpinst\fP.
2022-06-10 11:17:22 -04:00
.TP
.B prt\-auf install \-\-group $(prt\-auf quickdep graphviz)
Installed all packages needed for graphviz , but abort the operation if
one package fails.
2022-06-10 11:17:22 -04:00
.TP
.B prt\-auf listinst | xargs prt\-auf depends | xargs prt-auf grpinst \-\-aargs="\-r=/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 grpinst command.
2022-06-10 11:17:22 -04:00
.TP
.B prt\-auf list --path --regex '^xorg.*' | grep -v "/usr/ports/xorg"
Show the ports whose names begin with xorg, but which appear outside the xorg
port collection.
2022-06-10 11:17:22 -04:00
(At the time of writing, this command returned at least two font ports.)
.SH "AUTHORS"
John McQuah <jmcquah at disroot dot org>, based on the prt\-get manpage by
Johannes Winkelmann, and other sources cited inline.
.SH "SEE ALSO"
prt\-get.conf(5), Pkgfile(5), pkgmk(8), pkgadd(8), pkgrm(8), ports(8)