From 68239f077b8c6001be5c7601b00e32261f7c4ae4 Mon Sep 17 00:00:00 2001 From: John McQuah Date: Fri, 23 Jun 2023 11:46:46 -0400 Subject: [PATCH] support more format codes in the argument to 'dup' expand man-page to explain some asymmetries --- doc/prt-get.8 | 60 ++++++++++++++++++++++++++++++++++++-------------- src/prtget.cpp | 6 ++++- 2 files changed, 48 insertions(+), 18 deletions(-) diff --git a/doc/prt-get.8 b/doc/prt-get.8 index 809a094..0d0f6ae 100644 --- a/doc/prt-get.8 +++ b/doc/prt-get.8 @@ -78,7 +78,7 @@ non-option argument passed. This is very similar to .B install [\-\-margs] [\-\-aargs] [\-\-log] [\-\-nodeps] [\-\-softdeps] [ ...] Install or update the packages given on the command line. Note that you can do this from any directory. Pass the --nodeps flag to prevent \fBprt\-get\fP from -resolving dependencies and injecting any needed ports into the list of targets. +resolving dependencies and injecting any needed packages into the list of targets. Pass the --softdeps flag if you want the dependency resolver to also consider the "Optional" relationships among the packages given on the command line. @@ -236,15 +236,14 @@ order to show them all, add the --all switch. .SH "" .TP -.B dependent [\-\-softdeps] [\-\-all] -Print a list of ports which have +.B dependent [\-\-recursive] [\-\-softdeps] [\-\-all] +Print a list of ports whose "Depends on:" line contains .B -in their "Depends on:" line. Use the --softdeps flag to also search the -"Optional:" lines for \fB\fP. +(or its dependents, if --recursive is passed). Use the --softdeps flag to also +search the "Optional:" lines for \fB\fP . By default, output is restricted to ports that are installed. To see all the -dependencies, add the --all switch; use --recursive to get a recursive list -(without duplication), and --tree to get a nicely indented one. +dependencies, add the --all switch. Use --tree to get a nicely indented list. .TP .B dup [-v] [format] @@ -257,7 +256,8 @@ 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 combining these symbols in other ways. +You can customize the output by passing a different format string, whose +symbols will be replaced as follows. .TP \ \ \ \(bu @@ -279,6 +279,21 @@ You can customize the output by combining these symbols in other ways. \ \ \ \(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] @@ -292,7 +307,7 @@ for the list command. Make sure you escape where needed .TP .B printf [\-\-sort=] [\-\-filter=] -Print formatted port list format string can contain variables, which +Print formatted port list. Format string can contain variables, which are replaced like this: .TP \ \ \ \(bu @@ -408,15 +423,14 @@ Print out a listing of the port's directory .TP .B cat [] -Print out the file to stdout. If is not specified, 'Pkgfile' is used. -If set, uses $PAGER. +Print to stdout (or $PAGER, if set) the contents of in the port's +directory. If is not specified, 'Pkgfile' is used. .TP .B edit [] Edit the file using the editor specified in the $EDITOR environment variable. If is not specified, 'Pkgfile' is used. - .TP .B help Show a help screen @@ -495,7 +509,7 @@ Don't install these packages, even if they're listed as dependencies .TP .B \-\-nodeps -Leave the list of requested ports as-is, without sorting by dependencies +Leave the list of requested packages as-is, without sorting by dependencies or injecting missing dependencies. .TP @@ -510,7 +524,7 @@ Use cache file for this command .TP .B \-\-test -Dry run, don't actually install anything, mostly interesting for +Dry run, don't actually install anything. Mostly interesting for .B prt\-get install, prt\-get update, prt\-get sysup .TP @@ -523,7 +537,15 @@ Execute post-install script if it's there .TP .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=. (see below for the documentation of these options) .TP .B \-\-install\-root= @@ -552,7 +574,11 @@ install\fP command, or just copy the desired directives into .TP .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 .B \-\-no-std-config @@ -572,7 +598,7 @@ Set in configuration, overriding configuration file .TP .B \-\-config= -Use alternative configuration file to read ports directories from +Use to read configuration directives, rather than /etc/prt-get.conf. .SH "" diff --git a/src/prtget.cpp b/src/prtget.cpp index 9d633f2..e09dc0c 100644 --- a/src/prtget.cpp +++ b/src/prtget.cpp @@ -246,7 +246,7 @@ void PrtGet::listShadowed() { if (m_parser->otherArgs().size() > 0) format = *(m_parser->otherArgs().begin()); else if (m_parser->verbose() > 0) - format = "* %n\n %p1 %v1 preceeds over \n %p2 %v2\n"; + format = "* %n\n %p1 %v1 precedes over \n %p2 %v2\n"; string output; Package* p1; @@ -264,6 +264,10 @@ void PrtGet::listShadowed() { StringHelper::replaceAll(output, "%p2", p2->path() + "/" + p2->name()); StringHelper::replaceAll(output, "%v1", p1->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"); cout << output;