report pre- and post-install scripts in test mode
support more format codes in the argument to 'dup' expand man-page to explain some asymmetries
This commit is contained in:
parent
8f71c4fe8b
commit
7175591b00
100
doc/prt-get.8
100
doc/prt-get.8
@ -252,23 +252,28 @@ order to show them all, add the --all switch.
|
|||||||
.SH ""
|
.SH ""
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B dependent [\-\-softdeps] <package>
|
.B dependent [\-\-recursive] [\-\-softdeps] [\-\-all] <package>
|
||||||
print a list of ports which have
|
Print a list of ports whose "Depends on:" line contains
|
||||||
.B <package>
|
.B <package>
|
||||||
in their "Depends on:" line. Use the --softdeps flag to also search the
|
(or its dependents, if --recursive is passed). Use the --softdeps flag to also
|
||||||
"Optional:" lines for \fB<package>\fP.
|
search the "Optional:" lines for \fB<package>\fP .
|
||||||
|
|
||||||
By default, output is restricted to ports that are installed. To see all
|
By default, output is restricted to ports that are installed. To see all the
|
||||||
the dependencies, add the --all switch; use --recursive to get a recursive
|
dependencies, add the --all switch. Use --tree to get a nicely indented list.
|
||||||
list (without duplication), and --tree to get a nicely indented one.
|
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B dup [-v] [format]
|
.B dup [-v] [format]
|
||||||
List ports which can be found in multiple directories configured in
|
List ports which can be found in multiple directories configured in
|
||||||
.B /etc/prt-get.conf
|
.B /etc/prt-get.conf
|
||||||
Use the verbose switch to simulate the output of version 5.12 and older (likely
|
Use the \fB\-v\fP switch to see a verbose report, which will show for each
|
||||||
to go away in the future). The format string can be used to create user
|
dup the port that takes precedence, and the port that is hidden (including
|
||||||
specified formats. The following symbols are currently replaced:
|
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
|
.TP
|
||||||
\ \ \ \(bu
|
\ \ \ \(bu
|
||||||
@ -276,20 +281,35 @@ specified formats. The following symbols are currently replaced:
|
|||||||
|
|
||||||
.TP
|
.TP
|
||||||
\ \ \ \(bu
|
\ \ \ \(bu
|
||||||
%p1 \-> Full path (including name) to port taking precendence
|
%p1 \-> full path (including name) to port taking precedence
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
\ \ \ \(bu
|
\ \ \ \(bu
|
||||||
%p2 \-> Full path (including name) to port being hidden
|
%p2 \-> full path (including name) to port being hidden
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
\ \ \ \(bu
|
\ \ \ \(bu
|
||||||
%v1 \-> Version of port taking precendence
|
%v1 \-> version of port taking precedence
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
\ \ \ \(bu
|
\ \ \ \(bu
|
||||||
%v2 \-> Version of port being hidden
|
%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
|
.TP
|
||||||
.B list [\-v|\-vv] [\-\-path] [\-\-regex] [filter]
|
.B list [\-v|\-vv] [\-\-path] [\-\-regex] [filter]
|
||||||
@ -363,7 +383,7 @@ are replaced like this:
|
|||||||
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 symbols
|
||||||
suported). The optional format string2 can contain the same variables
|
suported). 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
|
||||||
@ -395,8 +415,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> ...]
|
||||||
@ -423,14 +443,14 @@ Prints out a listing of the port's directory
|
|||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B cat <package> [<file>]
|
.B cat <package> [<file>]
|
||||||
Prints out the file to stdout. If <file> is not specified, 'Pkgfile' is used. If set, uses $PAGER.
|
Print to stdout (or $PAGER, if set) the contents of <file> in the port's
|
||||||
|
directory. If <file> is not specified, 'Pkgfile' is used.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B edit <package> [<file>]
|
.B edit <package> [<file>]
|
||||||
Edit the file using the editor specified in the $EDITOR environment variable.
|
Edit the file using the editor specified in the $EDITOR environment variable.
|
||||||
If <file> is not specified, 'Pkgfile' is used.
|
If <file> is not specified, 'Pkgfile' is used.
|
||||||
|
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B help
|
.B help
|
||||||
Shows a help screen
|
Shows a help screen
|
||||||
@ -542,6 +562,14 @@ Execute post-install script if it's there
|
|||||||
.B \-\-install-scripts
|
.B \-\-install-scripts
|
||||||
Execute pre-install and post-install script if they're there
|
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
|
.TP
|
||||||
.B \-\-install-root=<dir>
|
.B \-\-install-root=<dir>
|
||||||
Use <dir> as root directory for your installation; allows you to install
|
Use <dir> as root directory for your installation; allows you to install
|
||||||
@ -549,30 +577,32 @@ 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
|
Pre- and post-install scripts will not be executed if the requested
|
||||||
invoked 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 'runscripts yes' in your prt-get.conf; you also have to ensure
|
||||||
So if you're maintaining an installation on a volume mounted somewhere
|
that the pre- and post-install scripts can be found in the same location
|
||||||
other than '/', it might be safer to ensure that your \fBprt\-get.conf(5)\fP
|
relative to <dir>.
|
||||||
has the line
|
|
||||||
.B runscripts no
|
|
||||||
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
|
||||||
Write build output to log file
|
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 configuration directive
|
||||||
|
\(dqwritelog enabled\(dq; you have to resort to \fB\-\-config\-set=\(dqwritelog
|
||||||
|
disabled\(dq\fP if that is your intention.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B \-\-no-std-config
|
.B \-\-no-std-config
|
||||||
|
@ -20,7 +20,7 @@ It might look like this:
|
|||||||
# prt-get.conf
|
# prt-get.conf
|
||||||
|
|
||||||
# root directories
|
# root directories
|
||||||
prtdir /usr/ports/base
|
prtdir /usr/ports/core
|
||||||
prtdir /usr/ports/opt
|
prtdir /usr/ports/opt
|
||||||
prtdir /usr/ports/contrib
|
prtdir /usr/ports/contrib
|
||||||
|
|
||||||
@ -130,7 +130,7 @@ and %n would be
|
|||||||
This allows you to have separate log files per port.
|
This allows you to have separate log files per port.
|
||||||
|
|
||||||
.B readme
|
.B readme
|
||||||
which can be set to 'disabled', to suppress the notification after
|
can be set to 'disabled', to suppress the notification after
|
||||||
installing a port with a README file; 'compact', to collect all the READMEs
|
installing a port with a README file; 'compact', to collect all the READMEs
|
||||||
into one post-transaction output; or 'verbose', to print separate
|
into one post-transaction output; or 'verbose', to print separate
|
||||||
information about each port with a README file. See
|
information about each port with a README file. See
|
||||||
@ -149,13 +149,13 @@ append a comma separated list of ports to be used after the path,
|
|||||||
using a colon (':') character to separate the two components
|
using a colon (':') character to separate the two components
|
||||||
.B path:package1, package2,...
|
.B path:package1, package2,...
|
||||||
Note that this slows down prt-get a lot if you list a lot of packages.
|
Note that this slows down prt-get a lot if you list a lot of packages.
|
||||||
If you become aware of speed problems due to this, create a separate
|
If you become aware of speed problems due to this feature, create a separate
|
||||||
ports directory instead and use symlinks for the ports you want to use.
|
ports directory instead and fill it with symlinks to the ports you want.
|
||||||
|
|
||||||
.LP
|
.LP
|
||||||
You can write comments after a '#' character. If you have '#'
|
You can write comments after a '#' character. If you have '#'
|
||||||
characters in your paths, there's no way to escape them (as there is no
|
characters in your paths, there's no way to escape them (likewise there is
|
||||||
way to escape ':' characters). Complain to the author if this is a
|
no way to escape ':' characters). Complain to the author if this is a
|
||||||
problem :-)
|
problem :-)
|
||||||
|
|
||||||
|
|
||||||
|
@ -184,8 +184,19 @@ InstallTransaction::install( const ArgParser* parser,
|
|||||||
|
|
||||||
InstallTransaction::InstallResult result;
|
InstallTransaction::InstallResult result;
|
||||||
InstallInfo info( package->hasReadme() );
|
InstallInfo info( package->hasReadme() );
|
||||||
if ( parser->isTest() ||
|
if ( parser->isTest() ) {
|
||||||
(result = installPackage( package, parser, update, info )) == SUCCESS) {
|
info.preState = ( package->hasPreInstall() &&
|
||||||
|
(parser->execPreInstall() || m_config->runScripts())
|
||||||
|
) ? DEFERRED : NONEXISTENT;
|
||||||
|
info.postState = ( package->hasPostInstall() &&
|
||||||
|
(parser->execPostInstall() || m_config->runScripts())
|
||||||
|
) ? DEFERRED : NONEXISTENT;
|
||||||
|
m_installedPackages.push_back( make_pair(package->path()
|
||||||
|
+ "/" + package->name(), info) );
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((result = installPackage( package, parser, update, info )) == SUCCESS) {
|
||||||
|
|
||||||
m_installedPackages.push_back( make_pair( package->path()
|
m_installedPackages.push_back( make_pair( package->path()
|
||||||
+ "/" + package->name(), info));
|
+ "/" + package->name(), info));
|
||||||
@ -315,8 +326,7 @@ InstallTransaction::installPackage( const Package* package,
|
|||||||
if ((parser->execPreInstall() || m_config->runScripts()) &&
|
if ((parser->execPreInstall() || m_config->runScripts()) &&
|
||||||
stat((parser->installRoot() + pkgdir + "/" + "pre-install").c_str(),
|
stat((parser->installRoot() + pkgdir + "/" + "pre-install").c_str(),
|
||||||
&statData) == 0) {
|
&statData) == 0) {
|
||||||
Process preProc( runscriptCommand, parser->installRoot() + pkgdir
|
Process preProc( runscriptCommand, pkgdir + "/" + "pre-install", fdlog );
|
||||||
+ "/" + "pre-install", fdlog );
|
|
||||||
if (preProc.executeShell()) {
|
if (preProc.executeShell()) {
|
||||||
info.preState = FAILED;
|
info.preState = FAILED;
|
||||||
} else {
|
} else {
|
||||||
@ -425,8 +435,7 @@ InstallTransaction::installPackage( const Package* package,
|
|||||||
+ package->name() + "/" + "post-install").c_str(),
|
+ package->name() + "/" + "post-install").c_str(),
|
||||||
&statData) == 0) {
|
&statData) == 0) {
|
||||||
// Work around the pkgdir variable change
|
// Work around the pkgdir variable change
|
||||||
Process postProc( runscriptCommand,
|
Process postProc( runscriptCommand, package->path() + "/"
|
||||||
parser->installRoot() + "/" + package->path() + "/"
|
|
||||||
+ package->name() + "/post-install", fdlog );
|
+ package->name() + "/post-install", fdlog );
|
||||||
if (postProc.executeShell()) {
|
if (postProc.executeShell()) {
|
||||||
info.postState = FAILED;
|
info.postState = FAILED;
|
||||||
|
@ -69,6 +69,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
enum State {
|
enum State {
|
||||||
|
DEFERRED,
|
||||||
EXEC_SUCCESS,
|
EXEC_SUCCESS,
|
||||||
FAILED,
|
FAILED,
|
||||||
NONEXISTENT
|
NONEXISTENT
|
||||||
|
@ -289,8 +289,13 @@ void PrtGet::listShadowed()
|
|||||||
StringHelper::replaceAll(output, "%p2", p2->path() + "/" + p2->name());
|
StringHelper::replaceAll(output, "%p2", p2->path() + "/" + p2->name());
|
||||||
StringHelper::replaceAll(output, "%v1", p1->versionReleaseString());
|
StringHelper::replaceAll(output, "%v1", p1->versionReleaseString());
|
||||||
StringHelper::replaceAll(output, "%v2", p2->versionReleaseString());
|
StringHelper::replaceAll(output, "%v2", p2->versionReleaseString());
|
||||||
|
StringHelper::replaceAll(output, "%M1", p1->maintainer());
|
||||||
|
StringHelper::replaceAll(output, "%M2", p2->maintainer());
|
||||||
|
StringHelper::replaceAll(output, "%u1", p1->url());
|
||||||
|
StringHelper::replaceAll(output, "%u2", p2->url());
|
||||||
|
|
||||||
StringHelper::replaceAll(output, "\\n", "\n");
|
StringHelper::replaceAll(output, "\\n", "\n");
|
||||||
|
StringHelper::replaceAll(output, "\\t", "\t");
|
||||||
cout << output;
|
cout << output;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1190,20 +1195,21 @@ void PrtGet::evaluateResult( InstallTransaction& transaction,
|
|||||||
|
|
||||||
void PrtGet::reportPrePost(const InstallTransaction::InstallInfo& info) {
|
void PrtGet::reportPrePost(const InstallTransaction::InstallInfo& info) {
|
||||||
if (info.preState != InstallTransaction::NONEXISTENT) {
|
if (info.preState != InstallTransaction::NONEXISTENT) {
|
||||||
string preString = "failed";
|
string preString =
|
||||||
if (info.preState == InstallTransaction::EXEC_SUCCESS) {
|
(info.preState == InstallTransaction::FAILED) ? "failed" : "ok";
|
||||||
preString = "ok";
|
if (info.preState == InstallTransaction::DEFERRED) {
|
||||||
|
preString = "deferred";
|
||||||
}
|
}
|
||||||
cout << " [pre: " << preString << "]";
|
cout << " [pre: " << preString << "]";
|
||||||
}
|
}
|
||||||
if ( info.postState != InstallTransaction::NONEXISTENT) {
|
if ( info.postState != InstallTransaction::NONEXISTENT) {
|
||||||
string postString = "failed";
|
string postString =
|
||||||
if (info.postState == InstallTransaction::EXEC_SUCCESS){
|
(info.postState == InstallTransaction::FAILED) ? "failed" : "ok";
|
||||||
postString = "ok";
|
if (info.postState == InstallTransaction::DEFERRED) {
|
||||||
|
postString = "deferred";
|
||||||
}
|
}
|
||||||
cout << " [post: " << postString << "]";
|
cout << " [post: " << postString << "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! create a cache */
|
/*! create a cache */
|
||||||
|
Loading…
Reference in New Issue
Block a user