155N/A### this script contains archaic constructs that work with all sh variants ###
155N/A# package - source and binary package control
155N/A# Glenn Fowler <gsf@research.att.com>
155N/Acase $-:$BASH_VERSION in
155N/A*x*:[0123456789]*) : bash set -x is broken :; set +ex ;;
155N/A# ksh checks -- ksh between 2007-11-05 and 2011-11-11 conflict with new -lcmd -- wea culpa
155N/Acase $_AST_BIN_PACKAGE_:$SHELL:$0 in
155N/A _AST_BIN_PACKAGE_=1 # prevent non-interactive sh .rc referencing
bin/package recursion #
155N/A export _AST_BIN_PACKAGE_
155N/A then : no -lcmd conflict :
155N/A *" debug "*|*" DEBUG "*|*" show "*)
155N/A echo $command: $SHELL: warning: possible -lcmd conflict -- falling back to
/bin/sh >&2
155N/Asrc="cmd contrib etc lib"
155N/Amakefiles="Mamfile Nmakefile nmakefile Makefile makefile"
155N/Aenv="HOSTTYPE NPROC PACKAGEROOT INSTALLROOT PATH"
156N/Achecksum_commands="$checksum md5"
155N/Achecksum_empty="d41d8cd98f00b204e9800998ecf8427e"
155N/Apackage_use='=$HOSTTYPE=$PACKAGEROOT=$INSTALLROOT=$EXECROOT=$CC='
155N/APACKAGE_admin_tail_timeout=${PACKAGE_admin_tail_timeout:-"1m"}
155N/Aadmin_ditto="ditto --checksum --delete --verbose"
155N/Aadmin_ditto_update=--update
155N/Aadmin_ditto_skip="OFFICIAL|core|old|*.core|*.tmp|.nfs*"
155N/Aadmin_ping="ping -c 1 -w 5"
155N/AMAKESKIP=${MAKESKIP:-"*[-.]*"}
155N/Aall_types='*.*|sun4' # all but sun4 match *.*
155N/A@(#)$Id: package (AT&T Research) 2012-06-28 $
155N/A[+NAME?package - source and binary package control]
155N/A[+DESCRIPTION?The \bpackage\b command controls source and binary
155N/A packages. It is a \bsh\b(1) script coded for maximal portability. All
155N/A package files are in the \b$PACKAGEROOT\b directory tree.
155N/A \ahosttpe\a=`\bpackage\b`. All \aactions\a but \bhost\b and \buse\b
155N/A require the current directory to be under \b$PACKAGEROOT\b. See
155N/A \bDETAILS\b for more information.]
155N/A[+?Note that no environment variables need be set by the user;
155N/A \bpackage\b determines the environment based on the current working
155N/A directory. The \buse\b action starts a \bsh\b(1) with the environment
155N/A initialized. \bCC\b, \bCCFLAGS\b, \bHOSTTYPE\b and \bSHELL\b may be set
155N/A by explicit command argument assignments to override the defaults.]
155N/A[+?Packages are composed of components. Each component is built and
155N/A installed by an \bast\b \bnmake\b(1) makefile. Each package is also
155N/A described by an \bnmake\b makefile that lists its components and
155N/A provides a content description. The package makefile and component
155N/A makefiles provide all the information required to read, write, build
[+?Package recipients only need \bsh\b(1) and \bcc\b(1) to build and
install source packages, and \bsh\b to install binary packages.
\bnmake\b and \bksh93\b are required to write new packages. An
This script supplies a reasonable set of default options for compilers
[+?The command arguments are composed of a sequence of words: zero or
more \aqualifiers\a, one \aaction\a, and zero or more action-specific
\aarguments\a, and zero or more \aname=value\a definitions. \apackage\a
names a particular package. The naming scheme is a \b-\b separated
hierarchy; the leftmost parts describe ownership,
e.g.,
\bgnu-fileutils\b, \bast-base\b. If no packages are specified then all
packages are operated on. \boptget\b(3) documentation options are also
supported. The default with no arguments is \bhost type\b.]
[+authorize \aname\a?Remote authorization user name or license
[+debug|environment?Show environment and actions but do not
[+flat?Collapse \b$INSTALLROOT\b { bin fun include lib } onto
[+force?Force the action to override saved state.]
[+never?Run make -N and show other actions.]
[+only?Only operate on the specified packages.]
[+password \apassword\a?Remote authorization or license
[+quiet?Do not list captured action output.]
[+show?Run make -n and show other actions.]
[+verbose?Provide detailed action output.]
[+DEBUG?Trace the package script actions in detail.]
[+admin\b [\ball\b]] [\bdb\b \afile\a]] [\bon\b \apattern\a]][\aaction\a ...]]?Apply
\aaction\a ... to the hosts listed in \afile\a. If \afile\a is
omitted then \
badmin.db\b is assumed. The caller must have
\brcp\b(1) and \brsh\b(1) or \bscp\b(1) and \bssh\b(1) access
to the hosts. Output for \aaction\a is saved per-host in the
file \aaction\a\
b.log/\b\ahost\a. Logs can be viewed by
\bpackage admin\b [\bon\b \ahost\a]] \bresults\b [\aaction\a]].
By default only local PACKAGEROOT hosts are selected from
\afile\a; \ball\b selects all hosts. \bon\b \apattern\a selects
only hosts matching the \b|\b separated \apattern\a. \afile\a
contains four types of lines. Blank lines and lines beginning
with \b#\b are ignored. Lines starting with \aid\a=\avalue\a
are variable assignments. Set admin_ping to local conventions
if \"'$admin_ping$'\" fails. If a package list is not specified
on the command line the \aaction\a applies to all packages; a
variable assigment \bpackage\b=\"\alist\a\" applies \aaction\a
to the packages in \alist\a for subsequent hosts in \afile\a.
The remaining line type is a host description consisting of 6
tab separated fields. The first 3 are mandatory; the remaining
3 are updated by the \badmin\b action. \afile\a is saved in
\afile\a\
b.old\b before update. The fields are:]
[+hosttype?The host type as reported by
[+[user@]]host?The host name and optionally user name
for \brcp\b(1) and \brsh\b(1) access.]
[+[remote::[[master]]::]]]]PACKAGEROOT?The absolute remote package
root directory and optionally the remote protocol (rsh
or ssh) if the directory is on a different server than
the master package root directory. If
directory then it is sourced by \bsh\b(1) before
\aaction\a is done. If this field begins with \b-\b
then the host is ignored. If this field contains \b:\b
then \bditto\b(1) is used to sync the remote \bsrc\b
directory hierarchy to the local one. If [\amaster\a]]:
is specified then the sync is deferred to the \amaster\a
host. If \amaster\a is omitted (two :) then the sync is
disabled. These directories must exist on the remote side:
[+date?\aYYMMDD\a of the last action.]
[+time?Elapsed wall time for the last action.]
[+M T W?The \badmin\b action \bmake\b, \btest\b and
\bwrite\b action error counts. A non-numeric value in
any of these fields disables the corresponding action.]
[+owner?The owner contact information.]
[+attributes?\aname=value\a attributes. Should at least contain
\bcc\b=\acompiler-version\a.]
[+clean | clobber?Delete the \barch/\b\aHOSTTYPE\a hierarchy; this
deletes all generated files and directories for \aHOSTTYPE\a.
The heirarchy can be rebuilt by \bpackage make\b.]
[+contents\b [ \apackage\a ... ]]?List description and
components for \apackage\a on the standard output.]
[+copyright\b [ \apackage\a ... ]]?List the general copyright
notice(s) for \apackage\a on the standard output. Note that
individual components in \apackage\a may contain additional or
[+export\b [ \avariable\a ...]]?List \aname\a=\avalue\a for
\avariable\a, one per line. If the \bonly\b attribute is
specified then only the variable values are listed. If no
variables are specified then \b'$env$'\b are assumed.]
[+help\b [ \aaction\a ]]?Display help text on the standard
error (standard output for \aaction\a).]
[+host\b [ \aattribute\a ... ]]?List
standard output. \btype\b is listed if no attributes are
specified. Information is listed on a single line in
\aattribute\a order. The attributes are:]
[+canon \aname\a?An external host type name to be
converted to \bpackage\b syntax.]
[+cpu?The number of cpus; 1 if the host is not a
[+rating?The cpu rating in pseudo mips; the value is
useful useful only in comparisons with rating values of
other hosts. Other than a vax rating (mercifully) fixed
at 1, ratings can vary wildly but consistently from
vendor mips ratings. \bcc\b(1) may be required to
[+type?The host type, usually in the form
\avendor\a.\aarchitecture\a, with an optional trailing
-\aversion\a. The main theme is that type names within
a family of architectures are named in a similar,
predictable style. OS point release information is
avoided as much as possible, but vendor resistance to
release incompatibilities has for the most part been
[+html\b [ \aaction\a ]]?Display html help text on the standard
error (standard output for \aaction\a).]
[+install\b [ \aarchitecture\a ... ]] \adirectory\a [ \apackage\a ... ]]?Copy
the package binary hierarchy to \adirectory\a. If
\aarchitecture\a is omitted then all architectures are
installed. If \bflat\b is specified then exactly one
\aarchitecture\a must be specified; this architecture will be
installed in \adirectory\a without the \barch/\b\aHOSTTYPE\a
directory prefixes. Otherwise each architecture will be
installed in a separate \barch/\b\aHOSTTYPE\a subdirectory of
\adirectory\a. The \aarchitecture\a \b-\b names the current
architecture. \adirectory\a must be an existing directory. If
\apackage\a is omitted then all binary packages are installed.
This action requires \bnmake\b.]
[+license\b [ \apackage\a ... ]]?List the source license(s) for
\apackage\a on the standard output. Note that individual
components in \apackage\a may contain additional or replacement
[+list\b [ \apackage\a ... ]]?List the name, version and
prerequisites for \apackage\a on the standard output.]
[+make\b [ \apackage\a ]] [ \aoption\a ... ]] [ \atarget\a ... ]]?Build
and install. The default \atarget\a is \binstall\b, which makes
and installs \apackage\a. If the standard output is a terminal
then the output is also captured in
the \b$INSTALLROOT\b directory tree viewpathed on top of the
\b$PACKAGEROOT\b directory tree. If \bflat\b is specified then
the \b$INSTALLROOT\b { bin fun include lib } directories are
linked to the same directories in the package root. Only one
architecture may be \bflat\b. Leaf directory names matching the
\b|\b-separated shell pattern \b$MAKESKIP\b are ignored. The
\bview\b action is done before making. \aoption\a operands are
passed to the underlying make command.]
[+read\b [ \apackage\a ... | \aarchive\a ... ]]?Read the named
package or archive(s). Must be run from the package root
directory. Archives are searched for in \b.\b and
tracks the read time. See the \bwrite\b action for archive
naming conventions. Text file archive member are assumed to be
[+regress?\bdiff\b(1) the current and previous \bpackage test\b
[+release\b [ [\aCC\a]]\aYY-MM-DD\a [ [\acc\a]]\ayy-mm-dd\a ]]]] [ \apackage\a ]]?Display
recent changes for the date range [\aCC\a]]\aYY-MM-DD\a (up to
[\acc\a]]\ayy-mm-dd\a.), where \b-\b means lowest (or highest.)
If no dates are specified then changes for the last 4 months
are listed. \apackage\a may be a package or component name.]
[+remove\b [ \apackage\a ]]?Remove files installed for
[+results\b [ \bfailed\b ]] [ \bpath\b ]] [ \bold\b ]] [\bmake\b | \btest\b | \bwrite\b ]]?List
results and interesting messages captured by the most recent
\bmake\b (default), \btest\b or \bwrite\b action. \bold\b
specifies the previous results, if any (current and previous
results are retained.) \b$HOME/.pkgresults\b, if it exists,
must contain an \begrep\b(1) expression of result lines to be
ignored. \bfailed\b lists failures only and \bpath\b lists the
results file path name only.]
[+setup\b [ beta ]] [ binary ]] [ source ]] [ \aarchitecture\a ... ]] [ \aurl\a ]] [ \apackage\a ... ]]?This
action initializes the current directory as a package root, runs the
\bupdate\b action to download new or out of date packages, and runs the
\bread\b action on those packages. If \bflat\b is specified then the
\b$INSTALLROOT\b { bin fun include lib } directories are linked to the
same directories in the package root. Only one architecture may be
\bflat\b. See the \bupdate\b and \bread\b action descriptions for
[+test\b [ \apackage\a ]]?Run the regression tests for
\apackage\a. If the standard output is a terminal then the
output is also captured in
must be made before it can be tested. Components tested with
the \bregress\b(1) command require \bksh93\b. If \bonly\b is
also specified then only the listed package components are
tested, otherwise the closure of the components is tested.]
[+update\b [ beta ]] [ binary ]] [ source ]] [\aarchitecture\a ... ]] [ \aurl\a ]] [ \apackage\a ... ]]?Download
the latest release of the selected and required packages from \aurl\a
download these at your own risk. If \aarchitecture\a is omitted then
only architectures already present in the \btgz\b directory will be
downloaded. If \aarchitecture\a is \b-\b then all posted architectures
will be downloaded. If \aurl\a matches \b*.url\b then it is interpreted
as a file containing shell variable assignments for \burl\b,
\bauthorize\b and \bpassword\b. If \aurl\a is omitted then the
definitions for \burl\b, \bauthorize\b and \bpassword\b in
is initialized with the current \burl\b, \bauthorize\b and \bpassword\b
values and read permission for the current user only. If \apackage\a is
omitted then only packages already present in the tgz directory will be
downloaded. If \apackage\a is \b-\b then all posted packages will be
downloaded. If \bsource\b and \bbinary\b are omitted then both source
and binary packages will be downloaded. If \bonly\b is specified then
only the named packages are updated; otherwise the closure of required
packages is updated. This action requires \bwget\b(1), \blynx\b(1),
\bcurl\b(1) or a shell that supports io to
[+use\b [ \auid\a | \apackage\a | . [ 32 | 64 ]] | 32 | 64 | - ]] [ command ...]]?Run
\acommand\a, or an interactive shell if \acommand\a is omitted,
with the environment initialized for using the package (can you
say \ashared\a \alibrary\a or \adll\a without cussing?) If
\auid\a or \apackage\a or \a.\a is specified then it is used
to determine a \b$PACKAGEROOT\b, possibly different from
the current directory. For example, to try out bozo`s package:
\bpackage use bozo\b. The \buse\b action may be run from any
readable then it is sourced to initialize the environment. 32 or 64
implies \b$PACKAGEROOT\b of . and specifies the target architecture
word size (which may be silently ignored.)]
[+verify\b [ \apackage\a ]]?Verify installed binary files
against the checksum files in
files contain mode, user and group information. If the checksum
matches for a given file then the mode, user and group are
changed as necessary to match the checksum entry. A warning is
printed on the standard error for each mismatch. Requires the
\bast\b package \bcksum\b(1) command.]
[+view\b?Initialize the architecture specific viewpath
hierarchy. If \bflat\b is specified then the \b$INSTALLROOT\b {
bin fun include lib } directories are linked to the same
directories in the package root. Only one architecture may be
\bflat\b. The \bmake\b action implicitly calls this action.]
[+write\b [\aformat\a]] \atype\a ... [ \apackage\a ...]]?Write
a package archive for \apackage\a. All work is done in the
files are placed in the \aformat\a subdirectory. A
\apackage\a[.\atype\a]]\
b.tim\b file in this directory tracks
the write time and prevents a package from being read in the
same root it was written. If more than one file is generated
for a particular \aformat\a then those files are placed in the
\aformat\a/\apackage\a subdirectory. File names in the
\aformat\a subdirectory will contain the package name, a
\ayyyy-mm-dd\a date, and for binary packages, \aHOSTTYPE\a. If
\apackage\a is omitted then an ordered list of previously
written packages is generated. If \bonly\b is specified then
only the named packages will be written; otherwise prerequisite
packages are written first. Package components must be listed
in \apackage\a\
b.pkg\b. \aformat\a may be one of:]
[+cyg?Generate a \bcygwin\b package.]
[+exp?Generate an \bexptools\b maintainer source
archive and \aNPD\a file, suitable for \bexpmake\b(1)]
[+lcl?Generate a package archive suitable for
restoration into the local source tree (
i.e., the
source is not annotated for licencing.)]
[+pkg?Generate a \bpkgmk\b(1) package suitable for
[+rpm?Generate an \brpm\b(1) package.]
[+tgz?Generate a \bgzip\b(1) \btar\b(1) package
archive. This is the default.]
[+tst?Generate a \btgz\b format package archive in the
\btst\b subdirectory. Version state files are not updated.]
[+?\btype\b specifies the package type which must be one of
\bsource\b, \bbinary\b or \bruntime\b. A source package
contains the source needed to build the corresponding binary
package. A binary package includes the libraries and headers
needed for compiling and linking against the public interfaces.
A runtime package contains the commands and required dynamic
[+?A package may be either a \bbase\b or \bdelta\b. A base
package contains a complete copy of all components. A delta
package contains only changes from a previous base package.
Delta recipients must have the \bast\b \bpax\b(1) command (in
the \bast-base\b package.) If neither \bbase\b nor \bdelta\b is
specified, then the current base is overwritten if there are no
deltas referring to the current base. Only the \btgz\b and
\blcl\b formats support \bdelta\b. If \bbase\b is specified
then a new base and two delta archives are generated: one delta
to generate the new base from the old, and one delta to
generate the old base from the new; the old base is then
removed. If \bdelta\b is specified then a new delta referring
to the current base is written.]
[+?\apackage\a\
b.pkg\b may reference other packages. By default
a pointer to those packages is written. The recipient \bpackage
read\b will then check that all required packages have been
downloaded. If \bclosure\b is specified then the components for
all package references are included in the generated package.
This may be useful for \blcl\b and versioning.]
[+?All formats but \blcl\b annotate each \bsource\b file (not
already annotated) with a license comment as it is written to
the package archive using \bproto\b(1).]
[+DETAILS?The package directory hierarchy is rooted at
\b$PACKAGEROOT\b. All source and binaries reside under this tree. A two
level viewpath is used to separate source and binaries. The top view is
architecture specific, the bottom view is shared source. All building
is done in the architecture specific view; no source view files are
intentionally changed. This means that many different binary
architectures can be made from a single copy of the source.]
[+?Independent \b$PACKAGEROOT\b hierarchies can be combined by
appending \b$INSTALLROOT:$PACKAGEROOT\b pairs to \bVPATH\b. The
\bVPATH\b viewing order is from left to right. Each \b$PACKAGEROOT\b
[+?Each package contains one or more components. Component source for
naming is for convenience only; the underlying makefiles handle
inter-component build order. The \bINIT\b component, which contains
generic package support files, is always made first, then the
components named \bINIT\b*, then the component order determined by the
closure of component makefile dependencies.]
package naming convention is \agroup\a[-\apart\a]];
e.g., \bast-base\b,
\bgnu-fileutils\b. The *\
b.pkg\b files are ast \bnmake\b(1) makefiles
that contain the package name, package components, references to other
packages, and a short package description. *\
b.pkg\b files are used by
\bpackage write\b to generate new source and binary packages.]
information that is used by the \bast\b \bproto\b(1) and \bnmake\b(1)
commands to generate source and binary license strings. \agroup\a is
determined by the first \b:PACKAGE:\b operator name listed in the
component \bnmake\b makefile. \agroup\a\
b.lic\b files are part of the
licensing documentation. Each component may have its own \bLICENSE\b file
that overrides the \agroup\a\
b.lic\b file. The full text of the licenses
consisting of \apackage version release\a \b1\b for the most recent
instance of \apackage\a read into \b$PACKAGEROOT\b, where \apackage\a
is the package name, \aversion\a is the \aYYYY-MM-DD\a base version,
and \arelease\a is \aversion\a for the base release or \aYYYY-MM-DD\a
for delta releases. \apackage\a\
b.req\b contains *\
b.ver\b entries for
the packages required by \apackage\a, except that the fourth field is
\b0\b instead of \b1\b. All packages except \bINIT\b require the
\bINIT\b package. A simple sort of \apackage\a\
b.pkg\b and *\
b.ver\b
determines if the required package have been read in. Finally,
\apackage\a\
b.README\b and \apackage\a\
a.html\b contain the README text
for \apackage\a and all its components. Included are all changes added
to the component \bRELEASE\b, \bCHANGES\b or \bChangeLog\b files dated
since the two most recent base releases. Component \bRELEASE\b files
contain tag lines of the form [\aYY\a]]\aYY-MM-DD\a [ \atext\a ]] (or
\bdate\b(1) format dates) followed by README text, in reverse
chronological order (newer entries at the top of the file.) \bpackage
release\b lists this information, and \bpackage contents ...\b lists
the descriptions and components.]
[+?\b$HOSTYPE\b names the current binary architecture and is determined
by the output of \bpackage\b (no arguments.) The \b$HOSTTYPE\b naming
scheme is used to separate incompatible executable and object formats.
All architecture specific binaries are placed under \b$INSTALLROOT\b
against \b$HOSTTYPE\b when making binaries; these are limited to
makefile compiler workarounds,
e.g., if \b$HOSTTYPE\b matches \bhp.*\b
then turn off the optimizer for these objects. All other architecture
dependent logic is handled either by the \bast\b \biffe\b(1) command or
by component specific configure scripts. Explicit \b$HOSTYPE\b
values matching *,*cc*[,-*,...]] optionally set the default \bCC\b and
\bCCFLAGS\b. This is handy for build farms that support different
compilers on the same architecture.]
[+?Each component contains an \bast\b \bnmake\b(1) makefile (either
\bNmakefile\b or \bMakefile\b) and a \bMAM\b (make abstract machine)
file (\bMamfile\b.) A Mamfile contains a portable makefile description
that is used by \bmamake\b(1) to simulate \bnmake\b. Currently there is
being built then \bmamake\b will suffice; if source or makefile
modifications are anticipated then \bnmake\b (in the \bast-base\b
package) should be used. Mamfiles are automatically generated by
[+?Most component C source is prototyped. If \b$CC\b (default value
\bcc\b) is not a prototyping C compiler then \bpackage make\b runs
Converted files are then viewpathed over the original source.
\bproto\b(1) converts an ANSI C subset to code that is compatible with
K&R, ANSI, and C++ dialects.]
[+?All scripts and commands under \b$PACKAGEROOT\b use \b$PATH\b
relative pathnames (via the \bast\b \bpathpath\b(3) function); there
are no imbedded absolute pathnames. This means that binaries generated
under \b$PACKAGEROOT\b may be copied to a different root; users need
only change their \b$PATH\b variable to reference the new installation
root \bbin\b directory. \bpackage install\b installs binary packages in
[ qualifier ... ] [ action ] [ arg ... ] [ n=v ... ]
[+SEE ALSO?\bautoconfig\b(1), \bcksum\b(1), \bexecrate\b(1), \bexpmake\b(1),
\bgzip\b(1), \bmake\b(1), \bmamake\b(1), \bnmake\b(1), \bpax\b(1),
\bpkgadd\b(1), \bpkgmk\b(1), \bproto\b(1), \bratz\b(1), \brpm\b(1),
\bsh\b(1), \btar\b(1), \boptget\b(3)]
while getopts -a $command "$USAGE" OPT
unset FIGNORE BINDIR DLLDIR ETCDIR FUNDIR INCLUDEDIR LIBDIR LOCALEDIR MANDIR SHAREDIR 2>
/dev/null || true
admin|clean|clobber|contents|copyright|export|host|install|license|list|make|read|regress|release|remove|results|setup|test|update|use|verify|view|write|TEST)
1) echo $command: $1: authorization user name argument expected >&2; exit 1 ;;
exec=echo make=echo show=echo
never) exec=echo noexec=-N
1) echo $command: $1: authorization password argument expected >&2; exit 1 ;;
show) exec=echo noexec=-n
PS4='+$LINENO:$SECONDS+ '
help|HELP|html|man|--[?m]*)
<TITLE>$2 package installation instructions</TITLE>
<BODY bgcolor=white link=teal vlink=dimgray>"
bH="<CENTER><H3><FONT face=courier color=red>"
eH='</FONT></H3></CENTER>'
bL='<P><TABLE cellpadding=0 cellspacing=2>'
bL2='<P><TABLE border=0 cellpadding=0 cellspacing=2>'
bT='<TR><TD align=right valign=top><B>'
bD='</B></TD><TD align=left>' eD='</TD></TR>'
${bH}Binary Package Installation Instructions${eH}
${bT}(1)${bD}Do not install packages as ${bI}
root/super-user${eI}. Although some components may
have setuid executables, few must be owned by ${bI}root${eI}. These are best
changed manually when the security implications are understood.${eD}
${bT}(2)${bD}Choose a package root directory and cd to it. This will be a local work
area for all packages.${eD}
${bT}(3)${bD}These instructions bypass the ${bI}click to download${eI} package links on the
download site. If you already clicked, or if your system does not have
${Mcurl}, ${Mhurl}, ${Mlynx} or ${Mwget} then use the alternate instructions
for (3),(4),(5) in plan ${bB}B${eB} below. Plan ${bB}B${eB} installs the ${Mhurl}
script which works with ksh and modern bash. The top level URL is:${bX}
${bT}(4)${bD}If the ${bB}
bin/package${eB} script does not exist then run:${bX}
(wget -O - \$url||curl -L \$url||hurl \$url) >
bin/package${bT}(5)${bD}Determine the list of package names you want from the download site, then
use the ${Mpackage} command to do the actual download:${bX}
bin/package authorize \"${bI}NAME${eI}\" password \"${bI}PASSWORD${eI}\" \\
setup binary \$URL ${bI}PACKAGE${eI} ...${eX}
(Refer to the ${bB}AUTHORIZATION${eB} paragraph on the main download page for
${bI}NAME${eI}/${bI}PASSWORD${eI} details.) This downloads the closure of the latest
binary package(s); covered and up-to-date packages are not downloaded again unless
${bB}package force ...${eB} is specified. Package content is verified using ${bB}${checksum}${eB}.
If the package root will contain only one architecture then you can install in ${bB}bin${eB} and
${bB}lib${eB} instead of ${bB}arch/${eB}${bI}HOSTTYPE${eI}${bB}/bin${eB} and ${bB}arch/${eB}${bI}HOSTTYPE${eI}${bB}/lib${eB} by running this
bin/package authorize \"${bI}NAME${eI}\" password \"${bI}PASSWORD${eI}\" \\
flat setup binary \$URL ${bB}PACKAGE${eB} ...${eX}
To update the same packages from the same URL run:${bX}
${bT}(6)${bD}The packaged binaries are position independent,
i.e., they do not
contain hard-coded paths. However, commands with related files, like
${Mfile} and ${Mnmake}, require the path of the bin directory to be
exported in ${bB}PATH${eb}.${eD}
${bT}(7)${bD}You can run the binaries directly from the package root, or you can
install them in a public root (requires the ${bI}AT${Camp}T${eI} ${Mnmake} command):${bX}
bin/package flat install ${bI}DIRECTORY PACKAGE${eI}${eX}
This will install in ${bI}DIRECTORY${eI}${bB}/bin${eB} and ${bI}DIRECTORY${eI}${bB}/lib${eB}. If you want to
preserve the ${bB}arch/${eB}${bI}HOSTTYPE${eI} hierarchy under ${bI}DIRECTORY${eI} then omit the
${bB}flat${eB} argument. If you don't have ${Mnmake} then the following will do a
cp -p -r bin lib include ${bI}DIRECTORY${eI}${eX}${eD}
${bT}(8)${bD}To summarize, after the first time, the download cycle for the latest
${bH}Binary Package Installation Instructions -- Plan B${eH}
${bT}(3)${bD}Create the subdirectory ${bB}
lib/package/tgz${eB} and download all package archives
into that directory.${eD}
${bT}(4)${bD}If the ${bB}
bin/package${eB} script does not exist then manually read the ${bB}INIT${eB}
${TAR} ${TARFLAGS}f -${eX}
Note that some browsers automatically unzip downloaded without warning.
If your system does not have ${Mtar} or ${Mgunzip} then download the ${Mratz}
${bT}(5)${bD}Read all unread package archive(s):${bX}
Both source and binary packages will be read by this step.${eD}${eL}${eO}"
${bH}Package Hierarchy Details${eH}
The package directory hierarchy is rooted at ${bB}\$PACKAGEROOT${eB}. All source and
binaries reside under this tree. A two level viewpath is used to separate
source and binaries. The top view is architecture specific, the bottom view
is shared source. All building is done in the architecture specific view;
no source view files are intentionally changed. This means that many
different binary architectures can be made from a single copy of the source.
Each package contains one or more components. Component source for the ${bI}FOO${eI}
command is in ${bB}\$
PACKAGEROOT/src/cmd/${eB}${bI}FOO${eI}, and source for the ${bI}BAR${eI} library is
underlying makefiles handle inter-component build order. The ${bB}INIT${eB} component,
which contains generic package support files, is always made first, then the
components named ${bB}INIT${eB}*, then the order determined by the closure of component
convention is ${bI}GROUP${eI}[${bI}-PART${eI}];
e.g., ${bB}ast-base${eB}, ${bB}gnu-fileutils${eB}. The *${bB}.pkg${eB} files
are ${bB}ast${eB} ${Mnmake} makefiles that contain the package name, package components,
references to other packages, and a short package description. *${bB}.pkg${eB} files
are used by ${bF}package write${eF} to generate new source and binary packages.
is used by the ${bB}ast${eB} ${Mproto} and ${Mnmake} commands to generate source and
binary license strings. ${bI}GROUP${eI} is determined by the first ${bB}:PACKAGE:${eB} operator
name listed in the component ${bB}nmake${eB} makefile. ${bI}GROUP${eI}${bB}.lic${eB} files are part of the
licensing documentation. Each component may have its own ${bB}LICENSE${eB} file that
overrides the ${bI}GROUP${eI}${bB}.lic${eB} file. The full text of the licenses are in the
${bI}PACKAGE VERSION RELEASE${eI} 1${eX}
for the most recent instance of ${bI}PACKAGE${eI} read into ${bB}\$PACKAGEROOT${eB}, where
${bI}PACKAGE${eI} is the package name, ${bI}VERSION${eI} is the ${bI}YYYY-MM-DD${eI} base version,
and ${bI}RELEASE${eI} is ${bI}VERSION${eI} for the base release or ${bI}YYYY-MM-DD${eI} for delta releases.
${bI}PACKAGE${eI}${bB}.req${eB} contains *${bB}.ver${eB} entries for the packages required by
${bI}PACKAGE${eI}, except that the fourth field is 0 instead of 1. All packages
except ${bB}INIT${eB} and ${Mratz} require the ${bB}INIT${eB} package. A simple sort of ${bI}PACKAGE${eI}${bB}.pkg${eB}
and *${bB}.ver${eB} determines if the required package have been read in. Finally,
${bI}PACKAGE${eI}${bB}.README${eB} contains the ${bB}README${eB} text for ${bI}PACKAGE${eI} and all its
components. Included are all changes added to the component ${bB}RELEASE${eB},
${bB}CHANGES${eB} or ${bB}ChangeLog${eB} files dated since the two most recent base
releases. Component ${bB}RELEASE${eB} files contain tag lines of the form
[${bI}CC${eI}]${bI}YY-MM-DD${eI} [ ${bI}TEXT${eI} ] (or ${Mdate} format dates) followed by README
text, in reverse chronological order (newer entries at the top of the
file.) ${bF}package release${eF} generates this information, and
${bF}package contents ...${eF} lists the descriptions and components.
${bB}\$HOSTYPE${eB} names the current binary architecture and is determined by the
output of ${bF}package${eF} (no arguments.) The ${bB}\$HOSTTYPE${eB} naming scheme is used
to separate incompatible executable and object formats. All architecture
specific binaries are placed under ${bB}\$INSTALLROOT${eB} (${bB}\$
PACKAGEROOT/arch/\$HOSTTYPE${eB}.)
There are a few places that match against ${bB}\$HOSTTYPE${eB} when making binaries; these
are limited to makefile compiler workarounds,
e.g., if ${bB}\$HOSTTYPE${eB} matches
'hp.*' then turn off the optimizer for these objects. All other architecture
specific configure scripts. Explicit ${bB}\$HOSTYPE${eB} values matching *,*cc*[,-*,...]
optionally set the default ${bB}CC${eB} and ${bB}CCFLAGS${eB}. This is handy for build
farms that support different compilers on the same architecture.
Each component contains an ${bB}ast${eB} ${Mnmake} makefile (either ${bB}Nmakefile${eB} or ${bB}Makefile${eB})
and a ${bI}MAM${eI} (make abstract machine) file (${bB}Mamfile${eB}.) A Mamfile contains a portable
the binaries are just being built then ${bB}mamake${eB} will suffice; if source or
makefile modifications are anticipated then ${bB}nmake${eB} (from the ${bB}ast-open${eB} or
${bB}ast-base${eB} package) should be used. Mamfiles are automatically generated by
Most component C source is prototyped. If ${bB}\$CC${eB} (default value ${bB}cc${eB}) is not a
prototyping C compiler then ${bF}package make${eF} runs ${Mproto} on portions of the
${bB}\$
PACKAGEROOT/src${eB} tree and places the converted output files in the
original source. The ${bB}ast${eB} ${Mproto} command converts an ANSI C subset to code
that is compatible with K&R, ANSI, and C++ dialects.
All scripts and commands under ${bB}\$PACKAGEROOT${eB} use ${bB}\$PATH${eB} relative pathnames;
there are no imbedded absolute pathnames. This means that binaries generated
under ${bB}\$PACKAGEROOT${eB} may be copied to a different root; users need only change
their ${bB}\$PATH${eB} variable to reference the new instalation root bin directory.
${bF}package install${eF} installs binary packages in a new ${bB}\$INSTALLROOT${eB}.
${bH}Source Package Installation Instructions${eH}
${bT}(1)${bD}Do not install packages as ${bI}
root/super-user${eI}. Although some components may
have setuid executables, few must be owned by ${bI}root${eI}. These are best
changed manually when the security implications are understood.${eD}
${bT}(2)${bD}Choose a package root directory and cd to it. This will be a local work
${bT}(3)${bD}These instructions bypass the ${bI}click to download${eI} package links on the
download site. If you already clicked, or if your system does not have
${Mcurl}, ${Mhurl}, ${Mlynx} or ${Mwget} then use the alternate instructions
for (3),(4),(5) in plan ${bB}B${eB} below. Plan ${bB}B${eB} installs the ${Mhurl}
script which works with ksh and modern bash. The top level URL is:${bX}
${bT}(4)${bD}If the ${bB}
bin/package${eB} script does not exist then run:${bX}
(wget -O - \$url||curl -L \$url||hurl \$url) >
bin/package${bT}(5)${bD}Determine the list of package names you want from the download site, then
use the ${Mpackage} command to do the actual download:${bX}
bin/package authorize \"${bI}NAME${eI}\" password \"${bI}PASSWORD${eI}\" \\
setup source \$URL ${bB}PACKAGE${eB} ...${eX}
(Refer to the ${bB}AUTHORIZATION${eB} paragraph on the main download page for
${bI}NAME${eI}/${bI}PASSWORD${eI} details.) This downloads the closure of the latest
source package(s); covered and up-to-date packages are not downloaded again unless
${bB}package force ...${eB} is specified. Package content is verified using ${bB}${checksum}${eB}.
If the package root will contain only one architecture then you can install in ${bB}bin${eB} and
${bB}lib${eB} instead of ${bB}arch/${eB}${bI}HOSTTYPE${eI}${bB}/bin${eB} and ${bB}arch/${eB}${bI}HOSTTYPE${eI}${bB}/lib${eB} by running this
bin/package authorize \"${bI}NAME${eI}\" password \"${bI}PASSWORD${eI}\" \\
flat setup source \$URL ${bB}PACKAGE${eB} ...${eX}
To update the same packages from the same URL run:${bX}
${bT}(6)${bD}Build and install; all generated files are placed under ${bB}arch/${eB}${bI}HOSTTYPE${eI}
(${bB}\$INSTALLROOT${eB}), where ${bI}HOSTTYPE${eI} is the output of ${bB}
bin/package${eB} (with no
arguments.) ${bI}name=value${eI} arguments are supported; ${bB}CC${eB} and ${bB}debug=1${eB} (compile
with -g instead of -O) are likely candidates. The output is written to
${bT}(7)${bD}List make results and interesting errors:${bX}
Run the regression tests:${bX}
List test results and errors:${bX}
${bT}(8)${bD}The generated binaries are position independent,
i.e., they do not
contain hard-coded paths. However, commands with related files, like
${Mfile} and ${Mnmake}, require the path of the bin directory to be
exported in ${bB}PATH${eb}.${eD}
${bT}(9)${bD}You can run the binaries directly from the package root, or you can
install them in a public root after you are satisfied with the make and
test actions (requires the ${bI}AT${Camp}T${eI} ${Mnmake} command):${bX}
bin/package flat install ${bI}DIRECTORY PACKAGE${eI}${eX}
This will install in ${bI}DIRECTORY${eI}${bB}/bin${eB} and ${bI}DIRECTORY${eI}${bB}/lib${eB}. If you want to
preserve the ${bB}arch/${eB}${bI}HOSTTYPE${eI} hierarchy under ${bI}DIRECTORY${eI} then omit the
${bB}flat${eB} argument. If you don't have ${Mnmake} then the following will do a
cp -p -r bin lib include ${bI}DIRECTORY${eI}${eX}${eD}
${bT}(10)${bD}To summarize, after the first time the download, build, and test cycle
for the latest source release is:${bX}
${bH}Source Package Installation Instructions -- Plan B${eH}
${bT}(3)${bD}Create the subdirectory ${bB}
lib/package/tgz${eB} and download all package archives
into that directory.${eD}
${bT}(4)${bD}If the ${bB}
bin/package${eB} script does not exist then manually read the ${bB}INIT${eB}
Note that some browsers automatically unzip downloaded without warning.
If your system does not have ${Mtar} or ${Mgunzip} then download the ${Mratz}
source package, compile it, and manually read the ${bB}INIT${eB}
${bT}(5)${bD}Read all unread package archive(s):${bX}
Both source and binary packages will be read by this step.${eD}${eL}${eO}"
*) echo "Usage: $command [ qualifier ... ] [ action ] [ arg ... ] [ n=v ... ]
The $command command controls source and binary packages. It must be run
within the package root directory tree. See \"$command help intro\" for
details. In the following, PACKAGE names either a package or a component
within a package; if omitted, all packages are operated on. The default
authorize NAME Remote authorization name or license acceptance phrase.
debug|environment Show environment and actions; do not execute.
flat Collapse \$INSTALLROOT { bin fun include lib } onto \$PACKAGEROOT.
force Force the action to override saved state.
never Run make -N; otherwise show other actions.
only Only operate on the specified packages.
password PASSWORD Remote authorization or license acceptance password.
quiet Do not list captured make and test action output.
show Run make -n; otherwise show other actions.
DEBUG Trace the package script actions in detail for debugging.
admin [ all ] [ db FILE ] [ on PATTERN ] [ action ... ]
Apply ACTION ... to the hosts listed in FILE. If FILE is
omitted then "
admin.db" is assumed. The caller must have rcp(1)
and rsh(1) or scp(1) and ssh(1) access to the hosts. Output
can be viewed by \"package admin [on HOST] results [ACTION]\".
By default only local PACKAGEROOT hosts are selected from FILE;
\"all\" selects all hosts. \"on PATTERN\" selects only
hosts matching the | separated PATTERN. FILE contains four
types of lines. Blank lines and lines beginning with # are
ignored. Lines starting with id=value are variable assignments.
Set admin_ping to local conventions if \"$admin_ping\" fails.
If a package list is not specified on the command line the
action applies to all packages; a variable assigment
package=list applies action to the packages in list for
subsequent hosts in FILE. The remaining line type is a host
description consisting of 6 tab separated fields. The first 3
are mandatory; the remaining 3 are updated by the admin action:
The host type as reported by package.
The host name and optionally user name for rcp(1)
[remote:[[master]:]]PACKAGEROOT
The absolute remote package root directory and
optionally the remote prorocol (rsh or ssh) if
the directory is on a different server than the
master package root directory. If
this directory then it is sourced by sh(1)
before ACTION is done. If this field begins with -
then the host is ignored. If this field contains
: then ditto(1) is used to sync the remote src
directory hierarchy to the local one. If [master]:
is specified then the sync is deferred to the
master host. If master is omitted (two :) then
the sync is disabled. These directories must exist
date YYMMDD of the last action.
date Elapsed wall time of the last action.
M T W The admin action make, test and write action error
counts. A non-numeric value in any of these fields
disables the corresponding action.
owner The owner contact information.
NAME=VALUE attributes. Should at least contain
files and directories for HOSTTYPE. The heirarchy can be rebuilt
List description and components for PACKAGE on the standard
copyright [ package ... ]
List the general copyright notice(s) for PACKAGE on the
standard output. Note that individual components in PACKAGE
may contain additional or replacement notices.
List NAME=VALUE for each VARIABLE, one per line. If the
\"only\" attribute is specified then only the variable
values are listed. If no variables are specified then
Display help text on the standard error [ standard output
host [ canon cpu name rating type ... ]
on the standard output. type is listed if no attributes are
specified. Information is listed on a single line in attributes
order. The attributes are:
canon The next argument is a host type name to be
converted to package syntax.
cpu The number of cpus; 1 if the host is not a
rating The cpu rating in pseudo mips; the value is useful
useful only in comparisons with rating values of
other hosts. Other than a vax rating fixed at 1,
ratings can vary wildly but consistently from
vendor mips ratings. cc(1) may be required to
type The host type, usually of the form
-version. The main theme is that type names within
a family of architectures are named in a similar,
predictable style. Os point release information is
avoided as much as possible, but vendor resistance
to release incompatibilities has for the most part
Display html help text on the standard error [ standard output
install [ ARCHITECTURE ... ] DIR [ PACKAGE ... ]
Copy the package binary hierarchy to DIR. If ARCHITECTURE is
omitted then all architectures are installed. If the \"flat\"
attribute is specified then exactly one ARCHITECTURE must be
specified; this architecture will be installed in DIR without
subdirectory of DIR. The ARCHITECTURE - names the current
architecture. DIR must be an existing directory. If PACKAGE
is omitted then all binary packages are installed. This action
List the source license(s) for PACKAGE on the standard output.
Note that individual components in PACKAGE may contain
additional or replacement licenses.
List the name, version and prerequisites for PACKAGE on the
make [ PACKAGE ] [ OPTION ... ] [ TARGET ... ]
Build and install. The default TARGET is install, which
makes and installs all packages. If the standard output
is a terminal then the output is also captured in
in the \$INSTALLROOT directory tree viewpathed on top of
the \$PACKAGEROOT directory tree. If \"flat\" is specified then
the \$INSTALLROOT { bin fun include lib } directories are
linked to the same directories in the package root. Only
one architecture may be flat. Leaf directory names matching
the |-separated shell pattern \$MAKESKIP are ignored. The
view action is done before making. OPTION operands are
passed to the underlying make command.
read [ package ... | archive ... ]
Read the named package archive(s). Must be run from the
package root directory. Archives are searched for in .
See the write action for archive naming conventions. Text
file archive member are assumed to be ASCII or UTF-8 encoded.
regress diff(1) the current and previous package test results.
release [ [CC]YY-MM-DD [ [cc]yy-mm-dd ] ] [ package ]
Display recent changes since [CC]YY-MM-DD (up to [cc]yy-mm-dd),
where - means lowest (or highest.) If no dates are specified
then changes for the last 4 months are listed. PACKAGE may
be a package or component name.
Remove files installed for PACKAGE.
results [ path ] [ old ] [ make | test ]
List results and interesting messages captured by the most
recent make (default), test or write action. old specifies the
previous results, if any (current and previous results are
retained.) $HOME/.pkgresults, if it exists, must contain an
egrep(1) expression of result lines to be ignored. failed lists
failures only and path lists the results file path only.
setup [ beta ] [ binary ] [ source ] [ ARCHITECTURE ... ] [ URL ] [ PACKAGE ... ]
The action initializes the current directory as a package root,
runs the update action to download new or out of date packages,
and runs the read action on those packages. If \"flat\" is
specified then the \$INSTALLROOT { bin fun include lib }
directories are linked to the same directories in the package
root. Only one architecture may be flat. See the update and
read actions for argument details.
Run the regression tests for PACKAGE. If the standard output
is a terminal then the output is also captured in
must be made before it can be tested. Components tested with
the \bregress\b(1) command require \bksh93\b. If only is
also specified then only the listed package components are
tested, otherwise the closure of the components is tested.
update [ beta ] [ binary ] [ source ] [ ARCHITECTURE ... ] [ URL ] [ PACKAGE ... ]
Download the latest release of the selected and required
download these at your own risk. If ARCHITECTURE is omitted
then only architectures already present in the tgz directory
will be downloaded. If ARCHITECTURE is - then all posted
architectures will be downloaded. If URL matches *.url then
it is interpreted as a file containing shell variable
assignments for url, authorize and password. If URL is
omitted then the definitions for url, authorize and password
not exist then it is initialized with the current url,
authorize and password values and read permission for the
current user only. If PACKAGE is omitted then only
packages already present in the tgz directory will be
downloaded. If PACKAGE is - then all posted packages will be
downloaded. If source and binary are omitted then both source
and binary packages will be downloaded. If \bonly\b is
specified then only the named packages are updated; otherwise
the closure of required packages is updated. This action
requires wget(1), lynx(1), curl(1) or a shell that supports
use [ uid | PACKAGE | . [ 32 | 64 ] | 32 | 64 | - ] [ COMMAND ... ]
Run COMMAND or an interactive shell if COMMAND is omitted, with
the environment initialized for using the package (can you say
shared library without cussing?) If uid or PACKAGE or . is
specified then it is used to determine a \$PACKAGEROOT,
possibly different from the current directory. For example, to
try out bozo's package: \"package use bozo\". In this case the
command may be run from any directory. If the file
sourced to initialize the environment. 32 or 64 implies
\$PACKAGEROOT of . and specifies the target architecture word
size (which may be silently ignored.)
Verify installed binary files against the checksum files in
mode, user and group information. If the checksum matches
for a given file then the mode, user and group are changed
as necessary to match the checksum entry. A warning is printed
on the standard error for each mismatch. Requires the ast
package cksum(1) command.
Initialize the architecture specific viewpath hierarchy. The
make action implicitly calls this action. If \"flat\" is specified
then the \$INSTALLROOT { bin fun include lib } directories are
linked to the same directories in the package root. Only one
architecture may be flat.
write [closure] [cyg|exp|lcl|pkg|rpm|tgz|tst] [base|delta]
[binary|runtime|source] PACKAGE
Write a package archive for PACKAGE. All work is done in the
are placed in the FORMAT subdirectory. A PACKAGE[.TYPE].tim
file in this directory tracksthe write time and prevents a
package from being read in the same root it was written. If
more than one file is generated for a particular FORMAT then
File names in the FORMAT subdirectory will contain the package
name, a YYYY-MM-DD date, and for binary packages, HOSTTYPE.
If PACKAGE is omitted then an ordered list of previously
written packages is generated. If \"only\" is specified then
only the named packages will be written; otherwise
prerequisite packages are written first. Package components
cyg generate a cygwin package
exp generate an exptools(1) maintainer source archive
and NPD file in the exp subdirectory, suitable for
expmake(1); support files are placed in the
lcl generate a package archive or delta in the lcl
subdirectory, suitable for restoration into the
primary source tree (no source licence annotation)
pkg generate a pkgmk(1) package, suitable for pkgadd(1)
rpm generate an rpm(1) package
tgz generate a gzip(1) tar(1) package archive; this is
tst generate tgz FORMAT package archive in the tst
subdirectory; version state files are not updated
The package type must be one of source, binary or runtime.
A source package contains the source needed to build the
corresponding binary package. A binary package includes the
libraries and headers needed for compiling and linking
against the public interfaces. A runtime package contains
the commands and required dynamic libraries. A package may
be either a base or delta. A base package contains a
complete copy of all components. A delta package contains
only changes from a previous base package. Delta recipients
must have the ast pax(1) command (in the ast-base package.)
If neither base nor delta is specified, then the current
base is overwritten if there are no deltas referring to the
current base. Only the tgz and lcl formats support delta.
If base is specified then a new base and two delta archives
are generated: one delta to generate the new base from the
old, and one delta to generate the old base from the new;
the old base is then removed. If delta is specified then a
new delta referring to the current base is written.
pointer to those packages is written. The recipient package
read will then check that all required packages have been
downloaded. If closure is specified then the components for
all package references are included in the generated
package. This may be useful for lcl and versioning. All
formats but lcl annotate each source file (not already
annotated) with a license comment as it is written to the
package archive using proto(1).
variable definition: typically CC=cc or CCFLAGS=-g."
*=*) set DEFAULT host type "$@"
*) echo "Usage: $command [ options ] [ qualifier ... ] [ action ] [ arg ... ] [ n=v ... ]" >&2
# gather HOSTTYPE *,* options
# ,*cc*,-*,... set CC and CCFLAGS
-*) case $assign_CCFLAGS in
?*) assign_CCFLAGS="$assign_CCFLAGS " ;;
assign_CCFLAGS="$assign_CCFLAGS$2"
# collect command line targets and definitions
case $_PACKAGE_HOSTTYPE_ in
?*) HOSTTYPE=$_PACKAGE_HOSTTYPE_
*=*) eval `echo ' ' "$i" | sed 's,^[ ]*\([^=]*\)=\(.*\),n=\1 v='\''\2'\'','`
assign_CCFLAGS="CCFLAGS=\"\$CCFLAGS\""
?*) KEEP_PACKAGEROOT=1 ;;
VPATH=*)eval USER_$n='$'v
makeflags="$makeflags --debug-symbols"
makeflags="$makeflags --strip-symbols"
*=*) assign="$assign $n='$v'"
*,*) hostopts $HOSTTYPE ;;
?*) assign="$assign $assign_CCFLAGS"
# grab action specific args
1) echo $command: $action: $1: db file argument expected >&2
1) echo $command: $action: $1: host pattern argument expected >&2
debug|environment|force|never|only|quiet|show|DEBUG)
setup) PACKAGEROOT=${PWD:-`pwd`}
# HOSTTYPE specific setup
*-64) HOSTTYPE=${HOSTTYPE%-64} ;;
*) HOSTTYPE=$HOSTTYPE-64 ;;
*/32) echo $command: cannot build $bit-bit on $wow $sys >&2; exit 2 ;;
$exec export A=$
P/arch/$HOSTTYPE
$exec export INSTALLROOT=$A
$exec export PACKAGEROOT=$P
then $exec export PACKAGE_ast=$INSTALLROOT
then $exec export PACKAGE_ast=${PWD%/*}
/ast/arch/$HOSTTYPE
':') $exec exec $SHELL ;;
*) $exec exec $SHELL -c "$@"
PACKAGEROOT=${PWD:-`pwd`}
# true if arg is a valid PACKAGEROOT
test -d $1/lib/$command -o -x $1/bin/$command
# true if arg is executable
executable() # [!] command
'!') test ! -x "$2" -a ! -x "$
2.exe"; return ;;
*) test -x "$1" -o -x "$
1.exe"; return ;;
# tangible proof of cygwin's disdain for unix (well, this and execrate)
# true if arg is executable command on $PATH
/*) if executable $_onpath_b
if executable "$_onpath_d/$_onpath_b"
then _onpath_=$_onpath_d/$_onpath_b
# true if no nmake or nmake not from AT&T or nmake too old
_nonmake_version=`( $1 -n -f - 'print $(MAKEVERSION:@/.*AT&T.* //:/-//G:@/.* .*/19960101/)' . ) <
/dev/null 2>
/dev/null || echo 19840919`
if test $_nonmake_version -lt 20001031
# determine local host attributes
hostinfo() # attribute ...
# LD_LIBRARY_PATH may be out of sync with PATH here
?*) for i in `echo $PACKAGE_PATH | $SED 's,:, ,g'`
*) echo "$command: $action: $info: unknown attribute" >&2
-) echo "$command: $action: canon: host type name expected" >&2
_hostinfo_="$_hostinfo_ $NPROC"
cpu=`grep -ic '^processor[ ][ ]*:[ ]*[0123456789]'
/proc/cpuinfo`
_hostinfo_="$_hostinfo_ $cpu"
hinv '^Processor [0123456789]' \
then case `$1 | grep -ic '^cpu '` in
1) cpu=`$1 | grep -ic '^ *[0123456789][0123456789]* '`
'/^[0123456789][0123456789]* .* Processors*$/' \
'/^[0123456789][0123456789]* .* physically available\.*$/' \
i=`$1 2>
/dev/null | $SED -e "${2}!d" -e "s${3}"`
trap 'rm -f $tmp.*' 0 1 2
printf("%d\n", pthread_num_processors_np());
_hostinfo_="$_hostinfo_ $cpu"
name) _name_=`hostname || uname -n || cat
/etc/whoami || echo local`
_hostinfo_="$_hostinfo_ $_name_"
rating) for rating in `grep -i ^bogomips
/proc/cpuinfo 2>
/dev/null | $SED -e 's,.*:[ ]*,,' -e 's,\(...*\)\..*,\1,' -e 's,\(\..\).*,\1,'`
trap 'rm -f $tmp.*' 0 1 2
register unsigned long i;
register unsigned long j;
register unsigned long k;
t = (unsigned long)time((time_t*)0);
for (j = 0; j < 50000; j++)
t = ((unsigned long)time((time_t*)0) - t) * 1000;
printf("[ k=%lu l=%lu m=%lu t=%lu ] ", k, l, m, t);
printf("%lu\n", ((l * m) / 10) / t);
_hostinfo_="$_hostinfo_ $rating"
cc) case $KEEP_HOSTTYPE:$HOSTTYPE in
0:?*) if test -d ${PACKAGEROOT:-.}/arch/$HOSTTYPE
1) _hostinfo_="$_hostinfo_ $HOSTTYPE"
/*) a=`$cc -dumpmachine $CCFLAGS 2>
/dev/null`
*.*-*) _hostinfo_="$_hostinfo_ $a"
*) _hostinfo_="$_hostinfo_ $a"
then a=`$i/$cc -dumpmachine $CCFLAGS 2>
/dev/null`
*) _hostinfo_="$_hostinfo_ $a"
then map="`grep -v '^#' $i/$f` $map"
# inconsistent -dumpmachine filtered here
a=`arch || uname -m || att uname -m || uname -s || att uname -s`
*[\ \ ]*) a=`echo $a | $SED "s/[ ]/-/g"` ;;
m=`mach || machine || uname -p || att uname -p`
*[\ \ ]*) m=`echo $m | $SED "s/[ ]/-/g"` ;;
x=`uname -a || att uname -a`
'') x="unknown $host unknown unknown unknown unknown unknown" ;;
expected=$1 host=$2 arch=$3 mach=$4 os=$5 sys=$6 rel=$7 ver=$8
2) host= mach= arch=$1 os=$2 sys= rel= ;;
*) host= mach=$2 arch=$1 os=$3 sys= rel= ;;
[abcdefghijklmnopqrstuvwxyz]*[0123456789])
eval `echo $os | $SED -e 's/^\([^0123456789.]*\)\.*\(.*\)/os=\1 rel=\2/'`
*) arch=$canon mach= os= sys= rel=
*.*) host=`echo $host | $SED -e 's/\..*//'` ;;
[Rr][0123][0123456789][0123456789][0123456789])
[Rr][4][0123456789][0123456789][0123456789])
[Rr][56789][0123456789][0123456789][0123456789]|[Rr][123456789][0123456789][0123456789][0123456789][0123456789])
[Pp][Oo][Ww][Ee][Rr][Pp][Cc])
34[0123456789][0123456789])
/NextDeveloper -d next - \
*/*) type=hp.`echo $arch | $SED 's,/,_,g'`
set xx `hinv | $SED -e '/^CPU:/!d' -e '
s/CPU:[ ]*\([^ ]*\)[ ]*\([^ ]*\).*/\1 \2/' -e q | $TR ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
r[0123][0123456789][0123456789][0123456789])
r[4][0123][0123456789][0123456789])
r[4][456789][0123456789][0123456789]|r[5][0123456789][0123456789][0123456789])
r[6789][0123456789][0123456789][0123456789]|r[123456789][0123456789][0123456789][0123456789][0123456789])
[01234].*|5.[012]|5.[012].*)
a=`strings $a <
/dev/null | $SED -e 's/[^abcdefghijklmnopqrstuvwxyz0123456789]/ /g' -e 's/[ ][ ]*/\'"$split"'/g' | $SED -e "/^${type}[0123456789]$/!d" -e "s/^${type}//" -e q`
4) a=`$cc -${type}3 2>&1`
*unknown*|*install*|*conflict*)
a=`$cc -show F0oB@r.c 2>&1`
[!2]:*[Oo]32*) abi=-o32 ;;
[!3]:*[Nn]32*) abi=-n32 ;;
v=`echo $rel | $SED -e 's/^[25]\.//' -e 's/\.[^.]*$//'`
[Ss]un*)type=`echo $arch | $SED -e 's/\(sun.\).*/\1/'`
v=`echo $rel | $SED -e 's/^[25]\.//' -e 's/\.[^.]*$//'`
[Uu][Nn][Ii][Xx]_[Ss][Vv])
*.*|*[0123456789]*86|*68*)
*[0123456789]*86|*68*|mips)
*[0123456789][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]*)
mach=`echo $mach | $SED -e 's/[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]*$//'`
*) type=`echo $os | $SED -e 's/[0123456789].*//' -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_0123456789.].*//'`
[Cc][Yy][Gg][Ww][Ii][Nn]_*)
[Uu][Ww][Ii][Nn]*|[Ww]indows_[0123456789][0123456789]|[Ww]indows_[Nn][Tt])
arch=`echo $arch | $SED -e 's/_[^_]*$//'`
[abcdefghijklmnopqrstuvwxyz]*[0123456789])
[abcdefghijklmnopqrstuvwxyz]*) case $mach in
*[-_]32|*[-_]64|*[-_]128)
bits=`echo $type | $SED 's,.*[-_],,'`
type=`echo $type | $SED 's,[-_][0-9]*$,,'`
type=`echo $type | $SED -e 's%[-+/].*%%' | $TR ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
*.*) lhs=`echo $type | $SED -e 's/\..*//'`
rhs=`echo $type | $SED -e 's/.*\.//'`
[x0123456789]*86) rhs=i$rhs ;;
i[x23456789]86|i?[x23456789]86|*86pc)
s[0123456789]*[0123456789]x)
rhs=`echo $rhs | $SED -e 's/x$/-64/'` ;;
arm[abcdefghijklmnopqrstuvwxyz_][0123456789]*)
lhs=`echo ${lhs}XXX | $SED -e "s/${x}XXX//"`
[01234567].*) lhs=${lhs}7 ;;
[01234].*) lhs=${lhs}4 ;;
[123456789]*.*) lhs=${lhs}`echo $rel | $SED -e 's/\..*//'` ;;
trap 'rm -f $tmp.*' 0 1 2
int main() { return b(); }
then for i in -n32 -o32 -64
then type=`echo $type | $SED -e 's/.$//'`$i
trap 'rm -f $tmp.*' 0 1 2
_hostinfo_="$_hostinfo_ $type"
# restore the global state
# CC: compiler base name name
# cc: full path, empty if not found
make|test) note "$CC: not found"; exit 1 ;;
*) note "warning: $CC: not found" ;;
# some actions have their own PACKAGEROOT or kick out early
host) eval u=$package_use
1) : accept the current package use environment
case $KEEP_PACKAGEROOT in
echo) exec=echo make=echo show=echo ;;
else for i in `echo $HOME | sed -e 's,/[^/]*$,,'` $usr $use
'') PACKAGEROOT=${PWD:-`pwd`} ;;
# . must be within the PACKAGEROOT tree
$show PACKAGEROOT=$PACKAGEROOT
# initialize the architecture environment
1) _PACKAGE_HOSTTYPE_=$HOSTTYPE
export _PACKAGE_HOSTTYPE_
admin|install|make|read|remove|test|verify|view|write)
*) if test ! -d $INSTALLROOT
then INSTALLROOT=$PACKAGEROOT
$show INSTALLROOT=$INSTALLROOT
# check the basic package hierarchy
packageroot $PACKAGEROOT || {
echo "$command: $PACKAGEROOT: invalid package root directory" >&2
case $KEEP_HOSTTYPE:$hosttype in
0:?*) if test -d ${PACKAGEROOT:-.}/arch/$hosttype
else echo "$command: $hosttype: package root not found" >&2
*) packageroot $PACKAGEROOT || {
case $KEEP_PACKAGEROOT in
*) echo "$command: $PACKAGEROOT: must be in the package root directory tree" >&2
*) for i in arch arch/$HOSTTYPE
do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit
do test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit
# no $INITROOT means INIT already installed elsewhere
# update the basic package commands
for i in execrate ignore mamprobe silent
# check if $CC (full path $cc) is a cross compiler
$cc -o pkg$$.exe pkg$$.c > pkg$$.e 2>&1 || {
if $cc -Dnew=old -o pkg$$.exe pkg$$.c >
/dev/null 2>&1
then echo "$command: ${warn}$CC: must be a C compiler (not C++)" >&2
echo "$command: ${warn}$CC: failed to compile and link $
INITROOT/hello.c -- is it a C compiler?" >&2
0) # dll hackery -- why is this so complicated?
if executable /lib32/$x || executable /lib64/$x
then case $INSTALLROOT in
u=`echo $INSTALLROOT | sed -e 's,-[^-/]*$,,' -e 's,.$,,'`
for a in "n=2 v= l=" "n=3 v=N32 l=lib32" "n=4-n32 v=N32 l=lib32" "n=4 v=64 l=lib64"
N32) case $n:$HOSTTYPE in
?*) if executable ! /$l/$x
abi="$abi 'd=$INSTALLROOT v=$v'"
then abi="$abi 'd=$u$n v=$v'"
'') abi="'d=$INSTALLROOT v='" ;;
case \\\$LD_LIBRARY\${v}_PATH: in
*) x=\\\$LD_LIBRARY\${v}_PATH
LD_LIBRARY\${v}_PATH=\$
d/lib\\\$x
export LD_LIBRARY\${v}_PATH
case :$LD_LIBRARY_PATH: in
then LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$d
1) $show LD_LIBRARY_PATH=$LD_LIBRARY_PATH
$show export LD_LIBRARY_PATH
$show SHLIB_PATH=$SHLIB_PATH
case $DYLD_LIBRARY_PATH: in
*) DYLD_LIBRARY_PATH=$
INSTALLROOT/lib${DYLD_LIBRARY_PATH:+:$DYLD_LIBRARY_PATH}
$show DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH
$show export DYLD_LIBRARY_PATH
$show _RLD_ROOT=$_RLD_ROOT
# NOTE: PACKAGEROOT==INSTALLROOT is possible for binary installations
*) for i in package proto nmake
then EXECROOT=`echo $_onpath_ | sed -e 's,//*[^/]*//*[^/]*$,,'`
EXECTYPE=`echo $EXECROOT | sed -e 's,.*/,,'`
echo "$command: $CC: seems to be a cross-compiler" >&2
echo "$command: set HOSTTYPE to something other than the native $EXECTYPE" >&2
# grab a decent default shell
0) executable "$SHELL" || SHELL=
?*) checksh $SHELL || SHELL= ;;
do if onpath $i && checksh $_onpath_
*/*ksh) if executable $KSH
# $SHELL must be
/bin/sh compatible
*) $SHELL -c 'trap "exit 0" 0; exit 1' 2>
/dev/null *) # catch (our own)
pipe/socket configuration mismatches
$SHELL -c "date | $SHELL -c 'read x'"
?*) USER_VPATH=$USER_VPATH:$i ;;
''|$PACKAGEROOT|$INSTALLROOT)
?*) USER_VPATH=$USER_VPATH:$i
USER_VPATH_CHAIN="$USER_VPATH_CHAIN $p $i"
# HOSTTYPE specific package profile
*) lose="$lose binmode" ;;
?*) echo "$command: $HOSTTYPE: export '$lose' in CYGWIN or languish in windows" >&2
VIEW_bin=$INSTALLROOT VIEW_src=$PACKAGEROOT VIEW_all="$INSTALLROOT $PACKAGEROOT"
if (vpath $INSTALLROOT $PACKAGEROOT $USER_VPATH_CHAIN) >
/dev/null 2>&1 &&
vpath $INSTALLROOT $PACKAGEROOT $USER_VPATH_CHAIN
then $show vpath $INSTALLROOT $PACKAGEROOT $USER_VPATH_CHAIN
else VPATH=$INSTALLROOT:$PACKAGEROOT$USER_VPATH
# return 0 if arg in src|bin|all view
view() # [test] [-|type] [src|bin|all] file
-[dfsx])_view_T_=$1; shift ;;
all) shift; _view_v_=$VIEW_all ;;
bin) shift; _view_v_=$VIEW_bin ;;
src) shift; _view_v_=$VIEW_src ;;
*) for _view_d_ in $_view_v_
do if test $_view_T_ $_view_d_/$1
?*) echo $command: $1: $_view_t_ not found >&2 ;;
# determine the package and targets
admin) case $admin_action in
results)action=$admin_action
'') target=$admin_args ;;
*) target="on $admin_on $admin_args" ;;
-|[0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789])
setup) # { update read } with optional (bin|fun|include|lib) symlinks
# flat option sets up { bin fun include lib } symlinks from
# $INSTALLROOT to $PACKAGEROOT
flat) flat=1 # backwards compatibility -- documentation dropped
packages=`$0 $global authorize "$authorize" password "$password" update setup $types $url "$@" PACKAGEROOT=$PACKAGEROOT`
?*) $0 $global read $packages PACKAGEROOT=$PACKAGEROOT
''|-) target="$target $package"
then package="$package $1"
else target="$target $package $1"
# flatten -- assumes symlink support
make|read|setup|update|use|view)
if test ! -d $INSTALLROOT
then $exec mkdir -p $INSTALLROOT || exit
for i in bin include lib fun man share
do if test ! -d $INSTALLROOT/../../$i
then $exec mkdir $INSTALLROOT/../../$i
if test ! -d $INSTALLROOT/$i
then if test ! -h $INSTALLROOT/$i
then $exec ln -s ../../$i $INSTALLROOT/$i
elif test ! -h $INSTALLROOT/$i
then for x in $INSTALLROOT/$i/.[a-z]* $INSTALLROOT/$i/*
do if test -f $x -o -d $x
then if test ! -d $INSTALLROOT/$i/$x || test ! -d $INSTALLROOT/../../$i/$x
then $exec mv $x $INSTALLROOT/../../$i
$exec rm -rf $INSTALLROOT/$i
$exec ln -s ../../$i $INSTALLROOT/$i
# check that cmd args are up to date
a.out's
int main() { int new = 0; printf("hello world\n"); return new;}
* small test for prototyping cc
int main(int argc, char** argv) { return argc || argv; }
echo "$command: $i: command not found" >&2
echo "$command: $INITROOT: INIT package source not found" >&2
# check for prototyping cc
# NOTE:
proto.c must be K&R compatible
checkaout proto || return
find $dirs -name '*.[CcHh]' $newer -print | proto -v -L - -C proto
$exec "find $dirs -name '*.[CcHh]' $newer -print | proto -L - -C proto"
if (vpath $INSTALLROOT - $INSTALLROOT $PROTOROOT $PROTOROOT $PACKAGEROOT) >
/dev/null 2>&1 &&
vpath $INSTALLROOT - $INSTALLROOT $PROTOROOT $PROTOROOT $PACKAGEROOT
then $show vpath $INSTALLROOT $PROTOROOT $PROTOROOT $PACKAGEROOT $USER_VPATH_CHAIN
else VPATH=$INSTALLROOT:$PROTOROOT:$PACKAGEROOT$USER_VPATH
do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || return
do eval j=\$_PACKAGE_AOUT_$i
'') eval _PACKAGE_AOUT_$i=1 ;;
if test -f $INITROOT/$
i.c : $k : compiler : source : binary :
*00) view - bin/$i && continue ;;
000) echo "$command: $i: not found: download the INIT package $HOSTTYPE binary to continue" >&2
010) echo "$command: $i: not found: set CC=C-compiler or download the INIT package $HOSTTYPE binary to continue" >&2
100) echo "$command: $i: not found: download the INIT package source or $HOSTTYPE binary to continue" >&2
1) echo "$command: $i: not found: make the local $EXECTYPE binary package before $HOSTTYPE" >&2
do test -d $PACKAGEROOT/$j || $exec mkdir $PACKAGEROOT/$j || return
if test '' != "$PROTOROOT" -a -f $INITPROTO/$
i.c test -f $
i.o && $exec rm -f $
i.o# check package requirements against received packages
requirements() # source|binary [ package ]
'') set "$@" $
d/gen/*.req
do p=`echo $i | sed -e 's,.*/,,' -e 's,\....$,,'`
*) echo "$command: $i: must read or write package" >&2
test 0 != "$#" && release=`sort -r "$@" | {
base) echo "$command: base package $p.$v or newer required" >&2 ;;
*) echo "$command: delta package $p.$v.$r or newer required" >&2 ;;
0) echo "$q" | sort | { read v r; read v r; echo $v; } ;;
?*) eval `echo $release | sed -e 's,\(.*\)-\(.*\)-\(.*\),yy=\1 mm=\2 dd=\3,'`
release="-f $release -r $count"
# write ordered package prerequisite list to the standard output
binary) _order_a_=.$HOSTTYPE ;;
for _order_v_ in $VIEW_all
then _order_p_="$_order_p_ $_order_f_"
then for _order_f_ in ratz INIT
then echo $_order_f_ $_order_f_
do view - src $_order_f_ && break
*) _order_f_=
lib/package/$_order_f_; view - src $_order_f_ && break ;;
echo "$command: $_order_f_: not a package" >&2
_order_p_=`echo $_order_f_ | sed -e 's,.*/,,' -e 's,\.pkg$,,'`
0) view -s - src $_order_t_/$_order_p_$
_order_a_.tim || continue ;;
echo $_order_p_ $_order_p_
0) view -s - src $_order_t_/$_order_i_$
_order_a_.tim || continue ;;
echo $_order_i_ $_order_i_; echo INIT $_order_i_; echo $_order_i_ $_order_p_
# generate the package component list in _components_
components() # [ package ]
INIT) case " $_components_ " in
*) _components_="$_components_ $p" ;;
case " $_components_ " in
*) _components_="$_components_ $1" ;;
then _components_="$_components_ $p"
else echo "$command: $p: package or component not found" >&2
# list main environment values
''|make)for __i__ in CC SHELL $env
do eval echo $__i__='$'$__i__
capture() # file command ...
test -d $d || $exec mkdir $d
note $action output captured in $o
s="$command: $action start at `date` in $INSTALLROOT"
0) trap "echo \"$command: $action done at \`date\`\" in $INSTALLROOT 2>&1 | \$TEE -a $o" 0 1 2 ;;
*) trap "echo \"$command: $action done at \`date\`\" in $INSTALLROOT >> $o" 0 1 2 ;;
package_install() # dest sum
sed -e '/ /!d' -e 's,[^ ]* ,,' -e 's, \(arch/[^/]*\)/, \1 ,' -e '/ arch\//!s,^[^ ]* [^ ]* [^ ]*,& .,' -e 's,/\([^ /]*\)$, \1,' $sum |
while read mode user group arch dir file
then $exec mkdir -p "$t" || exit
$exec cp -f "$f" "$t" || code=1
$exec chmod $mode "$t" || code=1
for _make_recurse_j in $makefiles
do if view - $1/$_make_recurse_j
'') echo :MAKE: > $1/Makefile || exit ;;
*) $exec "echo :MAKE: > $1/Makefile" ;;
get() # host path [ file size ]
AUTHORIZE="User-Agent: package AT&T Research\\r\\n"
.:?*) AUTHORIZE="${AUTHORIZE}Authorization: Basic `print -n -r -- $authorize:$password | uuencode -h -x base64`\\r\\n" ;;
do eval "exec $getfd<>
/dev/tcp/$host/80" || exit
print "GET $path HTTP/1.0\\r\\nHost: $host\\r\\n$AUTHORIZE\\r" >&$getfd
got=`sed -e '1,/^.$/d' -e '/^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]/!d'
get.tmp`
got=`sed -e '/^Location: /!d' -e 's,^Location: \(.*\)://\([^/]*\)\(/.*\),prot='\''\1'\'' host='\''\2'\'' path='\''\3'\'','
get.tmp`
echo "$command: $action: $url: redirect error" >&2
echo "$command: $action: $url: $got" >&2
got=`grep '^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]'
get.tmp 2>
/dev/null`
got=`grep '^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]'
get.tmp`
got=`grep '^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]'
get.tmp`
got=`grep '^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]'
get.tmp 2>
/dev/null`
*) echo $command: $action: $HURL: url get command not found >&2
*[Aa][Uu][Tt][Hh][Oo][Rr][Ii][SsZz]*|*[Dd][Ee][Nn][Ii][Ee][Dd]*)
echo $command: $action: authorization required -- see $url for license acceptance authorization name and password >&2
echo $command: $action: $2: download failed >&2
'') echo "$3 ($4 bytes):" >&2
.) eval "exec $getfd<>
/dev/tcp/$1/80" || exit
print "GET $path HTTP/1.0\\r\\nHost: $host\\r\\n$AUTHORIZE\\r" >&$getfd
*) echo $command: $action: $HURL: url get command not found >&2
*[Aa][Uu][Tt][Hh][Oo][Rr][Ii][SsZz]*|*[Dd][Ee][Nn][Ii][Ee][Dd]*)
echo $command: $action: authorization required -- see $url for license acceptance authorization name and password >&2
echo $command: $action: $3: download failed >&2
echo $command: $3: download error: expected $4 bytes, got $z >&2
*) z=`$checksum <
get.tmp | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'`
echo $command: $3: download $checksum error: expected $5, got $z >&2
*) echo "$3 ($4 bytes)" >&2
# generate copyright notice
then echo $1 package general copyright notice
*-*) eval `echo '' $1 | sed 's/\([^-]*\)-\(.*\)/__j__="\1" __i__="\2"/'`
if copyright $__i__ || copyright $__j__
# run remote make on host
remote() # host no-exec-background
eval name=\$${host}_name user=\$${host}_user snarf=\$${host}_snarf type=\$${host}_type rsh=\$${host}_rsh root=\$${host}_root keep=\$${host}_keep log=\$${host}_log
'') exec > $admin_log/$log 2>&1 ;;
*) echo "exec > $admin_log/$log 2>&1" ;;
*) cmd="$cmd && cd $root"
cmd="$cmd && { test -f
lib/package/admin/$admin_env && . .
/lib/package/admin/$admin_env || true ;} && PATH=\${PWD:-\`pwd\`}/bin:\$PATH \${SHELL:-
/bin/sh} -c 'package $admin_args PACKAGEROOT=\${PWD:-\`pwd\`} HOSTTYPE=$type VPATH='"
'') $exec $rsh $user$name "$cmd" $background
*?) rcp=`echo $rsh | sed 's/\(.\).*/\1/'`cp
$exec $rsh $user$name "$cmd"
else echo "$command: $user$name:${root}
lib/package/tgz/$lst: not found" >&2
?*) $exec "} $background" ;;
else echo "$command: $name: down" >&2
for _i_ in `cd $PACKAGESRC; ls *.def *.lic *.pkg 2>
/dev/null | sed 's/[-.].*//'`
do case " $package_src " in
*) package_src="$package_src $_i_"
# check for native ascii 0:yes 1:no
'') case `echo A | od -o | sed -e 's/[ ]*$//' -e '/[ ]/!d' -e 's/.*[ ]//'` in
005101|040412) __isascii__=0 ;;
admin) while test ! -f $admin_db
/*) echo $command: $action: $admin_db: data file not found >&2
admin_log=${admin_action}${admin_components}.log
test -d $admin_log || $exec mkdir $admin_log || exit
*" write binary "*|*" write "*" binary "*)
1) admin_args="only $admin_args" ;;
while read type host root date time make test write owner attributes
*=*) eval "$type $host $root $date $time $make $test $write $owner $attributes"
*[!0123456789]*) continue ;;
: type=$type host=$host root=$root date=$date time=$time make=$make test=$test write=$write :
host=`echo $name | sed 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789],__,g'`
eval h='$'${admin_host}${i}_name
$host) host=${admin_host}${i}
eval user='$'${host}_user root='$'${host}_rsh:$host:'$'${host}_root
*:$name:*)root=`echo '' $root | sed 's,:.*,:,'` ;;
*:*:*) index=`expr $index + 1`
*:*) case " $sync_hosts " in
*" $name ${admin_host}"*)
*) index=`expr $index + 1`
sync_hosts="$sync_hosts $name $host"
*) index=`expr $index + 1`
*) rsh=$1 sync=$2 root=$3
?*) case " $sync_hosts " in
*" $sync ${admin_host}"*)
*) index=`expr $index + 1`
sync_hosts="$sync_hosts $sync $x"
*) admin_out="$admin_out $name"
'') local_types="$local_types $type" ;;
$host) remote_hosts="$remote_hosts $host"
?*) eval ${sync}_share=\"\$${sync}_share $host\"
'') local_hosts="$local_hosts $host"
eval ${host}_name='$'name ${host}_type='$'type ${host}_user='$'user ${host}_sync='$'sync ${host}_snarf='$'sync ${host}_rsh='$'rsh ${host}_root='$'root ${host}_keep='$'keep ${host}_log='$'log
*) admin_pkgs="$admin_pkgs|$i" ;;
: "admin_binary :" $admin_binary
: "admin_args :" $admin_args
: "admin_pkgs :" $admin_pkgs
: "admin_on :" "$admin_on"
: "local_hosts :" $local_hosts
: "local_types :" $local_types
: "remote_hosts :" $remote_hosts
: "sync_hosts :" $sync_hosts
: "sync_share :" $sync_share
for main in $local_hosts $remote_hosts
do eval share=\$${main}_share keep=\$${main}_keep
do case " $admin_bin_hosts " in
case " $admin_bin_types " in
admin_bin_hosts="$admin_bin_hosts $host"
admin_bin_types="$admin_bin_types $type"
case " $admin_bin_hosts " in
*) case " $admin_bin_main " in
*) admin_bin_main="$admin_bin_main $main"
for host in $admin_bin_main $admin_bin_hosts
do case " $local_hosts " in
*) case " $remote_hosts " in
for host in $remote_hosts $local_hosts
do eval share=\$${host}_share
$oshare) eval ${host}_share="'$share'"
for host in $remote_hosts
do eval type=\$${host}_type
eval name=\$${host}_name keep=\$${host}_keep share=\$${host}_share
do eval type=\$${share}_type keep=\$keep\$${share}_keep
for host in $remote_hosts $local_hosts
do eval name=\$${host}_name user=\$${host}_user type=\$${host}_type sync=\$${host}_sync snarf=\$${host}_snarf share=\$${host}_share rsh=\$${host}_rsh root=\$${host}_root keep=\$${host}_keep
'') case $admin_action in
eval main_log='$'${host}_log
do eval n='$'${i}_name t='$'${i}_type q='$'${i}_sync s='$'${i}_snarf l='$'${i}_log k='$'${i}_keep
case " $admin_bin_hosts " in
*) share_keep="$share_keep $i" ;;
echo package "$admin_args" "[ $n $t ]"
*) $exec ": > $admin_log/$l" ;;
0) admin_ditto_update=--update ;;
*) admin_ditto_update= ;;
case $admin_binary:$sync in
:?*) eval syncname='$'${sync}_name
test -d $PACKAGESRC && $admin_ditto $admin_ditto_update --remote=$rsh --expr="if(level>1&&path!='LICENSES/*')status=SKIP;path=='LICENSES*|*.(pkg|lic|def)'" $PACKAGESRC $user$syncname:$
root/lib/package '') expr="--expr=if(name=='$admin_ditto_skip')status=SKIP" ;;
*) expr="--expr=if(name=='$admin_ditto_skip'||level==1&&name=='$MAKESKIP')status=SKIP" ;;
case $admin_binary:$sync in
:?*) eval syncname='$'${sync}_name
test -d $PACKAGESRC && echo $admin_ditto $admin_ditto_update --remote=$rsh --expr="if(level>1)status=SKIP;name=='*.(pkg|lic|def)'" $PACKAGESRC $user$syncname:$
root/lib/package '') expr="--expr=if(name=='$admin_ditto_skip')status=SKIP" ;;
*) expr="--expr=if(name=='$admin_ditto_skip'||level==1&&name=='$MAKESKIP')status=SKIP" ;;
echo "} <
/dev/null > $admin_log/$main_log 2>&1 &"
eval name='$'${main}_name
do eval keep=\$${share}_keep
1) eval name='$'${share}_name log='$'${share}_log
tail -t $PACKAGE_admin_tail_timeout -f $logs
# wait for the remote actions to complete
: ast date command assumed :
E=`eval date -E \`egrep '[ ](start|done)[ ][ ]*at[ ]' $admin_log/$2 | sed -e 's/.*[ ][ ]*at[ ][ ]*//' -e 's/[ ][ ]*in[ ].*$//' -e 's/.*/"&"/'\``
M=`egrep -c ']:.* (\*\*\*.* code|don'\''t know) | \*\*\* termination code ' $admin_log/$2` ;;
test) T=`grep -ci 'fail[es]' $admin_log/$2` ;;
*) W=`grep '^[abcdefghijklmnopqrstuvwxyz][abcdefghijklmnopqrstuvwxyz]*:.' $admin_log/$2 | egrep -cv 'start at|done at|output captured|warning:|: package not found|whence: command not found'` ;;
?|??|???|????|?????|??????|???????)
????????|?????????|??????????|???????????|????????????|?????????????|??????????????|???????????????)
?|??|???|????|?????|??????|???????)
?|??|???|????|?????|??????|???????)
echo "$A $H $R $D $E $M $T $W $O $K"
echo "$A $H $R $D $E $M $T $W $O $K" >&9
$exec rm -rf $INSTALLROOT
# all work in $PACKAGESRC
# generate the package list
echo $command: $action: no packages >&2
set '' `echo $* | sed 's,\.pkg,,g'`
echo packages in $PACKAGEROOT
echo "NAME${nl}VERSION${nl}RELEASE${nl}TYPE${nl}STATUS${nl}REQUIRES${nl}----${nl}-------${nl}-------${nl}----${nl}------${nl}--------" | pr -6 -a -o4 -t
then echo $command: $action: $pkg: not a package >&2
echo "$pkg${nl}$ver${nl}base${nl}$typ${nl}$sts${nl}$req"
echo $pkg $ver $req "$txt"
?*) echo "${sep}Components in this package:$nl"
echo "$cmp" | pr -4 -o4 -t ;;
# f:file p:package v:version r:release t:type u:update
for f in `find . -name '*?[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]*' -print | sed 's,^\./,,' | sort -r`
do eval `echo "$f" | sed -e 's,\.c$,,' -e 's,\.gz$,,' -e 's,\.exe$,,' -e 's,\.tgz$,,' -e 's,\([^_.]*\)[_.]\([0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]\)[_.]\([0123456789][0123456789][0123456789][0123456789][^_.]*\)[_.]*\(.*\),p=\1 v=\2 r=\3 t=\4,' -e 's,\([^_.]*\)[_.]\([0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]\)[_.]*\(.*\),p=\1 v=\2 r=base t=\3,'`
*:$p.$v.$r:*) continue ;;
echo "$p$nl$v$nl$r$nl$t$nl$s$nl"
list) pr -6 -a -o4 -t | sort -u ;;
echo architectures in $PACKAGEROOT
# all work in $PACKAGESRC
# generate the package list
0) set '' `echo *.lic | sed 's,\.lic,,g'`
'*') echo $command: $action: no packages >&2
export) case $INSTALLROOT in
0) echo "$command: at least one package name expected" >&2
flat) flat=1 # backwards compatibility -- documentation dropped
0) echo "$command: $action: target directory argument expected" >&2
then echo "$command: $action: $directory: target directory not found" >&2
if test "" = "$exec" -a ! -d $dest
echo "$command: $dest: destination directory must exist" >&2
elif test ! -d arch/$
a/bin then echo "$command: $a: invalid architecture" >&2
then echo "$command: $dest: destination directory must exist" >&2
else if test "" != "$makecheck"
else echo "$command: $MAKE: not found" >&2
echo "=== $i installation manifest ==="
VPATH=$INSTALLROOT:$PACKAGEROOT:$VPATH
VPATH=$INSTALLROOT:$PACKAGEROOT:$VPATH
) | sort -u | pax -drw -ps $dest
# generate the package list
'*') echo $command: $action: no licenses >&2
*) checkaout proto || exit
*-*) i=`echo $i | sed 's/-[^-]*$//'`
*) echo "$command: $i: package license not found" >&2
echo " --- $i source license ---"
*-*) lic="$lic
lib/package/"`echo $i | sed 's,-.*,,'`".lic" ;;
requirements source $package
# check for some required commands
*" yacc "*) have="$have bison" ;;
*" bison "*) have="$have yacc" ;;
echo "$command: $t: not found -- must be on PATH to $action" >&2
*) echo "$command: warning: $t: not found -- some $action actions may fail" >&2
then note no source packages to make
then note initialize the $INSTALLROOT view
for i in arch arch/$HOSTTYPE
do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit
do test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit
then test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit
for j in `cd $i; find . $o 2>
/dev/null | sed -e 's,^\./,,' -e '/\//!d' -e 's,/[^/]*$,,' | sort -u`
$k|$MAKESKIP) continue ;;
test -d $INSTALLROOT/$i/$j ||
$exec mkdir -p $INSTALLROOT/$i/$j || exit
do test -f $i || continue
$exec cp $PACKAGEROOT/$i $INSTALLROOT/$i
for j in `grep '^. .*\.def$' $i`
$exec cp $PACKAGEROOT/$i $INSTALLROOT/$i
# check $CC and { ar cc ld ldd } intercepts
h="${HOSTTYPE} ${HOSTTYPE}.*"
*.*) t=`echo $HOSTTYPE | sed 's/[.][^.]*//'`
t=`echo $t | sed 's/[0123456789]*$//'`
do for s in $INITROOT/$c.$k
do test -x "$s" || continue
eval '$'exec echo "'int main(){return 0;}' > $
tmp.c"
?*) $exec sed "s/^HOSTTYPE=.*/HOSTTYPE=$HOSTTYPE/" < "$s" > "$b" || exit
$exec chmod +x "$b" || exit
do for s in $INITROOT/$c.$k
do test -x "$s" || continue
# following code stubbed out just in case
ar.ibm.risc is needed
# test -x "$s" || continue
# $s*) x=`$s -tv
/foo/bar.a 2>&1 | egrep -i 'option|usage'`
*) echo "$command: $CC: not found -- set CC=C-compiler" >&2
echo 'int main(){return 0;}' > $
tmp.c else echo "$command: $CC: failed to compile this program:" >&2
else echo "$command: $CC: not a C compiler" >&2
# remember the default $CC
*) assign="$assign CC=\"\$CC\""
1) assign="$assign CC=\"\$CC\""
# no $INITROOT means INIT already installed elsewhere
do test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit
*) if test -f $j -a -f $k
?*) echo "$SHELLMAGIC" ;;
$exec chmod +x $i || exit
# initialize a few mamake related commands
checkaout mamake proto ratz release || exit
for i in chmod chgrp cmp cp ln mv rm
do if test ! -x $OK/$i -a -x /bin/$
i.exe '') echo "$SHELLMAGIC"'execrate /bin/'$i' "$@"' > $OK/$i
*) $exec echo \'"$SHELLMAGIC"'execrate /bin/'$i' "$@"'\'' >' $OK/$i
# record the build host name
# make in parallel if possible
# separate flags from target list
-[eiknFKNV]*|--*-symbols)
makeflags="$makeflags $t"
-*) nmakeflags="$nmakeflags $t"
# generate nmake first if possible
then note make $NMAKE with mamake
*) assign="$assign CC=\"\$CC\"" ;;
eval capture mamake \$makeflags \$nmakeflags \$noexec install nmake $assign
'') if executable ! $NMAKE
then echo "$command: $action: errors making $NMAKE" >&2
if test '' != "$PROTOROOT"
then if (vpath $INSTALLROOT - $PROTOROOT - $INSTALLROOT $PACKAGEROOT) >
/dev/null 2>&1 &&
vpath $INSTALLROOT - $PROTOROOT - $INSTALLROOT $PACKAGEROOT
then $show vpath $INSTALLROOT $PACKAGEROOT $USER_VPATH_CHAIN
else VPATH=$INSTALLROOT:$PACKAGEROOT$USER_VPATH
note believe generated files for $accept
eval capture \$NMAKE \$makeflags \$nmakeflags \$noexec recurse believe \$nmakesep $accept $assign
note make the remaining targets with $NMAKE
else eval capture $MAKE \$makeflags \$nmakeflags \$noexec install nmake $assign
'') if executable ! $NMAKE
then echo "$command: $action: errors making $NMAKE" >&2
# generate ksh next if possible
then : no need to generate ksh next -- it could be the only package
then eval capture nmake $nmakeflags \$makeflags \$noexec install ksh93 $assign
then echo "$command: $action: errors making $KSH" >&2
# mamprobe data should have been generated by this point
'') h='# use { no NO } prefix to permanently disable #' ;;
# run from separate copies since nmake and ksh may be rebuilt
ksh nmake tee cp ln mv rm \
*ast*.dll *cmd*.dll *dll*.dll *shell*.dll
echo "$command: $OK/$i: cannot update [may be in use by a running process] remove manually and try again" >&2
$exec $execrate $cp $i $OK/$i
if test "$KEEP_SHELL" != 1 && executable $
OK/ksh # fall back to mamake if nmake not found or too old
then note make with mamake
eval capture mamake \$makeflags \$noexec \$target $assign
'') target="install cc-" ;;
eval capture \$MAKE \$makeflags \$nmakeflags \$noexec recurse \$target \$nmakesep \$package $assign
read) case ${PWD:-`pwd`} in
*) echo "$command: must be in package root directory" >&2
then case `$_onpath_ -rw --?meter 2>&1` in
set '' `ls
lib/package/$tgz/*?[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]* 2>
/dev/null`
else set '' `ls -r ${f}[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]* 2>
/dev/null`
if test '' != "$2" -a -f "$2"
else set '' `ls -r
lib/package/$tgz/${f}[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]* 2>
/dev/null`
if test '' != "$2" -a -f "$2"
else echo "$command: $f: package archive not found" >&2
'') echo "$command:
lib/package/$tgz: no package archives" >&2
*.gz) : standalone packages unbundled manually
*.md5) : tarball checksum
*?[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]*)
*) echo "$command: $f: not a package archive" >&2
*/*) eval `echo "$f" | sed -e 's,\(.*/\)\(.*\),d=\1 a=\2,'` ;;
# f:file d:dir a:base p:package v:version r:release t:type
eval `echo "$a" | sed -e 's,\.c$,,' -e 's,\.gz$,,' -e 's,\.exe$,,' -e 's,\.tgz$,,' -e 's,\([^_.]*\)[_.]\([0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]\)[_.]\([0123456789][0123456789][0123456789][0123456789][^_.]*\)[_.]*\(.*\),p=\1 v=\2 r=\3 t=\4,' -e 's,\([^_.]*\)[_.]\([0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]\)[_.]*\(.*\),p=\1 v=\2 r=base t=\3,'`
1) note $p already read ;;
then # ratz packages are not archives
do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit
*) for i in arch arch/$t arch/$
t/bin do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit
then $exec pax -L --from=ascii --local -m -ps -rvf "$f" || {
else if onpath gunzip && onpath $TAR && isascii
then TARFLAGS=$TARFLAGS$i
'') $exec gunzip < "$f" | $TAR ${TARFLAGS}f - ;;
*) $exec "gunzip < $f | $TAR ${TARFLAGS}f -" ;;
else $exec $TAR ${TARFLAGS}f "$f" || {
else checkaout ratz && onpath ratz || {
*) $exec "$RATZ -lm < $f"
then while read md5 mode usr grp file
[01234567][01234567][01234567][01234567])
*) $exec chgrp $grp "$file" ;;
*) $exec chown $usr "$file" ;;
$exec chmod $mode "$file"
echo "$command: $f: pax required to read delta archive" >&2
test -f "$b" || b=${d}${p}.${r}${q}.tgz
1) echo "$command: $f: base archive $b required to read delta" >&2
# -m with delta bug fixed 2005-02-08
$exec pax -L --from=ascii --local -ps -rvf "$f" -z "$b" || {
note $f: generate new base $d$p.$v$
q.tgz $exec pax -rf "$f" -z "$b" -wf $d$p.$v$
q.tgz -x tgz || {
*) remove="$remove $f" ;;
*) b=${d}${p}_${v}${Q}.tgz
test -f "$b" || b=${d}${p}.${v}${q}.tgz
1) echo "$command: $f: base archive $b required to read delta" >&2
# -m with delta bug fixed 2005-02-08
$exec pax -L --from=ascii --local -ps -rvf "$f" -z "$b" || {
*) echo "$command: $f: unknown archive type" >&2
then $exec $w/$
p.ini read || {
# add to the obsolete list
for i in `ls $d$p[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]????$m* $z 2>
/dev/null`
$d${p}[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]$m*)
$d${p}[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]$m*)
*) remove="$remove $k" ;;
?*) $exec rm -f $remove ;;
# mark the updated archives
?*) sleep 1; $exec touch $touch ;;
then echo "$command: 'package make' and 'package test' required for regression" >&2
do case `ls -t regress.$s test.$s 2>
/dev/null` in
test*) if test -f regress.$s
'') egrep -i '\*\*\*|FAIL|^TEST.* [123456789][0123456789]* error|core.*dump' test.$s |
sed -e '/\*\*\* [0123456789]/d' \
-e '/^TEST.\//s,/[^ ]*/,,' \
-e 's/[0123456789][0123456789]*:* \([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789 ]*([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789 ]*[Cc][Oo][Rr][Ee][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789 ]*)\)/\1/' \
-e 's/\.sh failed at .* with /.sh failed /' \
else echo "$command: at least 2 test runs required for regression" >&2
checkaout release || exit
requirements source $package
-|[0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789])
*) lo=$1 release="-f $1" ;;
-|[0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789])
*) hi=$1 release="$release -t $1" ;;
[0123456789]|[0123456789][0123456789]|[0123456789][0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789][0123456789]*)
*) echo $command: $*: lo-date hi-date arguments expected >&2
::) echo "All recorded changes follow." ;;
1::) echo "Changes since the last release follow." ;;
?*::) echo "Changes since the last $count releases follow." ;;
1:?*:) echo "Changes since $lo or the last release follow." ;;
*:?*:*) echo "Changes since $lo follow." ;;
*::?*) echo "Changes before $hi follow." ;;
*) echo "Changes between $lo and $hi follow." ;;
for r in $INSTALLROOT $PACKAGEROOT
for f in RELEASE CHANGES ChangeLog
then $exec release $release $i/$f
then $exec release $release $f
remove) echo "$command: $action: not implemented yet" >&2
case $filter:$1:$SHELL in
*:test:*/ksh*) filter=rt ;;
1) echo $command: $action: $1: host pattern argument expected >&2
eval set '""' $i - $i.$suf - $dir/$i - $dir/$i.$suf -
echo "$command: $i action output not found" >&2
errors) $exec egrep -i '\*\*\*|FAIL[ES]|^TEST.* [123456789][0123456789]* error|core.*dump' $j | sed -e '/^TEST.\//s,/[^ ]*/,,'
*) $exec egrep -i '^TEST|FAIL' $j
*) if test -f $HOME/.pkgresults
then i="`cat $HOME/.pkgresults`"
errors) $exeg egrep '^pax:|\*\*\*' $j
*) $exec egrep -iv '^($||[\+\[]|cc[^-:]|kill |make.*(file system time|has been replaced)|so|[0123456789]+ error|uncrate |[0123456789]+ block|ar: creat|iffe: test: |conf: (check|generate|test)|[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789]*=|gsf@research|ar:.*warning|cpio:|ld:.*(duplicate symbol|to obtain more information)|[0123456789]*$|(checking|creating|touch) [/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789])| obsolete predefined symbol | is (almost always misused|dangerous|deprecated|not implemented)| trigraph| assigned to | cast .* different size| integer overflow .*<<| optimization may be attained | passed as |::__builtin|pragma.*prototyped|^creating.*\.a$|warning.*not optimized|exceeds size thresh|ld:.*preempts|is unchanged|with value >=|(-l|lib)\*|/(ast|sys)/(dir|limits|param|stropts)\.h.*redefined|usage|base registers|`\.\.\.` obsolete'"$i" $j |
test) requirements source $package
1) only=--recurse=only ;;
then echo $command: $action: must have $MAKE to test >&2
# disable core dumps (could be disasterous over nfs)
(ulimit -c 0) >
/dev/null 2>&1 && ulimit -c 0
eval capture \$MAKE \$makeflags \$noexec \$only recurse test \$target \$nmakesep \$package $assign
# get the architectures, update query url, and packages
then echo $command: $urlfile: not found >&2; exit 1
then echo $command: url argument expected >&2; exit 1
eval `echo $url | sed 's,\(.*\)://\([^/]*\)/\(.*\),prot=\"\1\" host=\"\2\" dir=\"\3\",'`
*.????-??-??.????-??-??.*.*)
*.????-??-??.????-??-??.*)
set '' `echo "$p" | sed 's,\..*,,' | sort -u`
*.????-??-??.????-??-??.*.*)
*.????-??-??.????-??-??.*)
set '' `echo "$p" | sed 's,\..*,,' | sort -u`
package_hit="$source_packages $binary_packages"
?*) echo "url='$url' authorize='$authorize' password='$password'" > $default_url
?*) chmod go-rwx $default_url ;;
while read name suffix type base base_size delta delta_size sync sync_size requires covers base_sum delta_sum sync_sum comment
-) case " $source_packages " in
do case " $source_packages " in
*) source_packages="$source_packages $name"
*) case " $binary_packages " in
do case " $binary_packages " in
*) binary_packages="$binary_packages $name"
*) source_packages="$source_packages $name" ;;
*) binary_packages="$binary_packages $name" ;;
for i in $checksum_commands
${checksum_empty}|${checksum_empty}[\ \ ]*)
'') echo $command: warning: '{' $checksum_commands '}' command not found -- only download sizes will be checked >&2 ;;
while read name suffix type base base_size delta delta_size sync sync_size requires covers base_sum delta_sum sync_sum comment
j="$name.$base$i.$suffix"
*) j="$j $name.$base.$delta$i.$suffix" ;;
*) j="$j $name.$base.$sync$i.$suffix" ;;
echo $command: $j $base_size:$base_sum $delta_size:$delta_sum $sync_size:$sync_sum $requires >&2
*) package_hit="$package_hit $name"
-) case " $source_packages " in
then case $checksum:$base_sum in
:*|*:-) size=`wc -c < $lcl | sed 's, ,,g'` sum=$base_sum ;;
*) size=$base_size sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` ;;
if test "0" != "$force" -a "X-" = "X$delta" -o "$base_size" != "$size" -o "$base_sum" != "$sum"
*) lcl=$name.$base.$sync.$suffix
get $host $dir $lcl $sync_size $sync_sum
'') lcl=$name.$base.$suffix
get $host $dir $lcl $base_size $base_sum
case $delta:$delta_size in
*) lcl=$name.$delta.$base.$suffix
then case $checksum:$delta_sum in
:*|*:-) size=`wc -c < $lcl | sed 's, ,,g'` sum=$delta_sum ;;
*) size=$base_size sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` ;;
if test "0" != "$force" -o "$delta_size" != "$size" -o "$delta_sum" != "$sum"
then get $host $dir $lcl $delta_size $delta_sum
*) case " $binary_packages " in
" ") case " $types_test " in
*) types_test="$types_test $type"
for i in *.????-??-??.$type.* *.????-??-??.????-??-??.$type.*
then types_local="$types_local $type"
lcl=$name.$base.$type.$suffix
then case $checksum:$base_sum in
:*|*:-) size=`wc -c < $lcl | sed 's, ,,g'` sum=$base_sum ;;
*) size=$base_size sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` ;;
if test "0" != "$force" -a "X-" = "X$delta" -o "$base_size" != "$size" -o "$base_sum" != "$sum"
*) lcl=$name.$base.$sync.$type.$suffix
get $host $dir $lcl $sync_size $sync_sum
'') lcl=$name.$base.$type.$suffix
get $host $dir $lcl $base_size $base_sum
case $delta:$delta_size in
*) lcl=$name.$delta.$base.$type.$suffix
then sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'`
then case $checksum:$delta_sum in
:*|*:-) size=`wc -c < $lcl | sed 's, ,,g'` sum=$delta_sum ;;
*) size=$base_size sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` ;;
if test "0" != "$force" -o "$delta_size" != "$size" -o "$delta_sum" != "$sum"
then get $host $dir $lcl $delta_size $delta_sum
for name in $source_packages $binary_packages
*) case " $package_hit " in
*) closure="$closure $name"
*) echo $command: $name: unknown package >&2
use) # finalize the environment
for d in `( cd $PACKAGEROOT; ls src/*/Makefile src/*/Nmakefile 2>
/dev/null | sed 's,/[^/]*$,,' | sort -u )`
eval PACKAGE_USE=$package_use
':') $exec exec $SHELL ;;
*) $exec exec $SHELL -c "$run"
requirements binary $package
then echo "$command: $action: $SUM command required" >&2
do package_verify $i || code=1
else echo "$command: warning: $a: no binary packages" >&2
else echo "$command: warning: $a: no binary package for $i" >&2
base|closure|delta|exp|lcl|pkg|rpm|tgz)
qualifier="$qualifier $1"
cyg) qualifier="$qualifier $1"
assign="$assign closure=1"
tst) qualifier="$qualifier tgz"
assign="$assign copyright=0 'PACKAGEDIR=\$(PACKAGESRC)/tst'"
assign="$assign copyright=0"
'') echo "$command: binary or source operand expected" >&2
0) echo "$command: at least one package name expected" >&2
then echo "$command: must have $MAKE to generate archives" >&2
# all work under $PACKAGEBIN
then eval capture \$MAKE \$makeflags -X ignore \$noexec -f \$
package.pkg \$qualifier \$action $assign
else echo "$command: $package: not a package" >&2
TEST) set '' $target $package
*) echo "$command: $action: internal error" >&2