prt-auf: respect the --run-scripts flag

update the man-page
This commit is contained in:
John McQuah 2023-06-22 17:40:16 -04:00
parent 801587943d
commit 9d4f22e6d1
2 changed files with 169 additions and 123 deletions

View File

@ -81,38 +81,65 @@ non-option argument passed. This is very similar to
\fBsubcommand\fP can be one of the following:
.TP
.B install [\-\-group] [\-fr] [\-\-margs=] [\-\-aargs=] <package1> [<package2> ...]
install/update all packages in the order given, without resolving
dependencies. Pass the --group flag to abort the operation if any
package fails. Pass the -fr flag to force a rebuild even if a package appears
up to date.
.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.
.TP
.B depinst [\-\-group] [\-fr] [\-\-softdeps] [\-\-margs=] [\-\-aargs=] <package1> [<package2> ...]
calculate the minimal set of packages needed to satisfy the dependencies of
packages passed on the command line, and then run \fBinstall\fP on the
resulting list. Pass the --softdeps flag if you want optional dependencies to
be considered when sorting the list of targets. The -fr flag (force rebuild)
only applies to packages explicitly given on the command line; the --group
flag applies to the entire set of targets calculated by the dependency
resolver.
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
.TP
.B update [\-\-group] [\-fr] [\-\-margs=] [\-\-aargs=] <package1> [<package2> ...]
.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.
.TP
.B remove [\-\-rargs=] <package1> [<package2> ...]
remove packages listed in this order. 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
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
.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.
you want. Even easier is to pass the --install-root option (see below).
.TP
.B sysup [\-\-group] [\-\-softdeps] [\-\-test]
@ -128,11 +155,11 @@ of targets.
.B lock <package1> [<package2>...]
Exempt these packages from any subsequent
.B sysup
operation (i.e., keep them at their currently-installed version)
operation (i.e., keep them at their currently-installed version).
.TP
.B unlock <package1> [<package2>...]
Remove lock from these packages
Remove lock from these packages.
.TP
.B listlocked
@ -140,31 +167,37 @@ List names of packages which are locked.
.TP
.B diff [\-\-all]
Show differences between installed packages and ports in the ports
tree. Locked packages are only displayed if you use the --all switch.
Show differences between installed packages and versions available in the
active repositories.
Locked packages are only displayed if you use the --all switch.
.TP
.B quickdiff
Print a simple list of packages which have a different version in the
ports tree than what is installed.
Print a simple list of packages whose installed version differs from the
version available in the repositories.
.TP
.B search [\-\-path] [\-\-regex] <expr>
Search the ports tree for
Search the repositories for ports that contain
.B expr
in their name
in their name.
.TP
.B dsearch [\-\-path] [\-\-regex] <expr>
Search the ports tree (both name and description) for the pattern
\fBexpr\fP. 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 this, consider using the cache functionality, so you only have to
spend this time once after updating the ports tree has been updated.
<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.
.TP
.B fsearch [\-\-path] [\-\-regex] <pattern>
Search the ports tree for file names that match \fBpattern\fP.
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 ""
@ -172,31 +205,28 @@ 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. The 'fsearch'
action looks for matches against the full path, not just the filename, so if
you're looking for a filename that begins with 'liblz', you should use
'\\/liblz' rather than '^liblz'.
globbing (with the * and ? wildcards) is \fINOT\fP supported.
.TP
.B info <port>
Print available info for a port
Print available info for a port.
.TP
.B path <port>
Print the path of a port
Print the path of a port.
.TP
.B readme <port>
Print the port's README file if it exists
Print the port's README file if it exists.
.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).
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).
.TP
.B depends [\-\-softdeps] <package1> [<package2> ...]
@ -241,16 +271,16 @@ occurred.
.TP
.B dependent [\-\-softdeps] [\-\-all] [\-\-recursive] [\-\-tree] <package>
Print a list of ports which have
Print a list of ports whose "Depends on:" line contains
.B <package>
in their "Depends on:" line. 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 --recursive to get a
recursive list (without duplication), and --tree to get a nicely indented one.
(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).
.TP
.B ls [--path] <port>
Print out a listing of the port's directory
Print out a listing of the port's directory.
.TP
.B cat <port> [<file>]
@ -412,14 +442,16 @@ Show the current version of prt\-auf
.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).
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).
.SH "OPTIONS"
@ -433,7 +465,7 @@ be affected by the operation.
.TP
.B \-fr
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
@ -474,58 +506,76 @@ Pass these additional arguments to pkgadd
.TP
.B \-\-install\-root=<dir>, e.g. \-\-install\-root="/mnt"
Specify a mountpoint other than "/", where the built packages are to be
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).
Beware of combining \fB\-\-install\-root\fP with the
directive 'runscripts yes' in the configuration file. One side-effect of
the naive attempt to reconcile this combination is that \fBprt\-auf\fP
copies the pre- or post-install scripts into the ports tree under <dir>,
before running a \fBchroot(1)\fP command to launch the scripts. This
workaround might inadvertently pollute <dir> with unwanted files, if the
mountpoint did not already contain a copy of the ports tree. It is safer
to set 'runscripts no' in the configuration file, whenever you plan to
use an alternate root for installations.
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>.
.TP
.B \-\-cache
Use cache file for this command
.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.
.SH ""
The following options affect the output of non-install (information-seeking) transactions.
The following options affect the output of non-install (information-seeking)
transactions.
.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.
(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.
.TP
.B \-\-path
Show path info for the ports found by a search or a dependency calculation
Show path info for the ports found by a search or a dependency calculation.
.TP
.B \-\-regex
Interpret filter and search pattern as regular expression
Interpret filter and search pattern as regular expression.
.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 beginning with 'prtdir '.
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, and
/usr/bin/pkgrm ) by editing the lines for 'makecommand', 'addcommand',
and 'removecommand', 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.
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.
.SH "TECHNICAL DETAILS"
@ -548,7 +598,7 @@ 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
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).

