man-page: fix indentation and formatting

document the interaction between --install-root and 'runscripts yes'
This commit is contained in:
John McQuah 2023-06-19 14:54:06 -04:00
parent b5aa185537
commit 7c1126f0b0
2 changed files with 73 additions and 67 deletions

View File

@ -14,7 +14,7 @@ pkgutils from CRUX (see http://www.crux.nu)
.B prt\-get command [options] <arguments> .B prt\-get command [options] <arguments>
.br .br
.SH "DESCRIPTION" .SH "DESCRIPTION"
prt\-get is a package management tool which provides additional prt-get is a package management tool which provides additional
functionality to the CRUX package management system. It works with the functionality to the CRUX package management system. It works with the
local ports tree and is therefore fully compatible with ports(8) and local ports tree and is therefore fully compatible with ports(8) and
pkgmk(8)/pkgadd(8)/pkgrm(8). It offers the following features: pkgmk(8)/pkgadd(8)/pkgrm(8). It offers the following features:
@ -42,16 +42,16 @@ search within the ports
.PP .PP
What prt\-get basically does is build, install/upgrade, and remove packages, using What prt-get basically does is build, install/upgrade, and remove packages,
pkgmk, pkgadd, and pkgrm. Additionally, you don't have be in the port's 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 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 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 allows you to just install or update a package, without caring where
it actually is located on your file system. it actually is located on your file system.
.PP .PP
prt\-get also lets you search for ports by name, prt-get also lets you search for ports by name,
find information about ports (without installing them of course), find information about ports (without installing them of course),
or print the dependencies of a port (as a space- or newline-separated list, or print the dependencies of a port (as a space- or newline-separated list,
or a formatted tree). Note that dependencies are no or a formatted tree). Note that dependencies are no
@ -59,16 +59,16 @@ requirement for crux packages and therefore not always accurate.
.PP .PP
prt\-get has a test mode so you can see what effect an install/update 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 operation would have. Use the --test switch for this (more details in
the \fBOPTIONS\fP section below). the \fBOPTIONS\fP section below).
.SH "RETURN VALUE" .SH "RETURN VALUE"
prt\-get returns 0 on success and a non-zero value otherwise (exact prt-get returns 0 on success and a non-zero value otherwise (exact
value -> meaning mapping to be determined...) value -> meaning mapping to be determined...)
.SH "COMMANDS" .SH "COMMANDS"
prt\-get uses so\-called commands, which always have to be the first prt-get uses so-called commands, which always have to be the first
non-option argument passed. This is very similar to non-option argument passed. This is very similar to
.B cvs(1). .B cvs(1).
[command] can be one of the following: [command] can be one of the following:
@ -88,13 +88,13 @@ Basically a synonym for install (without the --nodeps flag).
.TP .TP
.B update [\-\-margs] [\-\-aargs] [\-\-log] [\-\-softdeps] <package1> [<package2> ...] .B update [\-\-margs] [\-\-aargs] [\-\-log] [\-\-softdeps] <package1> [<package2> ...]
Basically a synonym for install. Earlier versions of \fBprt\-get\fP did not adjust Basically a synonym for install. Earlier versions of \fBprt\-get\fP did not
the \fBpkgadd(8)\fP arguments on a package-by-package basis, but applied "install adjust the \fBpkgadd(8)\fP arguments on a package-by-package basis, but
mode" or "update mode" to the entire transaction. This latest \fBprt\-get\fP applied "install mode" or "update mode" to the entire transaction. This
interprets the install command less rigidly, and tries to sync your installed latest \fBprt\-get\fP interprets the install command less rigidly, and tries
ports with their repository versions unless instructed otherwise (using to sync your installed ports with their repository versions unless instructed
\fBprt\-get lock\fP, the --prefer-higher option, or the \fIprt-get.aliases\fP otherwise (using \fBprt\-get lock\fP, the --prefer-higher option, or the
file). \fIprt-get.aliases\fP file).
.TP .TP
.B remove <package1> [<package2> ...] .B remove <package1> [<package2> ...]
@ -106,11 +106,13 @@ Update all installed packages which are outdated. Sorts by hard dependencies
by default. Passing the --softdeps switch tells \fBprt\-get\fP to also consider by default. Passing the --softdeps switch tells \fBprt\-get\fP to also consider
optional dependencies when sorting. Passing the --nodeps switch tells prt-get optional dependencies when sorting. Passing the --nodeps switch tells prt-get
not to sort by dependencies at all. not to sort by dependencies at all.
.B Breaking Change: .B Breaking Change:
If a port has acquired new dependencies since its last successful build, If a port has acquired new dependencies since its last successful build,
those new dependencies will be injected into the transaction. This feature those new dependencies will be injected into the transaction. This feature
lingered many years on the TODO list, and its absence was the motivation for lingered many years on the TODO list, and its absence was the motivation for
many clever workarounds (documented in the \fBEXAMPLES\fP section below). many clever workarounds (documented in the \fBEXAMPLES\fP section below).
You can use the You can use the
.B lock .B lock
and and
@ -173,10 +175,10 @@ in their name
Search the ports tree (both name and description) for the pattern Search the ports tree (both name and description) for the pattern
.B expr .B expr
(which can be a shell-like wildcard pattern or a regexp). The search in (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 the description is not case sensitive. Note that this requires prt-get
to read every Pkgfile, which makes it rather slow; if you like this, to read every Pkgfile, which makes it rather slow; if you like searching
consider using the cache functionality, so you only have to spend this by description, consider using the cache functionality, so you only have to
time once after updating the ports tree has been updated. read every Pkgfile when the ports tree is updated.
.TP .TP
.B fsearch [\-\-full] [\-\-regex] <pattern> .B fsearch [\-\-full] [\-\-regex] <pattern>
@ -203,9 +205,10 @@ Print the port's README file if it exists; if set, uses $PAGER
.TP .TP
.B depends [\-\-softdeps] <package1> [<package2> ...] .B depends [\-\-softdeps] <package1> [<package2> ...]
Print a recursive list of dependencies needed to install the packages passed 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, as argument. It shows a list of the dependencies that were found in the
plus a list of the dependencies that could not be found. Pass the --softdeps flag ports tree, plus a list of the dependencies that could not be found. Pass
if you want the sorting algorithm to consider optional dependencies too. the --softdeps flag if you want the sorting algorithm to consider
optional dependencies too.
.TP .TP
.B quickdep [\-\-softdeps] <package1> [<package2> ...] .B quickdep [\-\-softdeps] <package1> [<package2> ...]
@ -292,27 +295,27 @@ Print formatted port list format string can contain variables, which
are replaced like this: are replaced like this:
.TP .TP
\ \ \ \(bu \ \ \ \(bu
%n \-> name %n -> name
.TP .TP
\ \ \ \(bu \ \ \ \(bu
%p \-> path %p -> path
.TP .TP
\ \ \ \(bu \ \ \ \(bu
%v \-> version %v -> version
.TP .TP
\ \ \ \(bu \ \ \ \(bu
%r \-> release %r -> release
.TP .TP
\ \ \ \(bu \ \ \ \(bu
%d \-> description %d -> description
.TP .TP
\ \ \ \(bu \ \ \ \(bu
%e \-> dependencies %e -> dependencies
.TP .TP
\ \ \ \(bu \ \ \ \(bu
@ -320,36 +323,36 @@ are replaced like this:
.TP .TP
\ \ \ \(bu \ \ \ \(bu
%u \-> URL %u -> URL
.TP .TP
\ \ \ \(bu \ \ \ \(bu
%M \-> Maintainer %M -> Maintainer
.TP .TP
\ \ \ \(bu \ \ \ \(bu
%R \-> Readme ("yes"/"no") %R -> Readme ("yes"/"no")
.TP .TP
\ \ \ \(bu \ \ \ \(bu
%E \-> pre-install script ("yes"/"no") %E -> pre-install script ("yes"/"no")
.TP .TP
\ \ \ \(bu \ \ \ \(bu
%O \-> post-install script ("yes"/"no") %O -> post-install script ("yes"/"no")
.TP .TP
\ \ \ \(bu \ \ \ \(bu
%l \-> is locked ("yes"/"no") %l -> is locked ("yes"/"no")
.TP .TP
\ \ \ \(bu \ \ \ \(bu
%i \-> "no" if not installed, "yes" if it's installed and %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 up to date and "diff" if it's installed and a new version is in the
ports tree. ports tree.
Use "\\n" and "\\t" to format your output (no additional format specified Use "\\n" and "\\t" to format your output (no additional format codes
suported). The optional format string2 can contain the same variables supported). The optional format string2 can contain the same variables
as format string1 and is used to sort the output. You can specify a as format string1 and is used to sort the output. You can specify a
.B wildcard filter .B wildcard filter
to filter by package name. to filter by package name.
@ -359,16 +362,16 @@ to filter by package name.
.B listinst [\-v|\-vv] [\-\-regex] [\-\-depsort] [filter] .B listinst [\-v|\-vv] [\-\-regex] [\-\-depsort] [filter]
List installed ports. It's basically the same as List installed ports. It's basically the same as
.B pkginfo \-i, .B pkginfo \-i,
but omits version when called without verbose (\-v, \-vv) switch. Plus but omits version when called without verbose (-v, -vv) switch. Plus
it is notably faster in my tests. \-v adds version information, \-vv it is notably faster in my tests. -v adds version information, -vv
adds version and description. adds version and description.
.B Warning: .B Warning:
\-vv will slow down the process because it requires prt\-get to scan -vv will slow down the process because it requires prt-get to scan
both the ports database and the ports tree. both the ports database and the ports tree.
It's also possible to use shell-like It's also possible to use shell-like
.B wildcards .B wildcards
for the listinst command. Make sure you escape where needed. By default for the listinst command. Make sure you escape where needed. By default
it's sorted alphabetically; use the \-\-depsort switch to sort by it's sorted alphabetically; use the --depsort switch to sort by
dependencies. dependencies.
.TP .TP
@ -380,8 +383,8 @@ Output appears alphabetically separated by newlines, making it suitable for
process substitution as shown in the process substitution as shown in the
.B EXAMPLES .B EXAMPLES
section below. Note that some core ports might be runtime section below. Note that some core ports might be runtime
dependencies despite their absence in the "Depends on:" line; see \fBPkgfile(5)\fP dependencies despite their absence in the "Depends on:" line;
for an explanation of this practice. see \fBPkgfile(5)\fP for an explanation of this practice.
.TP .TP
.B isinst <package1> [<package2> ...] .B isinst <package1> [<package2> ...]
@ -528,25 +531,25 @@ the requested packages onto a different directory than '/'. In daily usage,
this option is not required; it's primarily interesting if you're developing this option is not required; it's primarily interesting if you're developing
an independent installation. an independent installation.
Some pre- or post-install scripts might not have the intended effect if invoked Pre- and post-install scripts will not be executed if the requested
as root directory lacks a copy of the ports tree. So if you're maintaining an
.B chroot <dir> /bin/sh <path/to/script> installation mounted somewhere different than '/', it's not enough to put
(the naive way to respect --install-root). the line
So if you're maintaining an installation mounted somewhere different than '/', .B runscripts yes
it might be safer to ensure that your \fBprt\-get.conf(5)\fP has the line in your prt-get.conf; you also have to ensure that the pre- and post-install
.B runscripts no scripts can be found in the same location relative to <dir>.
and then run any pre- or post-install scripts by hand.
The setting for --install-root determines which package database is used for 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 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 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 on the parent filesystem. Therefore it is not necessary for <dir> to contain
its own copy of the ports tree, or even a copy of prt-get.conf. its own copy of the ports tree (unless 'runscripts yes' is desired, as
However, if <dir>/etc/pkgadd.conf exists and is different from /etc/pkgadd.conf, explained above). However, if <dir>/etc/pkgadd.conf exists and is different
then install or update commands might behave unexpectedly. In order to preserve from /etc/pkgadd.conf, then install or update commands might behave
the \fBpkgadd.conf(5)\fP settings from the host system, append the option unexpectedly. In order to preserve the \fBpkgadd.conf(5)\fP settings from the
--aargs='-c /etc/pkgadd.conf' to your \fBprt-get install\fP host system, append the option --aargs='-c /etc/pkgadd.conf' to your \fBprt\-get
command, or just copy the desired directives into <dir>/etc/pkgadd.conf . install\fP command, or just copy the desired directives into
<dir>/etc/pkgadd.conf .
.TP .TP
.B \-\-log .B \-\-log
@ -580,8 +583,9 @@ transactions as well.
.TP .TP
.B \-v, \-vv .B \-v, \-vv
(verbosity level) Show version of a port (\-v), or show both version (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. and description (-vv). Passing more than one of these options is equivalent
to -vv.
.TP .TP
.B \-\-path .B \-\-path
@ -606,7 +610,7 @@ Override the 'preferhigher' configuration option. Equivalent to
.SH "CONFIGURATION" .SH "CONFIGURATION"
.TP .TP
See man prt\-get.conf(5) See man prt-get.conf(5)
.SH "EXAMPLES" .SH "EXAMPLES"
.TP .TP
@ -628,7 +632,7 @@ Get the latest version of webkitgtk, rebuilding any of its outdated dependencies
Update your current version of openssh, forcing a rebuild even if no version Update your current version of openssh, forcing a rebuild even if no version
difference is detected. difference is detected.
Useful if there was a major soversion change in one of its dependencies, Useful if there was a major soversion change in one of its dependencies,
and \fBrevdep openssh\fP indicates a broken package. :\-) and \fBrevdep openssh\fP indicates a broken package. :-)
.TP .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 .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
@ -728,4 +732,4 @@ xorg port collection.
.SH "AUTHORS" .SH "AUTHORS"
Johannes Winkelmann <jw@tks6.net>, and others cited inline Johannes Winkelmann <jw@tks6.net>, and others cited inline
.SH "SEE ALSO" .SH "SEE ALSO"
prt\-get.conf(5), prt\-cache(8), Pkgfile(5), pkgmk(8), pkgadd(8), ports(8) prt-get.conf(5), prt-cache(8), Pkgfile(5), pkgmk(8), pkgadd(8), ports(8)

View File

@ -296,7 +296,8 @@ const {
// -- pre-install // -- pre-install
struct stat statData; struct stat fstatData; struct stat statData; struct stat fstatData;
if ((parser->execPreInstall() || m_config->runScripts()) && if ((parser->execPreInstall() || m_config->runScripts()) &&
stat((portdir + "/pre-install").c_str(), &statData) == 0) { stat((parser->installRoot() + portdir + "/pre-install").c_str(),
&statData) == 0) {
Process preProc( runscriptCommand, Process preProc( runscriptCommand,
portdir + "/pre-install", portdir + "/pre-install",
fdlog ); fdlog );
@ -405,7 +406,8 @@ const {
} else { } else {
// exec post install // exec post install
if ((parser->execPostInstall() || m_config->runScripts() ) && if ((parser->execPostInstall() || m_config->runScripts() ) &&
stat((portdir + "/post-install").c_str(), &statData) == 0) { stat((parser->installRoot() + portdir + "/post-install").c_str(),
&statData) == 0) {
Process postProc( runscriptCommand, Process postProc( runscriptCommand,
portdir + "/post-install", fdlog ); portdir + "/post-install", fdlog );
if (postProc.executeShell()) { if (postProc.executeShell()) {