prt-auf: expand the documentation of --install-root

This commit is contained in:
John McQuah 2023-06-09 14:03:36 -04:00
parent a76248a9cb
commit 64a5505821
2 changed files with 23 additions and 10 deletions

View File

@ -432,15 +432,20 @@ be affected by the operation.
.TP
.B \-fr
Force rebuild, Implies 'pkgmk -f'; same as --margs=-f
Force rebuild. Implies 'pkgmk -f'; same as --margs=-f
.TP
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.
.TP
.B \-us
Update signature, implies 'pkgmk -us'; same as --margs=-us
Update signature. Implies 'pkgmk -us'; same as --margs=-us
.TP
.B \-is
Ignore signature, implies 'pkgmk -is'; same as --margs=-is
Ignore signature. Implies 'pkgmk -is'; same as --margs=-is
.TP
.B \-uf
@ -467,6 +472,13 @@ note that \-d is already passed to pkgmk anyway.
.B \-\-aargs="...", e.g. \-\-aargs="\-f"
Pass these additional arguments to pkgadd
.TP
.B \-\-install\-root="...", 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).
.TP
.B \-\-cache
Use cache file for this command
@ -491,7 +503,7 @@ Interpret filter and search pattern as regular expression
.SH "CONFIGURATION"
Most of the directives available in prt\-get.conf(5) are also recognized and
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 beginning with 'prtdir '.
You can also toggle the running of pre-/post-install scripts by editing the

View File

@ -213,9 +213,9 @@ sub parse_args {
} elsif ($arg eq "-fi") { $opkg{aargs} .= " -f";
} elsif ($arg =~ /^(-uf|-if|-us|-is|-ns|-kw)$/) { $opkg{margs} .= " $1";
} elsif ($arg =~ /^--margs=(.+)/) { $opkg{margs} .= $1;
} elsif (($arg =~ /^--install-root=(.+)$/) and (-d $1)) { $altroot=$1;
} elsif (($arg =~ /^--aargs=(-r|--root)=(.+)/) and (-d $2)) { $altroot=$2;
} elsif (($arg =~ /^--rargs=(-r|--root)=(.+)/) and (-d $2)) { $altroot=$2;
} elsif ($arg =~ /^--install-root=(.+)$/) { $altroot=$1;
} elsif ($arg =~ /^--aargs=(-r|--root)=(.+)/) { $altroot=$2;
} elsif ($arg =~ /^--rargs=(-r|--root)=(.+)/) { $altroot=$2;
} elsif ($arg =~ /^--aargs=(.+)/) { $opkg{aargs} .= " $1";
} elsif ($arg =~ /^--rargs=(.+)/) { $opkg{rargs} .= " $1";
} elsif ($arg =~ /^-/) {
@ -434,6 +434,7 @@ sub get_pkgfile_fields {
if (($Version =~ m/\$\(.*\)/) or ($Version =~ m/`.*`/)) {
open(ECHO,"-|","bash -c \'source $pkgfile; echo \$version\'");
while(<ECHO>) { chomp; $Version = $_; }
close(ECHO);
}
$Dependencies =~ s/, / /g; $Dependencies =~ s/,/ /g;
@ -764,7 +765,7 @@ sub up_inst { # returns scalar references to five arrays
$pvars{'%p'} = find_port_by_name($t,1,1,0); $pdirs{$t} = $pvars{'%p'};
$pvars{'%v'} = $1 if ( $V_REPO{$t} =~ m/(.+)-[0-9]+$/ );
$pvars{'%r'} = $1 if ( $V_REPO{$t} =~ m/-([0-9]+)$/ );
$builtpkg{$t} = ($PKG_DIR) ? "$PKG_DIR/$t#$pvars{'%v'}-$pvars{'%r'}.pkg.tar.$COMPRESSION" : "$pvars{'%p'}/$t#$pvars{'%v'}-$pvars{'%r'}.pkg.tar.$COMPRESSION";
$builtpkg{$t} = ($PKG_DIR ne "") ? "$PKG_DIR/$t#$pvars{'%v'}-$pvars{'%r'}.pkg.tar.$COMPRESSION" : "$pvars{'%p'}/$t#$pvars{'%v'}-$pvars{'%r'}.pkg.tar.$COMPRESSION";
$builtpkg{$t} =~ s/uuiName/$t/g;
$builtpkg{$t} =~ s/uuiVer/$pvars{'%v'}/g;
$builtpkg{$t} =~ s/uuiRel/$pvars{'%r'}/g;
@ -852,11 +853,11 @@ sub parse_pkgmk_conf {
my @pkgmkVars;
my $heredoc = "bash -c 'name=uuiName; version=uuiVer;";
$heredoc .= "release=uuiRel; source /etc/pkgmk.conf; ";
$heredoc .= "printf \"%s\\t%s\" \"\$PKGMK_PACKAGE_DIR\" ";
$heredoc .= "printf \"%s:%s\" \"\$PKGMK_PACKAGE_DIR\" ";
$heredoc .= "\$PKGMK_COMPRESSION_MODE;'";
open (CF,"-|",$heredoc) or return;
while (<CF>) { @pkgmkVars = split /\t/;
while (<CF>) { @pkgmkVars = split /:/;
} close (CF);
my $COMPRESSION = ($pkgmkVars[1] eq "") ? "gz" : $pkgmkVars[1];