View File

@ -19,9 +19,10 @@ my @allports; my %V_REPO; my %V_INST; my %DESC; my %DEPENDS; my %SOFTDEPS;
my @results; my $strf; my $ind; my $hh; my $portpath; my $built_pkg;
my %osearch = ( cache=>0, regex=>0, path=>0, exact=>0, verbose=>0 );
my %odepends = ( inject=>1, soft=>0, tree=>0, recursive=>0, all=>0 );
my %opkg = ( margs=>"", aargs=>"", rargs=>"", runscripts=>"yes", nolock=>0,
makecommand=>"/usr/bin/pkgmk", addcommand=>"/usr/bin/pkgadd",
removecommand=>"/usr/bin/pkgrm", test=>"no", group=>"no" );
my %opkg = ( margs=>"", aargs=>"", rargs=>"", run_scripts=>"no",
pre_install=>"no", post_install=>"no", scriptcommand=>"/bin/sh",
removecommand=>"/usr/bin/pkgrm", addcommand=>"/usr/bin/pkgadd",
makecommand=>"/usr/bin/pkgmk", nolock=>0, test=>"no", group=>"no" );
my %olog = ( write => "disabled", mode => "overwrite", rm_on_success => "yes",
file => "/var/log/pkgbuild/%n.log" );
my $prtconf = "/etc/prt-get.conf";
@ -100,7 +101,7 @@ if (($action =~ /^(listinst|listorphans|dependent)/)
}
} elsif ($action =~ /^(fsearch)/) {
my %hits = %{$hh}; $strf = "%20s %s\n"; my @fmatch;
printf $strf, "Found in", "Matching File";
printf $strf, "Found in", "Matching File" if (%hits);
foreach my $fh (keys %hits) {
chomp($hits{$fh});
@fmatch = split /\s/, $hits{$fh};
@ -108,10 +109,11 @@ if (($action =~ /^(listinst|listorphans|dependent)/)
}
} elsif ($action =~ /^(current|isinst|dup|diff|quickdiff)$/) {
my $format = "%20s %15s %20s\n"; my $ind = shift(@results);
if ($action eq "diff") {
if ($#results > 0) {
printf $format, "Port", "Installed", "Available in Repo"
} else { print "No differences found\n" }
if (! @results) {
($action !~ /diff$/) or print "No differences found\n";
exit 0;
} elsif ($action eq "diff") {
printf $format, "Port", "Installed", "Available in Repo"
}
foreach (@results) {
if ($action =~ /^(current|isinst)$/) { print "$_\n"; next; }
@ -175,13 +177,11 @@ if (($action =~ /^(listinst|listorphans|dependent)/)
}
if (@ok_readme) {
print "Ports with README files:\n";
foreach (@ok_readme) { print " $_\n"; }
print "\n";
print join("\n ", @ok_readme);
}
if (@not_ok) {
print "Ports with pkgmk/pkgadd failures:\n";
foreach (@not_ok) { print " $_\n"; }
print "\n";
print join("\n ", @not_ok);
}
}
@ -217,6 +217,9 @@ while (my $arg = shift) {
} elsif ($arg eq "-vv") { $osearch{verbose} += 2;
} elsif ($arg eq "--test") { $opkg{test} = "yes";
} elsif ($arg eq "--group") { $opkg{group} = "yes";
} elsif ($arg eq "--pre-install") { $opkg{pre_install} = "yes";
} elsif ($arg eq "--post-install") { $opkg{post_install} = "yes";
} elsif ($arg eq "--run-scripts") { $opkg{run_scripts} = "yes";
} elsif ($arg eq "-fr") { $opkg{margs} .= " -f"; $odepends{inject} = 0;
} elsif ($arg eq "-fi") { $opkg{aargs} .= " -f";
} elsif ($arg =~ /^(-uf|-if|-us|-is|-ns|-kw)$/) { $opkg{margs} .= " $1";
@ -275,8 +278,9 @@ while (<PORTS>) { chomp;
}
}
}
$opkg{runscripts} = $1 if /^runscripts\s+(yes|no)/;
$opkg{makecommand} = $1 if /^makecommand\s+(.*)(#|$)/;
$opkg{run_scripts} = $1 if /^runscripts\s+(yes|no)/;
$opkg{scriptcommand} = $1 if /^runscriptcommand\s+(.*)(#|$)/;
$opkg{makecommand} = $1 if /^makecommand\s+(.*)(#|$)/;
$opkg{addcommand} = $1 if /^addcommand\s+(.*)(#|$)/;
$opkg{removecommand} = $1 if /^removecommand\s+(.*)(#|$)/;
$olog{write} = $1 if /^writelog\s+(enabled|disabled)/;
@ -312,6 +316,8 @@ sub find_dups {
$dupstr = "$format\n";
$dupstr =~
s/(%n|%p1|%v1|%u1|%M1|%p2|%v2|%u2|%M2)/$dupinfo[$subscripts{$1}]/g;
$dupstr =~ s/\\n/\n/g;
$dupstr =~ s/\\t/\t/g;
print $dupstr;
}
}
@ -372,8 +378,7 @@ sub printf_ports {
@pstats = get_pkgfile_fields($pp,"all");
$pstats[12] = ($LOCKED{$p}) ? "yes" : "no";
$pstats[13] = (grep /^$p$/, keys %V_INST) ? "yes" : "no";
$pstats[13] = "diff"
if (($pstats[13] eq "yes") and ($V_INST{$p} ne $V_REPO{$p}));
($pstats[13] eq "no") or ($V_INST{$p} eq $V_REPO{$p}) or $pstats[13] = "diff";
printf STDOUT $outputf, @pstats[@pos];
}
}
@ -383,9 +388,7 @@ sub fill_hashes_from_cache {
open (my $cf,$prtcache) or die "cannot use $prtcache as a cache!\n";
my $p; my $parent; my $deps; my $softDeps;
my $ignored=<$cf>; chomp($ignored);
if ($ignored ne "$cache_ver") {
die "incompatible cache format; regenerate by running $0 cache";
}
($ignored eq "$cache_ver") or die "incompatible cache format; regenerate by running $0 cache";
while (1) {
$p = <$cf>; last unless defined $p;
@ -585,12 +588,12 @@ sub list_ports {
} elsif ($subset =~ /^dep(endent|tree)/) {
our $direction = ($subset eq "deptree") ? "fwd" : "rev";
my $header = (($subset eq "deptree") and ($odepends{tree} == 1)) ?
"-- dependencies ([i] = installed, '-->' = already shown)\n":
"-- reverse dependencies ('-->' = already shown)\n";
"-- dependencies ([i] = installed, '-->' = already shown)":
"-- reverse dependencies ('-->' = already shown)";
if (($direction eq "fwd") and ($odepends{soft} == 1)) {
$header =~ s/installed,/installed, [s] = installed softdep,/;
}
print $header unless ($odepends{tree} == 0);
($odepends{tree} == 0) or print "$header\n";
our $indent=" "; our $height=0;
our $ind; our %seen; our @lineage; my @fosters=();
@ -743,6 +746,7 @@ sub up_inst { # returns scalar references to five arrays
my %mkcmd; my %addcmd; my $rs_cmd; my %logfile; my %pvars; my $status;
my %ok; my %not_ok; my %ok_pre; my %ok_post; my @ok_readme=();
my $PKGMK=$opkg{makecommand}; my $PKGADD=$opkg{addcommand};
my $SH=$opkg{scriptcommand};
# resolve dependencies unless --nodeps was given,
# but put glibc{,-32} at the front of the queue
@ -804,13 +808,9 @@ sub up_inst { # returns scalar references to five arrays
$ok{$t}=1;
next BUILDLOG;
}
if (($opkg{runscripts} eq "yes") and (-f "$pdirs{$t}/pre-install")) {
$rs_cmd="/bin/sh $pdirs{$t}/pre-install";
if ($altroot ne "") {
(-f "$altroot/$pdirs{$t}/pre-install") or
system("install -D $pdirs{$t}/pre-install $altroot/$pdirs{$t}/pre-install");
$rs_cmd = "chroot $altroot $rs_cmd";
}
if (("$opkg{run_scripts} $opkg{pre_install}" =~ /yes/) and (-f "$altroot$pdirs{$t}/pre-install")) {
$rs_cmd="$SH $pdirs{$t}/pre-install";
($altroot eq "") or $rs_cmd = "chroot $altroot $rs_cmd";
(system("$rs_cmd")==0) ? $ok_pre{$t} = 1 : delete $ok_pre{$t};
}
chdir("$pdirs{$t}") or $not_ok{$t} = 1;
@ -835,13 +835,9 @@ sub up_inst { # returns scalar references to five arrays
} elsif ( ($not_ok{$t}) and (-f "$builtpkg{$t}") ) {
rename("$builtpkg{$t}","$builtpkg{$t}.CHECKME");
}
if (($ok{$t}) and ($opkg{runscripts} eq "yes") and (-f "post-install")) {
$rs_cmd="/bin/sh post-install";
if ($altroot ne "") {
(-f "$altroot/$pdirs{$t}/post-install") or
system("install -D $pdirs{$t}/post-install $altroot/$pdirs{$t}/post-install");
$rs_cmd="chroot $altroot $rs_cmd";
}
if (($ok{$t}) and ("$opkg{run_scripts} $opkg{post_install}" =~ /yes/) and (-f "$altroot$pdirs{$t}/post-install")) {
$rs_cmd="$SH post-install";
($altroot eq "") or $rs_cmd="chroot $altroot $rs_cmd";
(system("$rs_cmd")==0) ? $ok_post{$t}=1 : delete $ok_post{$t};
}
last if (($opkg{group} eq "yes") and ($not_ok{$t}));