########################################################################
# #
# This software is part of the ast package #
# Copyright (c) 1994-2012 AT&T Intellectual Property #
# and is licensed under the #
# Eclipse Public License, Version 1.0 #
# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# (with md5 checksum b35adb5213ca9657e911e9befb180842) #
# #
# Information and Software Systems Research #
# AT&T Research #
# Florham Park NJ #
# #
# Glenn Fowler <gsf@research.att.com> #
# #
########################################################################
### this script contains archaic constructs that work with all sh variants ###
# package - source and binary package control
# Glenn Fowler <gsf@research.att.com>
command=package
case $-:$BASH_VERSION in
esac
# ksh checks -- ksh between 2007-11-05 and 2011-11-11 conflict with new -lcmd -- wea culpa
{
}
;;
*:*/*:*/*)
export _AST_BIN_PACKAGE_
else case " $* " in
*" debug "*|*" DEBUG "*|*" show "*)
;;
esac
export SHELL
exec $SHELL "$0" "$@"
fi
;;
esac
LC_ALL=C
export LC_ALL
src="cmd contrib etc lib"
usr="/home"
org="gnu GNU"
makefiles="Mamfile Nmakefile nmakefile Makefile makefile"
env="HOSTTYPE NPROC PACKAGEROOT INSTALLROOT PATH"
checksum_commands="$checksum md5"
checksum_empty="d41d8cd98f00b204e9800998ecf8427e"
package_use='=$HOSTTYPE=$PACKAGEROOT=$INSTALLROOT=$EXECROOT=$CC='
CROSS=0
admin_ditto="ditto --checksum --delete --verbose"
admin_ditto_skip="OFFICIAL|core|old|*.core|*.tmp|.nfs*"
admin_list='PACKAGE.$type.lst'
admin_ping="ping -c 1 -w 5"
SED=
TARPROBE=B
TR=
[-?
@(#)$Id: package (AT&T Research) 2012-06-28 $
[+NAME?package - source and binary package control]
[+DESCRIPTION?The \bpackage\b command controls source and binary
packages. It is a \bsh\b(1) script coded for maximal portability. All
package files are in the \b$PACKAGEROOT\b directory tree.
\b$INSTALLROOT\b (\b$PACKAGEROOT/arch/\b\ahosttype\a) tree, where
\ahosttpe\a=`\bpackage\b`. All \aactions\a but \bhost\b and \buse\b
require the current directory to be under \b$PACKAGEROOT\b. See
\bDETAILS\b for more information.]
[+?Note that no environment variables need be set by the user;
\bpackage\b determines the environment based on the current working
directory. The \buse\b action starts a \bsh\b(1) with the environment
initialized. \bCC\b, \bCCFLAGS\b, \bHOSTTYPE\b and \bSHELL\b may be set
by explicit command argument assignments to override the defaults.]
[+?Packages are composed of components. Each component is built and
installed by an \bast\b \bnmake\b(1) makefile. Each package is also
described by an \bnmake\b makefile that lists its components and
provides a content description. The package makefile and component
makefiles provide all the information required to read, write, build
and install packages.]
[+?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
\b$INSTALLROOT/bin/cc\b script may be supplied for some architectures.
This script supplies a reasonable set of default options for compilers
that accept multiple dialects or generate multiple object/executable
formats.]
[+?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.]
[+?The qualifiers are:]
{
[+authorize \aname\a?Remote authorization user name or license
acceptance phrase.]
[+debug|environment?Show environment and actions but do not
execute.]
[+flat?Collapse \b$INSTALLROOT\b { bin fun include lib } onto
\b$PACKAGEROOT\b.]
[+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
acceptance password.]
[+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.]
}
[+?The actions are:]
{
[+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
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
\"\bpackage\b\".]
[+[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
replacement notices.]
[+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
[+help\b [ \aaction\a ]]?Display help text on the standard
error (standard output for \aaction\a).]
[+host\b [ \aattribute\a ... ]]?List
architecture/implementation dependent host information on the
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
multiprocessor.]
[+name?The host name.]
[+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
determine the rating.]
[+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
futile.]
}
[+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
licenses.]
[+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
\b$INSTALLROOT/lib/package/gen/make.out\b. The build is done 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
ASCII or UTF-8 encoded.]
[+regress?\bdiff\b(1) the current and previous \bpackage test\b
results.]
[+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
\apackage\a.]
[+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
argument details.]
[+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
\b$INSTALLROOT/lib/package/gen/test.out\b. In general a package
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
(e.g., \bhttp://www.research.att.com/sw/download\b) into the directory
\b$PACKAGEROOT/lib/package/tgz\b. \bbeta\b acesses beta packages;
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
\b$PACKAGEROOT/lib/package/tgz/default.url\b, if it exists, are used.
If \b$PACKAGEROOT/lib/package/tgz/default.url\b does not exist then it
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
directory. If the file \b$INSTALLROOT/lib/package/profile\b is
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
\b$INSTALLROOT/lib/\b\apackage\a\b/gen/*.sum\b. The checksum
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
\b$PACKAGEROOT/lib/package\b directory. \aformat\a-specific
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
\bpkgadd\b(1).]
[+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
libraries.]
[+?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
must have a \b$PACKAGEROOT/lib/package\b directory.]
[+?Each package contains one or more components. Component source for
the \afoo\a command is in \b$PACKAGEROOT/src/cmd/\b\afoo\a, and source
for the \abar\a library is in \b$PACKAGEROOT/src/lib/lib\b\abar\a. This
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.]
[+?\b$PACKAGEROOT/lib/package\b contains package specific files. The
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.]
[+?\b$PACKAGEROOT/lib/package/\b\agroup\a\b.lic\b files contain license
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
are in the \b$PACKAGEROOT/lib/package/LICENSES\b and
\b$INSTALLROOT/lib/package/LICENSES\b directories.]
[+?A few files are generated in \b$PACKAGEROOT/lib/package/gen\b and
\b$INSTALLROOT/lib/package/gen\b. \apackage\a\b.ver\b contains one line
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
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
determines if the required package have been read in. Finally,
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
(\b$PACKAGEROOT/arch/$HOSTTYPE\b.) There are a few places that match
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
\bpackage write\b.]
[+?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
\bproto\b(1) on portions of the \b$PACKAGEROOT/src\b tree and places
the converted output files in the \b$PACKAGEROOT/proto/src\b tree.
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
a new \b$INSTALLROOT\b.]
[ 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)]
'
case $* in
esac
do :
done
shift $OPTIND-1
;;
esac
# check the args
esac
esac
esac
esac
bit=
exec=
flat=0
force=0
hi=
html=0
'}
lo=
make=
makeflags='-k -K'
nl="
"
only=0
quiet=0
show=:
tab=" "
verbose=0
HURL=
unset FIGNORE BINDIR DLLDIR ETCDIR FUNDIR INCLUDEDIR LIBDIR LOCALEDIR MANDIR SHAREDIR 2>/dev/null || true
while :
do case $# in
0) set host type ;;
esac
case $1 in
admin|clean|clobber|contents|copyright|export|host|install|license|list|make|read|regress|release|remove|results|setup|test|update|use|verify|view|write|TEST)
action=$1
shift
break
;;
case $# in
esac
shift
authorize=$1
shift
continue
;;
;;
;;
;;
;;
;;
case $# in
esac
shift
password=$1
shift
continue
;;
;;
;;
;;
PS4='+$LINENO:$SECONDS+ '
set -x
;;
case $1 in
case $2 in
'') exec 1>&2 ;;
esac
;;
;;
*) code=2
exec 1>&2
;;
esac
<HEAD>
<TITLE>$2 package installation instructions</TITLE>
<HEAD>
<BODY bgcolor=white link=teal vlink=dimgray>"
eO='</BODY>
</HTML>'
bH="<CENTER><H3><FONT face=courier color=red>"
eH='</FONT></H3></CENTER>'
bP='<P>'
bL='<P><TABLE cellpadding=0 cellspacing=2>'
bL2='<P><TABLE border=0 cellpadding=0 cellspacing=2>'
eL='</TABLE><P>'
bT='<TR><TD align=right valign=top><B>'
Camp='&'
Mnmake='<A href=../../man/man1/nmake.html>nmake</A>(1)'
Mpackage='<A href=../../man/man1/package.html>package</A>(1)'
Mproto='<A href=../../man/man1/proto.html>proto</A>(1)'
;;
bP=''
bL2=''
bT=' '
Camp='&'
Mcurl='curl(1)'
Mdate='date(1)'
Mfile='file(1)'
Mgunzip='gunzip(1)'
Mhurl='hurl(1)'
Mlynx='lynx(1)'
Mnmake='nmake(1)'
Mpackage='package(1)'
Mproto='proto(1)'
Mratz='ratz'
Mtar='tar(1)'
Mwget='wget(1)'
;;
esac
case $2 in
binary) echo "${bO}
${bH}Binary Package Installation Instructions${eH}
${bL}
${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}
URL=http://www.research.att.com/sw/download${eX}${eD}
test -d bin || mkdir bin
${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}
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
instead:${bX}
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}
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
flat install:${bX}
cd \$INSTALLROOT
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
binary release is:${bX}
${bH}Binary Package Installation Instructions -- Plan B${eH}
${bL}
into that directory.${eD}
${bT}(4)${bD}If the ${bB}bin/package${eB} script does not exist then manually read the ${bB}INIT${eB}
binary package:${bX}
gunzip < lib/package/tgz/INIT.${bI}YYYY-MM-DD.HOSTTYPE${eI}.tgz |
${TAR} ${TARFLAGS}f -${eX}
Note that some browsers automatically unzip downloaded without warning.
If the gunzip fails try:
${TAR} ${TARFLAGS}f -${eX} lib/package/tgz/INIT.${bI}YYYY-MM-DD.HOSTTYPE${eI}.tgz
If your system does not have ${Mtar} or ${Mgunzip} then download the ${Mratz}
binary package:${bX}
mkdir bin
${bT}(5)${bD}Read all unread package archive(s):${bX}
Both source and binary packages will be read by this step.${eD}${eL}${eO}"
;;
intro) echo "${bO}
${bH}Package Hierarchy Details${eH}
${bP}
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.
${bP}
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
in ${bB}\$PACKAGEROOT/src/lib/lib${eB}${bI}BAR${eI}. This naming is for convenience only; the
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
makefile dependencies.
${bP}
${bB}\$PACKAGEROOT/lib/package${eB} contains package specific files. The package naming
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.
${bP}
${bB}\$PACKAGEROOT/lib/package/${eB}${bI}GROUP${eI}${bB}.lic${eB} files contain license information that
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
${bB}\$PACKAGEROOT/lib/package/LICENSES${eB} and ${bB}\$INSTALLROOT/lib/package/LICENSES${eB}
directories.
${bP}
A few files are generated in ${bB}\$PACKAGEROOT/lib/package/gen${eB} and
${bB}\$INSTALLROOT/lib/package/gen${eB}. ${bI}PACKAGE${eI}${bB}.ver${eB} contains one line consisting of${bX}
${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.
${bP}
${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
dependent logic is handled either by ${bB}\$INSTALLROOT/bin/iffe${eB} or by component
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.
${bP}
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
makefile description that is used by ${bB}\$INSTALLROOT/bin/mamake${eB} to simulate
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
${bF}package write${eF}.
${bP}
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
${bB}\$PACKAGEROOT/proto/src${eB} tree. Converted files are then viewpathed over 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.
${bP}
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}.
${eO}"
;;
source) echo "${bO}
${bH}Source Package Installation Instructions${eH}
${bL}
${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.
${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}
URL=http://www.research.att.com/sw/download${eX}${eD}
test -d bin || mkdir bin
${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}
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
instead:${bX}
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}
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
the terminal and captured in ${bB}\$INSTALLROOT/lib/package/gen/make.out${eB}:${bX}
${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}
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
flat install:${bX}
cd \$INSTALLROOT
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}
${bL}
into that directory.${eD}
${bT}(4)${bD}If the ${bB}bin/package${eB} script does not exist then manually read the ${bB}INIT${eB}
source package:${bX}
Note that some browsers automatically unzip downloaded without warning.
If the gunzip fails try:
If your system does not have ${Mtar} or ${Mgunzip} then download the ${Mratz}
source package, compile it, and manually read the ${bB}INIT${eB}
source package:${bX}
mkdir bin
${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
action is \"host type\".
qualifier:
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.
action:
admin [ all ] [ db FILE ] [ on PATTERN ] [ action ... ]
Apply ACTION ... to the hosts listed in FILE. If FILE is
and rsh(1) or scp(1) and ssh(1) access to the hosts. Output
for the action is saved per-host in ACTION.log/HOST. Logs
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:
hosttype
The host type as reported by package.
[user@]host
The host name and optionally user name for rcp(1)
and rsh(1) access.
[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
lib/package/admin/$admin_env exists under
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.
attributes
NAME=VALUE attributes. Should at least contain
cc=compiler-version.
clean | clobber
files and directories for HOSTTYPE. The heirarchy can be rebuilt
by package make.]
contents [ package ... ]
List description and components for PACKAGE on the standard
output.
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.
export [ VARIABLE ... ]
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
$env are assumed.
help [ ACTION ]
Display help text on the standard error [ standard output
for ACTION ].
host [ canon cpu name rating type ... ]
List architecture/implementation dependent host information
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
multiprocessor.
name The host name.
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
determine the rating.
type The host type, usually of the form
vendor.architecture, with an optional trailing
-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
been futile.
html [ ACTION ]
Display html help text on the standard error [ standard output
for ACTION ].
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
requires nmake.
license [ package ... ]
List the source license(s) for PACKAGE on the standard output.
Note that individual components in PACKAGE may contain
additional or replacement licenses.
list [ PACKAGE ... ]
List the name, version and prerequisites for PACKAGE on the
standard output.
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
\$INSTALLROOT/lib/package/gen/make.out. The build is done
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 PACKAGE
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.
test [ PACKAGE ]
Run the regression tests for PACKAGE. If the standard output
is a terminal then the output is also captured in
\$INSTALLROOT/lib/package/gen/test.out. In general a package
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
packages from URL (e.g.,
http://www.research.att.com/sw/download) into the directory
\$PACKAGEROOT/lib/package/tgz. beta acesses beta packages;
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
in \$PACKAGEROOT/lib/package/tgz/$default_url, if it exists,
are used. If \$PACKAGEROOT/lib/package/tgz/$default_url does
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
\$INSTALLROOT/lib/package/profile is readable then it is
sourced to initialize the environment. 32 or 64 implies
\$PACKAGEROOT of . and specifies the target architecture word
size (which may be silently ignored.)
verify [ PACKAGE ]
Verify installed binary files against the checksum files in
\$INSTALLROOT/lib/package/gen/*.sum. The checksum 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 ast
package cksum(1) command.
view
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
\$PACKAGEROOT/lib/package directory. FORMAT-specific files
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
must be listed in PACKAGE.pkg. FORMAT may be one of:
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
the default
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.
package.pkg may reference other packages. By default a
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).
name=value:
variable definition: typically CC=cc or CCFLAGS=-g."
;;
esac
exit $code
;;
;;
*) echo "Usage: $command [ options ] [ qualifier ... ] [ action ] [ arg ... ] [ n=v ... ]" >&2
exit 2
;;
esac
shift
done
# gather HOSTTYPE *,* options
# ,*cc*,-*,... set CC and CCFLAGS
{
IFS=,
shift
while :
do case $# in
0|1) break ;;
esac
shift
case $1 in
while :
do case $# in
0|1) break ;;
esac
case $2 in
-*) case $assign_CCFLAGS in
esac
shift
;;
*) break
;;
esac
done
;;
esac
done
}
# collect command line targets and definitions
case $_PACKAGE_HOSTTYPE_ in
;;
*) KEEP_HOSTTYPE=0
;;
esac
args=
for i
do case $i in
continue
;;
;;
esac
case $i in
eval $n='$'v
;;
CC=*) eval $n='$'v
;;
CCFLAGS=*)
eval $n='$'v
assign_CCFLAGS="CCFLAGS=\"\$CCFLAGS\""
;;
HOSTTYPE=*)
eval $n='$'v
?*) KEEP_HOSTTYPE=1 ;;
esac
;;
HURL=*) eval $n='$'v
;;
PACKAGEROOT=*)
eval $n='$'v
case $PACKAGEROOT in
?*) KEEP_PACKAGEROOT=1 ;;
esac
;;
SHELL=*)eval $n='$'v
?*) KEEP_SHELL=1 ;;
esac
;;
TAR=*) eval $n='$'v
;;
TARFLAGS=*)
eval $n='$'v
;;
;;
'debug=1')
makeflags="$makeflags --debug-symbols"
;;
'strip=1')
makeflags="$makeflags --strip-symbols"
;;
;;
;;
esac
done
esac
case $assign_CCFLAGS in
?*) assign="$assign $assign_CCFLAGS"
esac
''|cc) ;;
*) export CC ;;
esac
# grab action specific args
admin) while :
do case $# in
0) set list
break
;;
esac
case $1 in
;;
exit 1
;;
esac
shift
admin_db=$1
;;
exit 1
;;
esac
shift
admin_on=$1
;;
*) break
;;
esac
shift
done
admin_action=$1
admin_args=$*
for i
do case $i in
;;
*) admin_action=$i
break
;;
esac
done
;;
export PACKAGEROOT
;;
use) case $1 in
esac
shift
# HOSTTYPE specific setup
esac
*/32) ;;
esac
;;
*-64) ;;
esac
esac
;;
esac
esac
$exec umask 002
$exec export INSTALLROOT=$A
$exec export PACKAGEROOT=$P
fi
# run the command
case $# in
esac
;;
;;
esac
exit
;;
esac
$show export PACKAGEROOT
esac
;;
esac
# true if arg is a valid PACKAGEROOT
{
}
# true if arg is executable
{
case $1 in
esac
}
# initialize SHELLMAGIC
# tangible proof of cygwin's disdain for unix (well, this and execrate)
{
case $SHELLMAGIC in
'') ;;
else SHELLMAGIC=
fi
;;
esac
}
# true if arg is executable command on $PATH
{
_onpath_b=$1
case $_onpath_b in
/*) if executable $_onpath_b
then _onpath_=$_onpath_b
return 0
fi
return 1
;;
esac
IFS=':'
shift
for _onpath_d
do case $_onpath_d in
esac
then _onpath_=$_onpath_d/$_onpath_b
return 0
fi
done
return 1
}
# 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
then return 0
fi
return 1
}
# determine local host attributes
{
1) set -x ;;
esac
map=
done
done
done
# LD_LIBRARY_PATH may be out of sync with PATH here
break
fi
done
break
fi
done
;;
esac
case $PACKAGE_PATH in
done
;;
esac
# validate the args
for info
;;
;;
;;
;;
exit 1
;;
esac
;;
esac
done
exit 1
;;
esac
case $something in
"") set "$@" type ;;
esac
'') exec 9>&2
;;
esac
# compute the info
for info
do
[123456789]*)
continue
;;
esac
[123456789]*)
continue
;;
esac
cpu=1
# exact match
set \
while :
do case $# in
0) break ;;
esac
case $i in
[123456789]*)
cpu=$i
break
;;
esac
shift;shift
done
0|1) set \
while :
do case $# in
0) break ;;
esac
if executable $1
break
;;
esac
fi
shift
done
;;
esac
0|1) # token match
set \
while :
do case $# in
0) break ;;
esac
case $i in
[123456789]*)
cpu=$i
break
;;
esac
shift;shift
done
;;
esac
0|1) # special match
set \
\
hinv \
'/^[0123456789][0123456789]* .* Processors*$/' \
'/[ ].*//' \
\
'/^[0123456789][0123456789]* .* physically available\.*$/' \
'/[ ].*//' \
while :
do case $# in
0) break ;;
esac
case $i in
[123456789]*)
cpu=$i
break
;;
esac
shift;shift;shift
done
;;
esac
trap 'rm -f $tmp.*' 0 1 2
#include <stdio.h>
#include <pthread.h>
int main()
{
return 0;
}
!
break
fi
done
)`
[0123456789]*) ;;
*) cpu=1 ;;
esac
;;
esac
;;
;;
rating) for rating in `grep -i ^bogomips /proc/cpuinfo 2>/dev/null | $SED -e 's,.*:[ ]*,,' -e 's,\(...*\)\..*,\1,' -e 's,\(\..\).*,\1,'`
[0123456789]*) break ;;
esac
done
[0123456789]*) ;;
trap 'rm -f $tmp.*' 0 1 2
#include <stdio.h>
#if TD || TZ
#else
#endif
int main()
{
register unsigned long i;
register unsigned long j;
register unsigned long k;
unsigned long l;
unsigned long m;
unsigned long t;
int x;
#if TD || TZ
struct timeval b;
struct timeval e;
#if TZ
struct timezone z;
#endif
#endif
l = 500;
m = 890;
x = 0;
for (;;)
{
#if TD || TZ
#if TZ
#else
#endif
#else
#endif
k = 0;
for (i = 0; i < l; i++)
for (j = 0; j < 50000; j++)
k += j;
#if TD || TZ
#if TZ
#else
#endif
if (!x++ && t < 1000)
{
t = 10000 / t;
l = (l * t) / 10;
continue;
}
#else
if (!x++ && t < 20000)
{
t = 200000l / t;
l = (l * t) / 10;
continue;
}
#endif
#if PR
#endif
if (t == 0)
t = 1;
break;
}
return k == 0;
}
!
break
fi
done
[0123456789]*) ;;
*) rating=1 ;;
esac
;;
esac
;;
type|canon)
cc) case $KEEP_HOSTTYPE:$HOSTTYPE in
0:?*) if test -d ${PACKAGEROOT:-.}/arch/$HOSTTYPE
then KEEP_HOSTTYPE=1
fi
;;
esac
;;
esac
case $KEEP_HOSTTYPE in
continue
;;
esac
;;
esac
/*) a=`$cc -dumpmachine $CCFLAGS 2>/dev/null`
case $a in
esac
;;
esac
case $a in
''|*' '*|*/*:*)
;;
*.*-*) _hostinfo_="$_hostinfo_ $a"
continue
;;
esac
;;
*) _hostinfo_="$_hostinfo_ $a"
continue
;;
esac
;;
esac
IFS=:
shift
for i
do case $i in
"") i=. ;;
esac
/*|cc) ;;
*) if executable $i/$cc
then a=`$i/$cc -dumpmachine $CCFLAGS 2>/dev/null`
case $a in
esac
;;
esac
case $a in
''|*' '*|*/*:*)
;;
*-*) canon=$a
;;
*) _hostinfo_="$_hostinfo_ $a"
continue 2
;;
esac
fi
;;
esac
;;
esac
if test -f "$i/$f"
fi
done
# inconsistent -dumpmachine filtered here
--|*-powerpc-*)
case $h in
'') h=local ;;
esac
case $a in
esac
case $a in
esac
case $m in
esac
case $m in
esac
case $x in
esac
set "" $h $a $m $x
;;
*-*) IFS=-
shift
case $# in
esac
[abcdefghijklmnopqrstuvwxyz]*[0123456789])
;;
esac
;;
;;
esac
;;
esac
type=unknown
esac
mach=
;;
[Rr][0123][0123456789][0123456789][0123456789])
;;
[Rr][4][0123456789][0123456789][0123456789])
;;
[Rr][56789][0123456789][0123456789][0123456789]|[Rr][123456789][0123456789][0123456789][0123456789][0123456789])
;;
mach=
;;
mach=
;;
34[0123456789][0123456789])
;;
esac
;;
esac
'') set \
\
/NextDeveloper -d next - \
while :
do case $# in
0) break ;;
esac
if test $2 $1
then os=$3
case $4 in
esac
break
fi
shift;shift;shift;shift
done
;;
esac
type=ibm.risc
;;
9000/[78]*)
type=hp.pa
;;
;;
;;
esac
;;
set xx `hinv | $SED -e '/^CPU:/!d' -e 's/CPU:[ ]*\([^ ]*\)[ ]*\([^ ]*\).*/\1 \2/' -e q | $TR ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
shift
type=$1
n=
case $2 in
r[0123][0123456789][0123456789][0123456789])
n=1
;;
r[4][0123][0123456789][0123456789])
n=2
;;
r[4][456789][0123456789][0123456789]|r[5][0123456789][0123456789][0123456789])
n=3
;;
r[6789][0123456789][0123456789][0123456789]|r[123456789][0123456789][0123456789][0123456789][0123456789])
n=4
;;
esac
[01234].*|5.[012]|5.[012].*)
case $n in
1) ;;
*) n=2 ;;
esac
;;
5.*) case $n in
2) n=3 ;;
esac
;;
esac
if executable $cc
then a=$cc
else IFS=:
shift
for i
do a=$i/$cc
if executable $a
then break
fi
done
fi
split='
'
a=`strings $a < /dev/null | $SED -e 's/[^abcdefghijklmnopqrstuvwxyz0123456789]/ /g' -e 's/[ ][ ]*/\'"$split"'/g' | $SED -e "/^${type}[0123456789]$/!d" -e "s/^${type}//" -e q`
case $a in
[0123456789]) n=$a ;;
esac
case $n in
4) a=`$cc -${type}3 2>&1`
case $a in
*unknown*|*install*|*conflict*)
;;
*) n=3
;;
esac
;;
esac
a=`$cc -show F0oB@r.c 2>&1`
case $n:$a in
[!2]:*mips2*) n=2 ;;
[!23]:*mips3*) n=3 ;;
[!234]:*mips4*) n=4 ;;
esac
case $n:$a in
[!2]:*[Oo]32*) abi=-o32 ;;
[!3]:*[Nn]32*) abi=-n32 ;;
esac
mach=${type}$n
type=sgi.$mach
;;
OSx*|SMP*|pyramid)
type=pyr
;;
OS/390) type=mvs.390
;;
[Ss][Cc][Oo]*)
type=sco
;;
[Ss]ol*)
v=`echo $rel | $SED -e 's/^[25]\.//' -e 's/\.[^.]*$//'`
case $v in
[6789]|[1-9][0-9])
;;
*) v=
;;
esac
case $arch in
'') case $mach in
'') arch=sun4 ;;
*) arch=$mach ;;
esac
;;
esac
case $arch in
sparc) arch=sun4 ;;
esac
type=sol$v.$arch
;;
case $type in
sparc) type=sun4 ;;
esac
case $rel in
[01234]*)
;;
'') case $os in
*[Oo][Ss])
;;
*) type=sol.$type
;;
esac
;;
*) case $type in
'') case $mach in
sparc*) type=sun4 ;;
*) type=$mach ;;
esac
;;
esac
v=`echo $rel | $SED -e 's/^[25]\.//' -e 's/\.[^.]*$//'`
case $v in
[6789]|[1-9][0-9])
;;
*) v=
;;
esac
type=sol$v.$type
;;
esac
case $type in
sun*|*.*)
;;
*) type=sun.$type
;;
esac
;;
[Uu][Nn][Ii][Xx]_[Ss][Vv])
type=unixware
;;
UTS*|uts*)
then type=uts.390
else case $arch in
'') arch=$mach ;;
esac
type=uts.$arch
fi
;;
$host) type=$arch
case $type in
*.*|*[0123456789]*86|*68*)
;;
*) case $mach in
*[0123456789]*86|*68*|mips)
type=$type.$mach
;;
esac
;;
esac
;;
unknown)
case $arch in
?*) case $arch in
sun*) mach= ;;
esac
type=$arch
case $mach in
?*) type=$type.$mach ;;
esac
;;
esac
;;
*) case $ver in
FTX*|ftx*)
case $mach in
*[0123456789][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]*)
;;
esac
type=stratus.$mach
;;
*) case $arch in
[Oo][Ss][-/.]2)
type=os2
arch=$rel
;;
*) type=`echo $os | $SED -e 's/[0123456789].*//' -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_0123456789.].*//'`
;;
esac
case $type in
[Cc][Yy][Gg][Ww][Ii][Nn]_*)
type=cygwin
;;
[Uu][Ww][Ii][Nn]*|[Ww]indows_[0123456789][0123456789]|[Ww]indows_[Nn][Tt])
type=win32
arch=`echo $arch | $SED -e 's/_[^_]*$//'`
;;
esac
case $arch in
'') case $mach in
?*) type=$type.$mach ;;
esac
;;
*) type=$type.$arch ;;
esac
;;
esac
esac
case $type in
[0123456789]*)
case $mach in
?*) type=$mach ;;
esac
case $type in
*/MC) type=ncr.$type ;;
esac
;;
*.*) ;;
*[0123456789]*86|*68*)
case $rel in
[34].[0123456789]*)
type=att.$type
;;
esac
;;
[abcdefghijklmnopqrstuvwxyz]*[0123456789])
;;
[abcdefghijklmnopqrstuvwxyz]*) case $mach in
$type) case $ver in
Fault*|fault*|FAULT*)
type=ft.$type
;;
esac
;;
?*) case $arch in
'') type=$type.$mach ;;
*) type=$type.$arch ;;
esac
;;
esac
;;
esac
case $type in
*[-_]32|*[-_]64|*[-_]128)
bits=`echo $type | $SED 's,.*[-_],,'`
type=`echo $type | $SED 's,[-_][0-9]*$,,'`
;;
*) bits=
;;
esac
type=`echo $type | $SED -e 's%[-+/].*%%' | $TR ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
case $type in
*.*) lhs=`echo $type | $SED -e 's/\..*//'`
rhs=`echo $type | $SED -e 's/.*\.//'`
case $rhs in
[x0123456789]*86) rhs=i$rhs ;;
68*) rhs=m$rhs ;;
esac
case $rhs in
i[x23456789]86|i?[x23456789]86|*86pc)
rhs=i386 ;;
powerpc) rhs=ppc ;;
s[0123456789]*[0123456789]x)
rhs=`echo $rhs | $SED -e 's/x$/-64/'` ;;
esac
case $rhs in
arm[abcdefghijklmnopqrstuvwxyz_][0123456789]*)
rhs=arm ;;
hppa) rhs=pa ;;
esac
case $lhs in
?*coff|?*dwarf|?*elf)
case $lhs in
?*coff) x=coff ;;
?*dwarf)x=coff ;;
?*elf) x=elf ;;
esac
lhs=`echo ${lhs}XXX | $SED -e "s/${x}XXX//"`
;;
esac
case $lhs in
bsdi) lhs=bsd ;;
darwin) case $rel in
[01234567].*) lhs=${lhs}7 ;;
esac
;;
freebsd) case $rel in
[01234].*) lhs=${lhs}4 ;;
[123456789]*.*) lhs=${lhs}`echo $rel | $SED -e 's/\..*//'` ;;
esac
;;
hpux) lhs=hp ;;
mvs) rhs=390 ;;
esac
case $lhs in
'') type=$rhs ;;
$rhs) type=$lhs ;;
*) type=$lhs.$rhs ;;
esac
;;
esac
case $type in
sgi.mips*)
case $mach in
mips2) type=sgi.$mach
abi=-o32
;;
mips3) type=sgi.$mach
abi=-n32
;;
mips[456789])
type=sgi.$mach
case $abi in
*-n32) ;;
*) abi=-64 ;;
esac
;;
*) pwd=`pwd`
cd ${TMPDIR:-/tmp}
tmp=hi$$
cat > $tmp.a.c <<!
extern int b();
int main() { return b(); }
!
cat > $tmp.b.c <<!
int b() { return 0; }
!
abi=
if $cc -c $tmp.a.c
then for i in -n32 -o32 -64
do if $cc $i -c $tmp.b.c &&
then abi=$i
for i in 2 3 4 5 6 7 8 9
do case $i:$abi in
2:-n32|2:-64|3:-64)
continue
;;
esac
if $cc $abi -mips$i -c $tmp.b.c &&
then type=`echo $type | $SED -e 's/.$//'`$i
break
fi
done
break
fi
done
rm -f $tmp.*
trap - 0 1 2
cd $pwd
;;
esac
case $type$abi in
sgi.mips2-o32)
;;
sgi.mips3)
type=$type-o32
;;
sgi.mips3-n32)
;;
sgi.mips4)
type=$type-o32
;;
sgi.mips[456789]-64)
;;
*) type=$type$abi
;;
esac
;;
*) case $bits in
*universal*64*)
pwd=`pwd`
cd ${TMPDIR:-/tmp}
tmp=hi$$
cat > $tmp.a.c <<!
int main() { return 0; }
!
then case `file $tmp.a.exe` in
*64*) bits=64 ;;
esac
rm -f $tmp.*
trap - 0 1 2
cd $pwd
;;
esac
;;
esac
;;
esac
case $bits in
32) case $type in
*.i386) bits= ;;
esac
;;
esac
case $bits in
?*) type=$type-$bits ;;
esac
# last chance mapping
set "" "" $map
while :
do case $# in
[012]) break ;;
esac
shift;shift
eval " case \$type in
$1) type=\$2; break ;;
esac"
done
_hostinfo_="$_hostinfo_ $type"
;;
esac
done
set '' $_hostinfo_
shift
_hostinfo_=$*
# restore the global state
PATH=$path
case $DEBUG in
'') exec 2>&9
exec 9>&-
;;
esac
}
# info message
note() # message ...
{
echo $command: "$@" >&2
}
# cc checks
#
# CC: compiler base name name
# cc: full path, empty if not found
checkcc()
{
cc=
if onpath $CC
then cc=$_onpath_
else case $CC in
cc) if onpath gcc
then CC=gcc
cc=$_onpath_
fi
;;
esac
fi
case $cc in
'') case $action in
make|test) note "$CC: not found"; exit 1 ;;
*) note "warning: $CC: not found" ;;
esac
;;
esac
}
# some actions have their own PACKAGEROOT or kick out early
case $action in
host) eval u=$package_use
case $u in
$PACKAGE_USE)
;;
*) if onpath $0
then case $_onpath_ in
KEEP_HOSTTYPE=1
;;
*) KEEP_HOSTTYPE=0
;;
esac
else KEEP_HOSTTYPE=0
fi
;;
esac
hostinfo $args
echo $_hostinfo_
exit 0
;;
export|setup|use)
x=
;;
*) x=
eval u=$package_use
case $u in
$PACKAGE_USE)
case :$PATH: in
*:$INSTALLROOT/bin:*)
case $LIBPATH: in
$INSTALLROOT/bin:$INSTALLROOT/lib:*)
case $SHLIB_PATH: in
$INSTALLROOT/lib:*)
x=1
;;
esac
;;
esac
;;
esac
;;
esac
;;
esac
run=-
case $x in
1) : accept the current package use environment
OK=ok
MAKE=nmake
INITROOT=$PACKAGEROOT/src/cmd/INIT
checkcc
;;
*) hosttype=
case $KEEP_PACKAGEROOT in
0) case $action in
use) PACKAGEROOT=
case $show in
echo) exec=echo make=echo show=echo ;;
esac
set '' $args
shift
case $# in
0) ;;
*) case $1 in
-|.) ;;
/*) PACKAGEROOT=$1
;;
*) i=`echo ~$1`
if packageroot $i
then PACKAGEROOT=$i
else for i in `echo $HOME | sed -e 's,/[^/]*$,,'` $usr $use
do if packageroot $i/$1
then PACKAGEROOT=$i/$1
break
fi
done
case $PACKAGEROOT in
'') hosttype=$1 ;;
esac
fi
;;
esac
shift
;;
esac
run="$@"
;;
esac
case $PACKAGEROOT in
'') PACKAGEROOT=${PWD:-`pwd`} ;;
esac
# . must be within the PACKAGEROOT tree
i=X$PACKAGEROOT
IFS=/
set $i
IFS=$ifs
while :
do i=$1
shift
case $i in
X) break ;;
esac
done
case $PACKAGEROOT in
//*) d=/ ;;
*) d= ;;
esac
case $1 in
home) k=1 ;;
*) k=0 ;;
esac
for i
do case $i in
'') continue ;;
esac
d=$d/$i
case $k in
2) k=1
;;
1) k=0
;;
0) case $i in
arch) k=2
;;
*) if packageroot $d
then PACKAGEROOT=$d
fi
;;
esac
;;
esac
done
;;
esac
INITROOT=$PACKAGEROOT/src/cmd/INIT
$show PACKAGEROOT=$PACKAGEROOT
$show export PACKAGEROOT
export PACKAGEROOT
# initialize the architecture environment
case $KEEP_HOSTTYPE in
0) hostinfo type
HOSTTYPE=$_hostinfo_
;;
1) _PACKAGE_HOSTTYPE_=$HOSTTYPE
export _PACKAGE_HOSTTYPE_
;;
esac
$show HOSTTYPE=$HOSTTYPE
$show export HOSTTYPE
export HOSTTYPE
INSTALLROOT=$PACKAGEROOT/arch/$HOSTTYPE
case $action in
admin|install|make|read|remove|test|verify|view|write)
;;
*) if test ! -d $INSTALLROOT
then INSTALLROOT=$PACKAGEROOT
fi
;;
esac
$show INSTALLROOT=$INSTALLROOT
$show export INSTALLROOT
export INSTALLROOT
# check the basic package hierarchy
case $action in
export|use)
packageroot $PACKAGEROOT || {
echo "$command: $PACKAGEROOT: invalid package root directory" >&2
exit 1
}
case $KEEP_HOSTTYPE:$hosttype in
0:?*) if test -d ${PACKAGEROOT:-.}/arch/$hosttype
then KEEP_HOSTTYPE=1
HOSTTYPE=$hosttype
else echo "$command: $hosttype: package root not found" >&2
exit 1
fi
;;
esac
;;
*) packageroot $PACKAGEROOT || {
case $KEEP_PACKAGEROOT in
1) ;;
*) echo "$command: $PACKAGEROOT: must be in the package root directory tree" >&2
exit 1
;;
esac
}
case $action in
admin) ;;
*) for i in arch arch/$HOSTTYPE
do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit
done
for i in lib
do test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit
done
;;
esac
# no $INITROOT means INIT already installed elsewhere
if test -d $INITROOT
then
# update the basic package commands
for i in execrate ignore mamprobe silent
do test -h $PACKAGEROOT/bin/$i 2>/dev/null ||
case `ls -t $INITROOT/$i.sh $PACKAGEROOT/bin/$i 2>/dev/null` in
"$INITROOT/$i.sh"*)
note update $PACKAGEROOT/bin/$i
shellmagic
case $SHELLMAGIC in
'') $exec cp $INITROOT/$i.sh $PACKAGEROOT/bin/$i || exit
;;
*) case $exec in
'') {
echo "$SHELLMAGIC"
cat $INITROOT/$i.sh
} > $PACKAGEROOT/bin/$i || exit
;;
*) echo "{
echo \"$SHELLMAGIC\"
cat $INITROOT/$i.sh
} > $PACKAGEROOT/bin/$i"
;;
esac
;;
esac
$exec chmod +x $PACKAGEROOT/bin/$i || exit
;;
esac
done
fi
;;
esac
path=$PATH
PATH=$INSTALLROOT/bin:$PACKAGEROOT/bin:$PATH
checkcc
PATH=$path
case $cc in
then
# check if $CC (full path $cc) is a cross compiler
(
cd /tmp || exit 3
$cc -o pkg$$.exe pkg$$.c > pkg$$.e 2>&1 || {
then echo "$command: ${warn}$CC: must be a C compiler (not C++)" >&2
else cat pkg$$.e
echo "$command: ${warn}$CC: failed to compile and link $INITROOT/hello.c -- is it a C compiler?" >&2
fi
exit 2
}
then code=0
else code=1
fi
rm -f pkg$$.*
exit $code
)
code=$?
case $code in
1) CROSS=1 ;;
esac
fi
;;
esac
EXECTYPE=$HOSTTYPE
EXECROOT=$INSTALLROOT
case $CROSS in
0) # dll hackery -- why is this so complicated?
abi=
case $HOSTTYPE in
sgi.mips[0123456789]*)
x=rld
if executable /lib32/$x || executable /lib64/$x
then case $INSTALLROOT in
*/sgi.mips[0123456789]*)
u=`echo $INSTALLROOT | sed -e 's,-[^-/]*$,,' -e 's,.$,,'`
;;
*) u=
;;
esac
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"
do eval $a
case $v in
N32) case $n:$HOSTTYPE in
*-n32:*-n32) ;;
*-n32:*) continue ;;
*:*-n32) continue ;;
esac
;;
esac
case $l in
?*) if executable ! /$l/$x
then continue
fi
;;
esac
case $u in
'') case $HOSTTYPE in
;;
*) continue
;;
esac
;;
*) if test -d $u$n
then abi="$abi 'd=$u$n v=$v'"
fi
;;
esac
done
fi
;;
esac
case $abi in
esac
p=0
eval "
for a in $abi
do eval \$a
eval \"
case \\\$LD_LIBRARY\${v}_PATH: in
;;
*) x=\\\$LD_LIBRARY\${v}_PATH
case \\\$x in
''|:*) ;;
*) x=:\\\$x ;;
esac
export LD_LIBRARY\${v}_PATH
p=1
;;
esac
\"
done
"
case $LD_LIBRARY_PATH in
'') ;;
*) for d in $lib
do case $HOSTTYPE in
*64) if test -d ${d}64
then d=${d}64
fi
;;
esac
case :$LD_LIBRARY_PATH: in
*:$d:*) ;;
*) if test -d $d
then LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$d
p=1
fi
;;
esac
done
;;
esac
case $p in
1) $show LD_LIBRARY_PATH=$LD_LIBRARY_PATH
$show export LD_LIBRARY_PATH
export LD_LIBRARY_PATH
;;
esac
case $LIBPATH: in
$INSTALLROOT/bin:$INSTALLROOT/lib:*)
;;
*) case $LIBPATH in
esac
LIBPATH=$INSTALLROOT/bin:$INSTALLROOT/lib:$LIBPATH
$show LIBPATH=$LIBPATH
$show export LIBPATH
export LIBPATH
;;
esac
case $SHLIB_PATH: in
$INSTALLROOT/lib:*)
;;
*) SHLIB_PATH=$INSTALLROOT/lib${SHLIB_PATH:+:$SHLIB_PATH}
$show SHLIB_PATH=$SHLIB_PATH
$show export SHLIB_PATH
export SHLIB_PATH
;;
esac
case $DYLD_LIBRARY_PATH: in
$INSTALLROOT/lib:*)
;;
*) DYLD_LIBRARY_PATH=$INSTALLROOT/lib${DYLD_LIBRARY_PATH:+:$DYLD_LIBRARY_PATH}
$show DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH
$show export DYLD_LIBRARY_PATH
export DYLD_LIBRARY_PATH
;;
esac
case $_RLD_ROOT in
$INSTALLROOT/arch*) ;;
/|*:/) _RLD_ROOT=$INSTALLROOT/arch:$_RLD_ROOT ;;
*) _RLD_ROOT=$INSTALLROOT/arch:$_RLD_ROOT:/ ;;
esac
$show _RLD_ROOT=$_RLD_ROOT
$show export _RLD_ROOT
export _RLD_ROOT
# now set up PATH
#
# NOTE: PACKAGEROOT==INSTALLROOT is possible for binary installations
case $PATH: in
$PACKAGEROOT/bin:*)
;;
*) PATH=$PACKAGEROOT/bin:$PATH
;;
esac
case $PATH: in
$INSTALLROOT/bin:*)
;;
*) PATH=$INSTALLROOT/bin:$PATH
;;
esac
$show PATH=$PATH
$show export PATH
export PATH
;;
*) for i in package proto nmake
do if onpath $i
then EXECROOT=`echo $_onpath_ | sed -e 's,//*[^/]*//*[^/]*$,,'`
EXECTYPE=`echo $EXECROOT | sed -e 's,.*/,,'`
break
fi
done
case $HOSTTYPE in
$EXECTYPE)
OCC=$CC
CC=cc
hostinfo type
EXECTYPE=$_hostinfo_
case $HOSTTYPE in
$EXECTYPE)
echo "$command: $CC: seems to be a cross-compiler" >&2
echo "$command: set HOSTTYPE to something other than the native $EXECTYPE" >&2
exit 1
;;
esac
;;
esac
$show EXECTYPE=$EXECTYPE
$show export EXECTYPE
export EXECTYPE
;;
esac
$show EXECROOT=$EXECROOT
$show export EXECROOT
export EXECROOT
# use these if possible
OK=ok
MAKE=nmake
# grab a decent default shell
case $KEEP_SHELL in
0) executable "$SHELL" || SHELL=
case $SHELL in
?*) checksh $SHELL || SHELL= ;;
esac
case $SHELL in
case $SHELL in
esac
for i in ksh sh bash
do if onpath $i && checksh $_onpath_
then SHELL=$_onpath_
break
fi
done
;;
*/*ksh) if executable $KSH
then SHELL=$KSH
fi
;;
esac
;;
esac
case $SHELL in
;;
case $? in
;;
$SHELL -c "date | $SHELL -c 'read x'"
case $? in
0) ;;
esac
;;
esac
;;
esac
export SHELL
$show SHELL=$SHELL
$show export SHELL
COSHELL=$SHELL
export COSHELL
$show COSHELL=$COSHELL
$show export COSHELL
# tame the environment
case $action in
use) ;;
*) ENV=
ERROR_OPTIONS=
export ENV ERROR_OPTIONS
;;
esac
# finalize the views
case $USER_VPATH in
'') case $VPATH in
?*) IFS=':'
set '' $VPATH
shift
IFS=$ifs
USER_VPATH=
for i
do case $i in
*/arch/$HOSTTYPE) ;;
*/arch/*/*) ;;
*/arch/*) continue ;;
esac
if packageroot $i
then case $USER_VPATH in
'') USER_VPATH=$i ;;
?*) USER_VPATH=$USER_VPATH:$i ;;
esac
fi
done
esac
;;
esac
case $USER_VPATH in
?*) IFS=':'
set '' $USER_VPATH
shift
IFS=$ifs
USER_VPATH=
USER_VPATH_CHAIN=
p=$PACKAGEROOT
for i
do case $i in
''|$PACKAGEROOT|$INSTALLROOT)
;;
?*) USER_VPATH=$USER_VPATH:$i
USER_VPATH_CHAIN="$USER_VPATH_CHAIN $p $i"
p=$i
case $PROTOROOT in
esac
;;
esac
done
;;
esac
;;
esac
PACKAGESRC=$PACKAGEROOT/lib/package
PACKAGEBIN=$INSTALLROOT/lib/package
case $action:$run in
use:-) set '' $args
shift
case $# in
0) ;;
*) shift ;;
esac
run="$@"
;;
esac
# HOSTTYPE specific package profile
if test -r $INSTALLROOT/lib/package/profile
then . $INSTALLROOT/lib/package/profile
fi
# more cygwin hassles
case $HOSTTYPE in
cygwin.*)
lose=
case $CYGWIN in
*nontsec*)
lose=ntsec
;;
*ntsec*);;
rm -f $exe
: > $exe
if test -x $exe
then lose=ntsec
fi
;;
esac
case $CYGWIN in
*nobinmode*)
case $lose in
'') lose=binmode ;;
*) lose="$lose binmode" ;;
esac
;;
esac
case $lose in
exit 1
;;
esac
;;
esac
# set up the view state
VIEW_bin=$INSTALLROOT VIEW_src=$PACKAGEROOT VIEW_all="$INSTALLROOT $PACKAGEROOT"
vpath $INSTALLROOT $PACKAGEROOT $USER_VPATH_CHAIN
then $show vpath $INSTALLROOT $PACKAGEROOT $USER_VPATH_CHAIN
else VPATH=$INSTALLROOT:$PACKAGEROOT$USER_VPATH
$show VPATH=$VPATH
$show export VPATH
export VPATH
IFS=':'
set '' $VPATH
shift
IFS=$ifs
for i
do case $i in
*/arch/*/*)
VIEW_src="$VIEW_src $i"
;;
*/arch/*)
VIEW_bin="$VIEW_bin $i"
;;
*)
VIEW_src="$VIEW_src $i"
;;
esac
VIEW_all="$VIEW_all $i"
done
fi
# return 0 if arg in src|bin|all view
view() # [test] [-|type] [src|bin|all] file
{
case $1 in
-[dfsx])_view_T_=$1; shift ;;
*) _view_T_=-f ;;
esac
case $1 in
-) _view_t_= ;;
*) _view_t_=$1 ;;
esac
shift
case $1 in
all) shift; _view_v_=$VIEW_all ;;
bin) shift; _view_v_=$VIEW_bin ;;
src) shift; _view_v_=$VIEW_src ;;
*) _view_v_=$VIEW_all ;;
esac
case $1 in
/*) if test $_view_T_ $1
then _view_=$1
return 0
fi
;;
*) for _view_d_ in $_view_v_
do if test $_view_T_ $_view_d_/$1
then _view_=$_view_d_/$1
return 0
fi
done
;;
esac
_view_=
case $_view_t_ in
?*) echo $command: $1: $_view_t_ not found >&2 ;;
esac
return 1
}
# determine the package and targets
case $action in
admin) case $admin_action in
results)action=$admin_action
set '' $admin_args
shift;shift
admin_args="admin $*"
case $admin_on in
'') target=$admin_args ;;
*) target="on $admin_on $admin_args" ;;
esac
;;
esac
;;
release)set '' $args
target=
while :
do shift
case $1 in
-|[0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789])
target="$target $1"
;;
*) break
;;
esac
done
package=$*
;;
setup) # { update read } with optional (bin|fun|include|lib) symlinks
# flat option sets up { bin fun include lib } symlinks from
# $INSTALLROOT to $PACKAGEROOT
# . is the package root
set '' $args
shift
types=
url=
while :
do case $# in
0) break ;;
esac
case $1 in
--) shift
break
;;
flat) flat=1 # backwards compatibility -- documentation dropped
;;
*://*|*.url)
url=$1
shift
break
;;
*) types="$types $1"
;;
esac
shift
done
if test ! -d $PACKAGEROOT/lib/package/tgz
then $exec mkdir -p $PACKAGEROOT/lib/package/tgz || exit
fi
case " $types " in
*" source "*)
case " $* " in
' ') ;;
*" INIT "*)
;;
set INIT "$@"
;;
esac
;;
esac
packages=`$0 $global authorize "$authorize" password "$password" update setup $types $url "$@" PACKAGEROOT=$PACKAGEROOT`
case $packages in
?*) $0 $global read $packages PACKAGEROOT=$PACKAGEROOT
esac
exit
;;
*) package=
target=
set '' $args
while :
do shift
case $# in
0) break ;;
esac
case $1 in
''|-) target="$target $package"
package=
;;
then package="$package $1"
else target="$target $package $1"
package=
fi
;;
esac
done
;;
esac
# flatten -- assumes symlink support
case $flat in
1) case $action in
make|read|setup|update|use|view)
if test ! -d $INSTALLROOT
then $exec mkdir -p $INSTALLROOT || exit
fi
for i in bin include lib fun man share
do if test ! -d $INSTALLROOT/../../$i
then $exec mkdir $INSTALLROOT/../../$i
fi
if test ! -d $INSTALLROOT/$i
then if test ! -h $INSTALLROOT/$i
then $exec ln -s ../../$i $INSTALLROOT/$i
fi
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
fi
fi
done
$exec rm -rf $INSTALLROOT/$i
$exec ln -s ../../$i $INSTALLROOT/$i
fi
done
;;
esac
;;
esac
# check that cmd args are up to date a.out's
{
case $PROTOROOT in
-) PROTOROOT=
case $* in
ratz) if test -f $INITROOT/ratz.c -a -w $PACKAGEROOT
#ifndef printf
#include <stdio.h>
#endif
!
}
/*
* small test for prototyping cc
*/
!
}
fi
;;
esac
test -f $INITROOT/hello.c -a -f $INITROOT/p.c -a -w $PACKAGEROOT || {
for i
do onpath $i || {
return 1
}
done
return 0
}
;;
*) _PACKAGE_cc=1
return 1
}
executable $INSTALLROOT/bin/nmake || {
# check for prototyping cc
# NOTE: proto.c must be K&R compatible
c=$?
rm -f p.*
test 0 != "$c" && {
export PROTOROOT
if test -d $PACKAGEROOT/src/cmd/nmake
then dirs="src/cmd/INIT src/lib/libast src/lib/libardir src/lib/libcoshell src/lib/libpp src/cmd/probe src/cmd/cpp src/cmd/nmake"
else dirs="src"
fi
(
if test -f $PROTOROOT/UPDATE
then newer="-newer $PROTOROOT/UPDATE"
else newer=""
fi
;;
*) $exec cd $PACKAGEROOT
;;
esac
)
export VPATH
fi
}
}
do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || return
done
;;
esac
;;
esac
case $_PACKAGE_cc in
*) _PACKAGE_cc=1 ;;
esac
;;
esac
for i
do eval j=\$_PACKAGE_AOUT_$i
case $j in
*) continue ;;
esac
then k=${k}1
else k=${k}0
fi
if executable $EXECROOT/bin/$i
then k=${k}1
else k=${k}0
fi
case $k in
esac
case $k in
return 1
;;
010) echo "$command: $i: not found: set CC=C-compiler or download the INIT package $HOSTTYPE binary to continue" >&2
return 1
;;
100) echo "$command: $i: not found: download the INIT package source or $HOSTTYPE binary to continue" >&2
return 1
;;
return 1
;;
esac
;;
continue
;;
continue
;;
1) continue ;;
esac
;;
esac
esac
else if test ! -d $INSTALLROOT/bin
do test -d $PACKAGEROOT/$j || $exec mkdir $PACKAGEROOT/$j || return
done
fi
then $exec $CC $CCFLAGS -o $INSTALLROOT/bin/$i $INITPROTO/$i.c || return
fi
proto:) test -d $INSTALLROOT/include || mkdir $INSTALLROOT/include
cmp -s $i.c $INSTALLROOT/include/prototyped.h 2>/dev/null || cp $i.c $INSTALLROOT/include/prototyped.h
;;
esac
fi
i=$PATH
PATH=$i
;;
esac
done
return 0
}
# check package requirements against received packages
{
case $1 in
source) r=$VIEW_SRC ;;
*) r=$VIEW_ALL ;;
esac
shift
case $1 in
'') x= ;;
*) x=$* ;;
esac
set ''
for d in $r
case $x in
;;
*) for p in $x
done
;;
esac
done
shift
e=0
x=$*
y=
n=
set ''
for i in $x
if test -f $i
then set "$@" $i
y="$y $p"
else case $p in
'*') ;;
*) n="$n $p" ;;
esac
fi
done
for i in $n
*" $i "*)
;;
e=1
;;
esac
done
case $e in
1) exit 1 ;;
esac
shift
q=
e=0
o=
while read p v r s
do q="$q
$v $r"
case $p in
$o) continue ;;
esac
case $s in
0) e=1
case $r in
esac
;;
esac
o=$p
done
case $e in
1) echo ERROR ;;
esac
}`
0) exit 1 ;;
esac
;;
# slide back 4 months
esac
esac
count=1
;;
esac
}
# write ordered package prerequisite list to the standard output
{
*) _order_a_= ;;
esac
_order_n_=$#
case $_order_n_ in
0) _order_p_=
do if test -f $_order_f_
then _order_p_="$_order_p_ $_order_f_"
fi
done
done
shift
esac
{
if test ratz != "$*"
do if view -s - src $_order_t_/$_order_f_$_order_a_.tim
then echo $_order_f_ $_order_f_
fi
done
fi
for _order_f_
do while :
do view - src $_order_f_ && break
case $_order_f_ in
*.pkg) ;;
*) _order_f_=$_order_f_.pkg; view - src $_order_f_ && break ;;
esac
case $_order_f_ in
*/*) ;;
*) _order_f_=lib/package/$_order_f_; view - src $_order_f_ && break ;;
esac
continue 2
done
case $_order_n_ in
0) view -s - src $_order_t_/$_order_p_$_order_a_.tim || continue ;;
esac
echo $_order_p_ $_order_p_
case $_order_p_ in
;;
*) echo INIT $_order_p_
;;
esac
{
op=::
while read line
do IFS=' \\'
set '' $line
IFS=$ifs
while :
do shift
case $# in
0) break ;;
esac
case $1 in
:*:) op=$1
;;
INIT|'$('*|*')')
;;
*) case $op in
:REQUIRES:)
req="$req$req_sep$1"
req_sep=" "
;;
esac
;;
esac
done
done
for _order_i_ in $req
do if view - src lib/package/$_order_i_.pkg
then case $_order_u_ in
0) view -s - src $_order_t_/$_order_i_$_order_a_.tim || continue ;;
esac
echo $_order_i_ $_order_i_; echo INIT $_order_i_; echo $_order_i_ $_order_p_
fi
done
} < $_order_f_
done
} | tsort
}
# generate the package component list in _components_
components() # [ package ]
{
_components_=
for p
do case $p in
'') ;;
INIT) case " $_components_ " in
*" $p "*) ;;
*) _components_="$_components_ $p" ;;
esac
;;
then p=$_view_
op=::
exec < $p
while read line
do IFS=' \\'
set '' $line
IFS=$ifs
while :
do shift
case $# in
0) break ;;
esac
case $1 in
:*:) op=$1
;;
INIT|'$('*|*')')
;;
*) case $op in
:PACKAGE:)
case " $_components_ " in
*" $1 "*) ;;
*) _components_="$_components_ $1" ;;
esac
;;
esac
;;
esac
done
done
elif test -d $PACKAGEROOT/src/cmd/$p -o -d $PACKAGEROOT/src/lib/$p
then _components_="$_components_ $p"
else echo "$command: $p: package or component not found" >&2
exit 1
fi
;;
esac
done
}
# list main environment values
showenv()
{
case $1 in
''|make)for __i__ in CC SHELL $env
do eval echo $__i__='$'$__i__
done
;;
esac
}
# capture command output
capture() # file command ...
{
case $make:$noexec in
:) case $action in
install|make|view)
o=$action
;;
*) case $package in
''|*' '*)
o=$action
;;
*) o=$package
;;
esac
;;
esac
case $action in
write) d=$PACKAGESRC/gen ;;
*) d=$PACKAGEBIN/gen ;;
esac
test -d $d || $exec mkdir $d
o=$d/$o
case $o in
$output)o=$o.out
s=
;;
*) output=$o
if test -f $o.old
if test -f $o.out
fi
elif test -f $o.out
do break
done
case $i in
*.1) i=2 ;;
*.2) i=3 ;;
*.3) i=4 ;;
*.4) i=5 ;;
*.5) i=6 ;;
*.6) i=7 ;;
*.7) i=8 ;;
*.8) i=9 ;;
*) i=1 ;;
esac
fi
o=$o.out
: > $o
note $action output captured in $o
s="$command: $action start at `date` in $INSTALLROOT"
case $quiet in
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 ;;
esac
;;
esac
case $quiet in
0) if executable ! $TEE
then TEE=tee
fi
{
case $s in
?*) echo "$s" ;;
esac
showenv $action
"$@"
;;
*) {
case $s in
?*) echo "$s" ;;
esac
showenv $action
"$@"
;;
esac
;;
*) $make "$@"
;;
esac
}
package_install() # dest sum
{
dest=$1 sum=$2
ot=
code=0
sed -e '/ /!d' -e 's,[^ ]* ,,' -e 's, \(arch/[^/]*\)/, \1 ,' -e '/ arch\//!s,^[^ ]* [^ ]* [^ ]*,& .,' -e 's,/\([^ /]*\)$, \1,' $sum |
while read mode user group arch dir file
do case $flat:$arch in
1:*|?:.)t=$dest/$dir ;;
*) t=$dest/$arch/$dir ;;
esac
case $t in
$ot) ;;
*) if test ! -d "$t"
then $exec mkdir -p "$t" || exit
fi
ot=$t
;;
esac
case $file in
?*) case $arch in
.) f=$dir/$file ;;
*) f=$arch/$dir/$file ;;
esac
if test -f "$f"
then t=$t/$file
case $quiet in
0) echo "$t" ;;
esac
$exec cp -f "$f" "$t" || code=1
$exec chmod $mode "$t" || code=1
fi
;;
esac
done
return $code
}
package_verify() # sum
{
$exec $SUM -cp $1
}
make_recurse() # dir
{
for _make_recurse_j in $makefiles
do if view - $1/$_make_recurse_j
then return
fi
done
if test -d $1
then case $exec in
'') echo :MAKE: > $1/Makefile || exit ;;
*) $exec "echo :MAKE: > $1/Makefile" ;;
esac
fi
}
get() # host path [ file size ]
{
case $HURL in
'') HURL=.
for i in wget lynx curl
do if onpath $i
then HURL=$i
break;
fi
done
AUTHORIZE="User-Agent: package AT&T Research\\r\\n"
case $HURL:$authorize in
.:?*) AUTHORIZE="${AUTHORIZE}Authorization: Basic `print -n -r -- $authorize:$password | uuencode -h -x base64`\\r\\n" ;;
esac
;;
esac
getfd=8
case $3 in
'') case $HURL in
.) host=$1
path=$2
while :
case $path in
/*) ;;
*) path=/$path ;;
esac
print "GET $path HTTP/1.0\\r\\nHost: $host\\r\\n$AUTHORIZE\\r" >&$getfd
cat <&8 > get.tmp
got=`sed -e 1q get.tmp`
case $got in
*" "200" "*)
: > get.err
code=0
break
;;
*" "30[123]" "*)
got=`sed -e '/^Location: /!d' -e 's,^Location: \(.*\)://\([^/]*\)\(/.*\),prot='\''\1'\'' host='\''\2'\'' path='\''\3'\'',' get.tmp`
case $got in
'') rm get.tmp
echo "$command: $action: $url: redirect error" >&2
exit 1
;;
esac
eval $got
;;
*) rm get.tmp
echo "$command: $action: $url: $got" >&2
echo '' "$got" > get.err
code=1
break
;;
esac
done
;;
curl) case $authorize in
'') curl -s -L -o get.tmp http://$1/$2 2> get.err; code=$? ;;
*) curl -s -L -o get.tmp -u "$authorize":"$password" http://$1/$2 2> get.err; code=$? ;;
esac
case $code in
then code=1
fi
;;
esac
;;
hurl) case $authorize in
'') hurl http://$1/$2 > get.tmp 2> get.err; code=$? ;;
*) hurl -a "$authorize":"$password" http://$1/$2 > get.tmp 2> get.err; code=$? ;;
esac
;;
lynx) case $authorize in
'') lynx -source http://$1/$2 > get.tmp 2> get.err; code=$? ;;
*) lynx -source -auth "$authorize":"$password" http://$1/$2 > get.tmp 2> get.err; code=$? ;;
esac
;;
wget) wget -nv -O get.tmp ${authorize:+--http-user="$authorize"} ${password:+--http-passwd="$password"} http://$1/$2 2> get.err
code=$?
;;
*) echo $command: $action: $HURL: url get command not found >&2
exit 1
;;
esac
if test 0 != "$code"
*[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
;;
*) cat get.err
;;
esac
echo $command: $action: $2: download failed >&2
exit 1
fi
;;
*) case $exec in
'') echo "$3 ($4 bytes):" >&2
case $HURL in
path=$2/$3
case $path in
/*) ;;
*) path=/$path ;;
esac
print "GET $path HTTP/1.0\\r\\nHost: $host\\r\\n$AUTHORIZE\\r" >&$getfd
read got <&$getfd
case $got in
*" 200 "*)
code=0
: > get.err
;;
*) echo '' "$got" > get.err
code=1
;;
esac
while read got <&$getfd
do case $got in
''|?) break ;;
esac
done
cat <&$getfd > get.tmp
;;
curl) case $authorize in
'') curl -s -L -o get.tmp http://$1/$2/$3 2> get.err; code=$? ;;
*) curl -s -L -o get.tmp -u "$authorize":"$password" http://$1/$2/$3 2> get.err; code=$?
esac
case $code in
then code=1
fi
;;
esac
;;
hurl) case $authorize in
'') ksh -x hurl http://$1/$2/$3 > get.tmp 2> get.err; code=$? ;;
*) ksh -x hurl -a "$authorize":"$password" http://$1/$2/$3 > get.tmp 2> get.err; code=$? ;;
esac
;;
lynx) case $authorize in
'') lynx -source http://$1/$2/$3 > get.tmp 2> get.err; code=$? ;;
*) lynx -source -auth "$authorize":"$password" http://$1/$2/$3 > get.tmp 2> get.err; code=$? ;;
esac
;;
wget) wget -nv -O get.tmp ${authorize:+--http-user="$authorize"} ${password:+--http-passwd="$password"} http://$1/$2/$3 2> get.err
code=$?
;;
*) echo $command: $action: $HURL: url get command not found >&2
exit 1
;;
esac
if test 0 != "$code"
*[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
;;
*) cat get.err
;;
esac
echo $command: $action: $3: download failed >&2
exit 1
fi
rm get.err
case $checksum:$5 in
:*|*:-) z=`wc -c < get.tmp`
case " $z " in
*" $4 "*)
;;
*) rm -f get.tmp
echo $command: $3: download error: expected $4 bytes, got $z >&2
exit 1
;;
esac
;;
case " $z " in
*" $5 "*)
;;
*) rm -f get.tmp
echo $command: $3: download $checksum error: expected $5, got $z >&2
exit 1
;;
esac
;;
esac
mv get.tmp $3 || exit
;;
*) echo "$3 ($4 bytes)" >&2
;;
esac
esac
}
# generate copyright notice
copyright()
{
if test -f $1.lic
then echo $1 package general copyright notice
echo
return 0
fi
case $1 in
then return 0
fi
;;
esac
return 1
}
# run remote make on host
{
host=$1
background=$2
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
1*) ;;
*) return ;;
esac
$main) ;;
esac
;;
esac
if $admin_ping $name >/dev/null 2>&1 || $admin_ping $name >/dev/null 2>&1
then cmd=". ./.profile"
.) root=
;;
;;
esac
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='"
case $admin_binary in
esac
;;
case $background in
esac
eval lst=$admin_list
case $admin_pkgs in
esac
fi
case $background in
esac
;;
esac
fi
}
# update package_src
checksrc()
{
case $package_src in
;;
*) package_src="$package_src $_i_"
;;
esac
done
;;
esac
}
# check for native ascii 0:yes 1:no
isascii()
{
case $__isascii__ in
005101|040412) __isascii__=0 ;;
*) __isascii__=1 ;;
esac
esac
return $__isascii__
}
exit 1
;;
esac
done
case $admin_action in
exit
;;
test) set $admin_args
while :
do case $# in
1) break ;;
esac
shift
case $1 in
*=*) ;;
*) admin_components=-$1
break
;;
esac
done
;;
esac
: all work done in $PACKAGESRC/admin
cd $PACKAGESRC/admin || exit
exec < $admin_db || exit
test -d $admin_log || $exec mkdir $admin_log || exit
esac
logs=
pids=
*" write binary "*|*" write "*" binary "*)
;;
*) admin_binary=
;;
esac
esac
index=0
''|'#'*);;
;;
*) case $admin_action in
case $f in
*[!0123456789]*) continue ;;
esac
;;
esac
*@*) IFS=@
user=${2}@
host=$3
;;
*) user=
;;
esac
case $x in
1) i=0
while :
do case $i in
$index) h=''
break
;;
esac
i=`expr $i + 1`
case $h in
$host) host=${admin_host}${i}
break
;;
esac
done
;;
esac
esac
;;
while :
do shift
shift
case $1 in
break
;;
esac
done
;;
;;
esac
;;
;;
esac
-*) continue
;;
*:*) case $admin_all in
0) continue ;;
esac
esac
IFS=:
;;
esac
shift
case $# in
0) ;;
1) root=$1
;;
;;
${admin_host}*)
;;
while :
do shift
shift
case $1 in
break
;;
esac
done
;;
x=${admin_host}$index
sync_hosts="$sync_hosts $sync $x"
sync=$x
;;
esac
;;
esac
;;
esac
;;
*) sync=
;;
esac
keep=1
;;
*) keep=0 ;;
esac
;;
esac
;;
*) admin_out="$admin_out $name"
;;
esac
esac
;;
;;
;;
esac
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
;;
esac
done
p=
for i in $admin_args
do p="$i $p"
done
for i in $p
then case $admin_pkgs in
esac
fi
done
: "admin_on :" "$admin_on"
case $admin_binary in
1) admin_bin_types=
0*) continue ;;
esac
continue
;;
esac
continue
;;
esac
" ") ;;
;;
*) continue
;;
esac
;;
;;
;;
esac
;;
esac
done
done
local=
;;
;;
esac
;;
esac
done
;;
esac
?*) while :
case $r in
*" $r "*) ;;
esac
;;
esac
done
break
;;
esac
done
;;
esac
done
for host in $remote_hosts
;;
esac
;;
esac
done
*1*) ;;
*) keep=0 ;;
esac
done
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
0*) continue ;;
esac
ditto) continue ;;
esac
case $admin_binary in
1*|?*1*);;
*) continue ;;
esac
;;
esac
;;
esac
main=
:*) ;;
*:0) continue ;;
esac
case $admin_binary in
1) case $s:$q in
:?*) continue ;;
esac
*" $i "*)
;;
*) continue
;;
esac
;;
esac
esac
echo package "$admin_args" "[ $n $t ]"
esac
done
0) admin_ditto_update=--update ;;
*) admin_ditto_update= ;;
esac
'') {
case $admin_binary:$sync in
test -x $PACKAGEROOT/bin/package && $admin_ditto $admin_ditto_update --remote=$rsh --expr="name=='package'" $PACKAGEROOT/bin $user$syncname:$root/bin
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
for dir in $package_src
esac
test -d $PACKAGEROOT/src/$dir && $admin_ditto $admin_ditto_update --remote=$rsh "$expr" $PACKAGEROOT/src/$dir $user$syncname:$root/src/$dir
done
;;
esac
case $admin_action in
ditto) ;;
?*) pids=
while :
do shift
case $# in
0) break
;;
1) remote $1
;;
*) remote $1 &
;;
esac
done
?*) wait $pids ;;
esac
;;
esac
} < /dev/null > $admin_log/$main_log 2>&1 &
;;
*) echo "{"
case $admin_binary:$sync in
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
for dir in $package_src
esac
test -d $PACKAGEROOT/src/$dir && echo $admin_ditto $admin_ditto_update --remote=$rsh "$expr" $PACKAGEROOT/src/$dir $user$syncname:$root/src/$dir
done
;;
esac
case $admin_action in
ditto) ;;
?*) pids=
while :
do shift
case $# in
0) break
;;
1) remote $1
;;
*) remote $1 "&"
pids=1
;;
esac
done
1) echo wait ;;
esac
;;
esac
echo "} < /dev/null > $admin_log/$main_log 2>&1 &"
;;
esac
;;
esac
done
done
'') # track the progress
0) cd $admin_log
cd ..
;;
esac
# wait for the remote actions to complete
wait
trap - 1 2 3 15
# update the db
exec < $admin_db || exit
exec 9>&1
D=`date +%y%m%d`
while read line
do set -- $line
case $1 in
''|'#'*|*=*)
;;
*" $2 "*)
E=`eval date -E \`egrep '[ ](start|done)[ ][ ]*at[ ]' $admin_log/$2 | sed -e 's/.*[ ][ ]*at[ ][ ]*//' -e 's/[ ][ ]*in[ ].*$//' -e 's/.*/"&"/'\``
M=$6 T=$7 W=$8
case $admin_action in
*) W=`grep '^[abcdefghijklmnopqrstuvwxyz][abcdefghijklmnopqrstuvwxyz]*:.' $admin_log/$2 | egrep -cv 'start at|done at|output captured|warning:|: package not found|whence: command not found'` ;;
esac
case $1 in
?|??|???|????|?????|??????|???????)
t1=' '
;;
????????|?????????|??????????|???????????|????????????|?????????????|??????????????|???????????????)
t1=' '
;;
*) t1=''
;;
esac
case $2 in
?|??|???|????|?????|??????|???????)
t2=' '
;;
*) t2=''
;;
esac
case $3 in
?|??|???|????|?????|??????|???????)
t3=' '
;;
*) t3=''
;;
esac
case $E in
?????) E=" $E" ;;
????) E=" $E" ;;
???) E=" $E" ;;
??) E=" $E" ;;
?) E=" $E" ;;
esac
case $M in
???) M="$M" ;;
??) M=" $M" ;;
?) M=" $M" ;;
'') M=" 0" ;;
esac
case $T in
???) T="$T" ;;
??) T=" $T" ;;
?) T=" $T" ;;
'') T=" 0" ;;
esac
case $W in
???) W="$W" ;;
??) W=" $W" ;;
?) W=" $W" ;;
'') W=" 0" ;;
esac
A=$1$t1
H=$2$t2
R=$3$t3
case $# in
[0-8]) O=
K=
;;
*) shift 8
O=$1
K=$2
case $O in
''|?|??|???) K=" $K" ;;
esac
case $# in
[0-2]) ;;
*) K="$K $*" ;;
esac
;;
esac
echo "$A $H $R $D $E $M $T $W $O $K"
echo "$A $H $R $D $E $M $T $W $O $K" >&9
continue
;;
esac
;;
esac
echo "$line"
;;
esac
;;
cd $PACKAGEROOT
exit
;;
# all work in $PACKAGESRC
cd $PACKAGESRC
# generate the package list
shift
argc=$#
case $# in
case $2 in
'*.pkg')
exit 1
;;
esac
shift
;;
esac
echo packages in $PACKAGEROOT
list) echo
echo "NAME${nl}VERSION${nl}RELEASE${nl}TYPE${nl}STATUS${nl}REQUIRES${nl}----${nl}-------${nl}-------${nl}----${nl}------${nl}--------" | pr -6 -a -o4 -t
;;
esac
{
omit=:
for pkg
case $3 in
*) ver=$3 ;;
esac
then sts=local
else sts=
fi
else ver=
fi
typ=
txt=
op=::
while read line
do IFS=' \\'
set '' $line
IFS=$ifs
while :
do shift
case $# in
0) break ;;
esac
case $1 in
:*:) op=$1
;;
INIT|'$('*|*')')
;;
*) case $op in
:DESCRIPTION:)
txt="$txt$sep$line"
break
;;
:PACKAGE:)
cmp="$cmp$cmp_sep$1"
cmp_sep=$nl
;;
:REQUIRES:)
req="$req$req_sep$1"
req_sep=" "
;;
esac
;;
esac
done
done
case $txt in
?*) txt="$nl$txt" ;;
esac
case :$ver: in
*::*) ;;
*) case $action in
list) case $sts in
"tgz/$pkg.tim"*)
sts=read
;;
*) sts=unread
;;
esac
;;
esac
echo "$pkg${nl}$ver${nl}base${nl}$typ${nl}$sts${nl}$req"
case $typ in
'') omit=$omit$pkg.$ver.base: ;;
esac
;;
*) case $req in
?*) req=": $req" ;;
esac
echo
echo $pkg $ver $req "$txt"
case $cmp in
?*) echo "${sep}Components in this package:$nl"
echo "$cmp" | pr -4 -o4 -t ;;
esac
;;
esac
;;
esac
fi
done
case $argc:$action in
0:list) if test -d tgz
then cd tgz
# 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,'`
case $t in
'') case $omit in
*:$p.$v.$r:*) continue ;;
esac
u=$p.tim
;;
*) u=$p.$t.tim
;;
esac
if test -s "$u"
then s=local
elif test -f "$u"
"$u"*) s=read ;;
*) s=unread ;;
esac
else s=unread
fi
echo "$p$nl$v$nl$r$nl$t$nl$s$nl"
done
fi
;;
esac
} |
case $action in
list) pr -6 -a -o4 -t | sort -u ;;
*) cat ;;
esac
case $argc in
0) if test -d $PACKAGEROOT/arch
then echo
echo architectures in $PACKAGEROOT
echo
for i in `ls $PACKAGEROOT/arch`
else h=
fi
echo $i
echo $h
echo
echo
done | pr -4 -a -o4 -t
fi
;;
esac
;;
copyright)
# all work in $PACKAGESRC
cd $PACKAGESRC
# generate the package list
set '' $target $package
shift
argc=$#
case $# in
shift
case $1 in
'*') echo $command: $action: no packages >&2
exit 1
;;
esac
;;
esac
checkaout proto || exit
for i
do copyright $i
done
;;
export) case $INSTALLROOT in
$PACKAGEROOT)
INSTALLROOT=$INSTALLROOT/arch/$HOSTTYPE
;;
esac
case $only in
0) v='$i=' ;;
*) v= ;;
esac
set '' $target $package
case $# in
1) set '' $env ;;
esac
while :
do case $# in
1) break ;;
esac
shift
i=$1
eval echo ${v}'$'${i}
done
;;
install)cd $PACKAGEROOT
set '' $package
shift
case $only in
0) set '' `order "$@"`
shift
;;
esac
case $# in
0) echo "$command: at least one package name expected" >&2
exit 1
;;
esac
package=$*
requirements - $package
set '' $target
shift
case $1 in
flat) flat=1 # backwards compatibility -- documentation dropped
shift
;;
esac
case $# in
0) echo "$command: $action: target directory argument expected" >&2
exit 1
;;
esac
target=
while :
do case $# in
1) directory=$1
break
;;
esac
target="$target $1"
shift
done
if test ! -d $directory
then echo "$command: $action: $directory: target directory not found" >&2
exit 1
fi
case $target in
'') cd arch
set '' *
shift
target=$*
cd ..
;;
esac
code=0
makecheck=1
for a in $target
do case $a in
-) a=$HOSTTYPE ;;
esac
case $flat:$a in
1:*|?:.)dest=$directory
;;
if test "" = "$exec" -a ! -d $dest
then mkdir -p $dest || {
echo "$command: $dest: destination directory must exist" >&2
exit 1
}
fi
;;
esac
for i in $package
do if test "ratz" = "$i"
then : skip
then echo "$command: $a: invalid architecture" >&2
elif test ! -d $dest
then echo "$command: $dest: destination directory must exist" >&2
else if test "" != "$makecheck"
then if onpath $MAKE
then MAKE=$_onpath_
else echo "$command: $MAKE: not found" >&2
exit 1
fi
makecheck=
fi
if test "" != "$exec"
then (
trap - 0 1 2 15
echo "=== $i installation manifest ==="
cd arch/$a
(
INSTALLROOT=$PACKAGEROOT/arch/$a
VPATH=$INSTALLROOT:$PACKAGEROOT:$VPATH
export INSTALLROOT VPATH
$MAKE -s $makeflags -f $i.pkg $qualifier list.installed $assign
) | sort -u
)
else (
set -
cd arch/$a
(
INSTALLROOT=$PACKAGEROOT/arch/$a
VPATH=$INSTALLROOT:$PACKAGEROOT:$VPATH
export INSTALLROOT VPATH
echo lib/$command
$MAKE -s $makeflags -f $i.pkg $qualifier list.installed $assign
) | sort -u | pax -drw -ps $dest
)
fi
fi
done
done
exit $code
;;
license)# all work in $PACKAGESRC/LICENSES
cd $PACKAGESRC/LICENSES || exit
# generate the package list
set '' $target $package
shift
argc=$#
case $# in
0) set '' *
shift
case $1 in
'*') echo $command: $action: no licenses >&2
exit 1
;;
esac
;;
*) checkaout proto || exit
a=
for i
do while :
do if test -f ../$i.lic
case $j in
?*) if test -f $j
then case " $a " in
*" $j "*) ;;
*) a="$a $j" ;;
esac
fi
break
;;
esac
fi
case $i in
*-*) i=`echo $i | sed 's/-[^-]*$//'`
;;
*) echo "$command: $i: package license not found" >&2
break
;;
esac
done
done
set '' $a
shift
;;
esac
for i
do case $exec in
'') echo
echo " --- $i source license ---"
echo
cat $i
;;
*) echo $PACKAGESRC/LICENSES/$i
;;
esac
done
;;
make|view)
cd $PACKAGEROOT
case $package in
;;
*) for i in $package
case $i in
esac
done
;;
esac
checksrc
requirements source $package
components $package
package=$_components_
# check for some required commands
must="$AR"
warn="$NM yacc bison"
test="$must $warn"
have=
IFS=:
set /$IFS$PATH
IFS=$ifs
shift
for t in $test
do if executable $t
then have="$have $t"
fi
done
for d
do for t in $test
do case " $have " in
*" $t "*)
;;
*) if executable $d/$t
then have="$have $t"
fi
;;
esac
done
done
case " $have " in
*" bison "*) ;;
*" yacc "*) have="$have bison" ;;
esac
case " $have " in
*" yacc "*) ;;
*" bison "*) have="$have yacc" ;;
esac
for t in $test
do case " $have " in
*" $t "*)
;;
*) case " $must " in
*" $t "*)
echo "$command: $t: not found -- must be on PATH to $action" >&2
exit 1
;;
*) echo "$command: warning: $t: not found -- some $action actions may fail" >&2
;;
esac
;;
esac
done
# verify the top view
if test ! -d $PACKAGEROOT/src
then note no source packages to make
exit 0
elif test ! -d $INSTALLROOT/src
then note initialize the $INSTALLROOT view
fi
for i in arch arch/$HOSTTYPE
do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit
done
for i in bin bin/$OK bin/$OK/lib fun include lib lib/package lib/package/gen src man man/man1 man/man3 man/man8
do test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit
done
make_recurse src
o= k=
for i in $makefiles
do case $o in
?*) o="$o -o" k="$k|" ;;
esac
o="$o -name $i"
k="$k$i"
done
o="( $o ) -print"
for d in $package_src
do i=src/$d
if test -d $i
then test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit
make_recurse $i
do case $j in
$k|$MAKESKIP) continue ;;
esac
test -d $INSTALLROOT/$i/$j ||
$exec mkdir -p $INSTALLROOT/$i/$j || exit
done
fi
done
def=
for i in $lic
do test -f $i || continue
$exec cp $PACKAGEROOT/$i $INSTALLROOT/$i
do case $j in
.) ;;
*) case " $def " in
*" $i "*) ;;
*) def="$def $i" ;;
esac
;;
esac
done
done
for i in $def
test -f $i || continue
$exec cp $PACKAGEROOT/$i $INSTALLROOT/$i
done
# check $CC and { ar cc ld ldd } intercepts
h="${HOSTTYPE} ${HOSTTYPE}.*"
case $HOSTTYPE in
*.*) t=`echo $HOSTTYPE | sed 's/[.][^.]*//'`
h="$h $t"
;;
*) t=$HOSTTYPE
;;
esac
case $t in
*[0123456789])
t=`echo $t | sed 's/[0123456789]*$//'`
h="$h $t"
;;
esac
case $CC in
cc) c=cc
b=$INSTALLROOT/bin/$c
t=$INSTALLROOT/lib/package/gen/$c.tim
intercept=0
for k in $h
do for s in $INITROOT/$c.$k
do test -x "$s" || continue
then intercept=1
break 2
fi
$t*) ;;
$b*) cc=$b
;;
$s*) cd $INSTALLROOT/lib/package/gen
tmp=pkg$$
test -x $tmp.exe
then case $HOSTTYPE in
esac
case $s in
?*) $exec sed "s/^HOSTTYPE=.*/HOSTTYPE=$HOSTTYPE/" < "$s" > "$b" || exit
$exec chmod +x "$b" || exit
cc=$b
intercept=1
note update $b
;;
esac
fi
$exec rm -f $tmp.*
$exec touch "$t"
cd $PACKAGEROOT
;;
esac
break 2
done
done
case $intercept in
1) c=ld
b=$INSTALLROOT/bin/$c
for k in $h
do for s in $INITROOT/$c.$k
do test -x "$s" || continue
$b*) ;;
$s*) $exec cp "$s" "$b"
note update $b
;;
esac
done
done
;;
esac
;;
esac
c=ldd
b=$INSTALLROOT/bin/$c
for t in $h
do s=$INITROOT/$c.$t
test -x "$s" || continue
onpath $c ||
$b*) ;;
$s*) $exec cp "$s" "$b"
note update $b
;;
esac
done
# following code stubbed out just in case ar.ibm.risc is needed
# c=ar
# b=$INSTALLROOT/bin/$c
# for t in $h
# do s=$INITROOT/$c.$t
# test -x "$s" || continue
# onpath $c ||
# $b*) ;;
# case $x in
# '') $exec cp "$s" "$b"
# note update $b
# ;;
# esac
# ;;
# esac
# done
case $cc in
/*) ;;
*) echo "$command: $CC: not found -- set CC=C-compiler" >&2
exit 1
;;
esac
case $exec in
'') cd $INSTALLROOT/lib/package/gen
tmp=pkg$$
test -x $tmp.exe
then : ok
else echo "$command: $CC: failed to compile this program:" >&2
cat $tmp.c >&2
if test -s $tmp.err
then cat $tmp.err >&2
else echo "$command: $CC: not a C compiler" >&2
fi
rm -f $tmp.*
exit 1
fi
rm -f $tmp.*
cd $PACKAGEROOT
;;
esac
# remember the default $CC
case $CC in
cc) ;;
*) if test -x $INSTALLROOT/bin/cc
then case `sed 1q $INSTALLROOT/bin/cc` in
": $CC :")
CC=cc
export CC
;;
*) assign="$assign CC=\"\$CC\""
;;
esac
else case $CROSS in
1) assign="$assign CC=\"\$CC\""
;;
*) case $exec in
'') {
echo ": $CC :"
echo "$CC \"\$@\""
} > $INSTALLROOT/bin/cc
chmod +x $INSTALLROOT/bin/cc
;;
*) note generate a $INSTALLROOT/bin/cc wrapper for $CC
;;
esac
CC=cc
export CC
;;
esac
fi
;;
esac
# no $INITROOT means INIT already installed elsewhere
if test -d $INITROOT
then
# update probe scripts
do test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit
done
j=$INITROOT/C+probe
$i*) ;;
*) if test -f $j -a -f $k
then note update $i
shellmagic
case $exec in
'') {
case $SHELLMAGIC in
?*) echo "$SHELLMAGIC" ;;
esac
cat $j $k
} > $i || exit
;;
*) echo "{
echo $SHELLMAGIC
cat $j $k
} > $i"
;;
esac
$exec chmod +x $i || exit
fi
;;
esac
fi
# initialize a few mamake related commands
checkaout mamake proto ratz release || exit
# execrate if necessary
then execrate=execrate
$make cd $INSTALLROOT/bin
for i in chmod chgrp cmp cp ln mv rm
do if test ! -x $OK/$i -a -x /bin/$i.exe
then shellmagic
case $exec in
chmod +x $OK/$i
;;
$exec chmod +x $OK/$i
;;
esac
fi
done
PATH=$INSTALLROOT/bin/$OK:$PATH
export PATH
else execrate=
fi
case $action in
view) exit 0 ;;
esac
# all work under $INSTALLROOT/src
$make cd $INSTALLROOT/src
# record the build host name
case $noexec in
'') hostinfo name
;;
esac
# make in parallel if possible
case $NPROC in
'') hostinfo cpu
case $_hostinfo_ in
0|1) ;;
*) NPROC=$_hostinfo_
$show NPROC=$NPROC
$show export NPROC
export NPROC
;;
esac
;;
esac
# separate flags from target list
case $target in
*-*) a=
for t in $target
do case $t in
-[eiknFKNV]*|--*-symbols)
makeflags="$makeflags $t"
;;
-*) nmakeflags="$nmakeflags $t"
;;
*) a="$a $t"
;;
esac
done
target=$a
;;
esac
# generate nmake first if possible
if executable ! $NMAKE && test -d $PACKAGEROOT/src/cmd/nmake
then if nonmake $MAKE
then note make $NMAKE with mamake
c=$CC
a=$assign
case $HOSTTYPE in
win32*|cygwin*)
CC="$CC -D_BLD_STATIC"
accept="libast"
case $assign in
*) assign="$assign CC=\"\$CC\"" ;;
esac
;;
*) accept=nmake
;;
esac
eval capture mamake \$makeflags \$nmakeflags \$noexec install nmake $assign
assign=$a
CC=$c
case $make$noexec in
'') if executable ! $NMAKE
then echo "$command: $action: errors making $NMAKE" >&2
exit 1
fi
;;
*) make=echo
;;
esac
if test '' != "$PROTOROOT"
vpath $INSTALLROOT - $PROTOROOT - $INSTALLROOT $PACKAGEROOT
then $show vpath $INSTALLROOT $PACKAGEROOT $USER_VPATH_CHAIN
else VPATH=$INSTALLROOT:$PACKAGEROOT$USER_VPATH
$show VPATH=$VPATH
export VPATH
fi
fi
note believe generated files for $accept
eval capture \$NMAKE \$makeflags \$nmakeflags \$noexec recurse believe \$nmakesep $accept $assign
$exec touch $INSTALLROOT/bin/.paths
note make the remaining targets with $NMAKE
else eval capture $MAKE \$makeflags \$nmakeflags \$noexec install nmake $assign
case $make$noexec in
'') if executable ! $NMAKE
then echo "$command: $action: errors making $NMAKE" >&2
exit 1
fi
;;
*) make=echo
;;
esac
fi
fi
# generate ksh next if possible
if nonmake $MAKE
then : no need to generate ksh next -- it could be the only package
elif test "$KEEP_SHELL" != 1 -a -d $PACKAGEROOT/src/cmd/ksh93 && executable ! $KSH
then eval capture nmake $nmakeflags \$makeflags \$noexec install ksh93 $assign
case $make$noexec in
'') if executable ! $KSH
then echo "$command: $action: errors making $KSH" >&2
exit 1
fi
;;
*) make=echo
;;
esac
fi
# mamprobe data should have been generated by this point
case $exec in
'') if test ! -f $INSTALLROOT/bin/.paths -o -w $INSTALLROOT/bin/.paths
then N='
'
b= f= h= n= p= u= B= L=
if test -f $INSTALLROOT/bin/.paths
then exec < $INSTALLROOT/bin/.paths
while read x
do case $x in
'#'?*) case $h in
'') h=$x ;;
esac
;;
*BUILTIN_LIB=*) b=$x
;;
*FPATH=*) f=$x
;;
*PLUGIN_LIB=*) p=$x
;;
*) case $u in
?*) u=$u$N ;;
esac
u=$u$x
;;
esac
done
fi
m=
case $p in
?*) b=
;;
esac
case $b in
?*) IFS='='
set $b
shift
p="PLUGIN_LIB=$*"
case $b in
esac
m=1
;;
esac
case $f in
'') f="FPATH=../fun"
m=1
;;
esac
case $h in
'') h='# use { no NO } prefix to permanently disable #' ;;
esac
case $p in
'') p="PLUGIN_LIB=cmd"
then p=no$p
fi
m=1
;;
esac
case $m in
1) case $u in
?*) u=$N$u ;;
esac
;;
esac
fi
;;
esac
# run from separate copies since nmake and ksh may be rebuilt
$make cd $INSTALLROOT/bin
if executable /bin/cp
fi
if executable /bin/mv
fi
if executable /bin/rm
fi
for i in \
do executable $i && {
test -f $OK/$i &&
test -f $OK/$i &&
test -f $OK/$i &&
echo "$command: $OK/$i: cannot update [may be in use by a running process] remove manually and try again" >&2
exit 1
;;
esac
}
}
done
if test -f ../lib/make/makerules.mo
then cmp -s ../lib/make/makerules.mo $OK/lib/makerules.mo ||
$exec $execrate $cp -p ../lib/make/makerules.mo $OK/lib/makerules.mo ||
fi
if executable $OK/nmake
then MAKE="$INSTALLROOT/bin/$OK/nmake LOCALRULESPATH=$INSTALLROOT/bin/$OK/lib"
fi
if executable $OK/tee
then TEE=$INSTALLROOT/bin/$OK/tee
fi
then SHELL=$INSTALLROOT/bin/$OK/ksh
export SHELL
export COSHELL
fi
*:$INSTALLROOT/bin/$OK:*)
;;
*) PATH=$INSTALLROOT/bin/$OK:$PATH
export PATH
;;
esac
$make cd $INSTALLROOT/src
;;
esac
# fall back to mamake if nmake not found or too old
esac
esac
fi
;;
;;
exit 1
;;
esac
PAX=
esac
fi
code=0
i=
x=
case $2 in
shift 2
target=$*
;;
;;
esac
case $# in
1) verbose=:
set '' `ls lib/package/$tgz/*?[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]* 2>/dev/null`
;;
*) verbose=
;;
esac
shift
for f
do if test -f "$f"
then : ok
else set '' `ls -r ${f}[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]* 2>/dev/null`
if test '' != "$2" -a -f "$2"
then 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"
then f=$2
continue
fi
fi
fi
done
exit 1
;;
esac
shift
for f
do case $f in
;;
;;
;;
;;
esac
done
gen=
while :
do shift
case $# in
0) break ;;
esac
f=$1
case $f in
continue
;;
continue
;;
*?[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]*)
;;
code=1
continue
;;
esac
case $f in
*) d= a=$f ;;
esac
# 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,'`
case $r in
*) y=$p.delta ;;
esac
*" $y "*)
continue
;;
esac
case $t in
q=
Q=
m=
;;
*) w=$PACKAGEROOT/arch/$t/lib/package
q=".$t"
Q="_$t"
m="[_.]$t"
;;
esac
u=$d$p$q.tim
if test -s "$u"
then continue
esac
continue
;;
esac
;;
esac
fi
case $p in
INIT) if test -f $PACKAGEROOT/bin/package
fi
;;
esac
z=
case $r in
base) # base archive
if test ratz = "$p"
then # ratz packages are not archives
case $t in
do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit
done
;;
do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit
done
;;
esac
code=1
continue
}
fi
done
;;
esac
esac || {
code=1
continue
}
code=1
continue
}
fi
code=1
continue
}
'') echo $f:
;;
;;
esac || {
code=1
continue
}
fi
if test -f $PACKAGEBIN/gen/$p.sum
esac
[01234567][01234567][01234567][01234567])
-) ;;
esac
-) ;;
esac
;;
esac
done < $PACKAGEBIN/gen/$p.sum
fi
fi
;;
*) # delta archive
code=1
continue
}
case `echo "$v:
$r:*) y=$p.base
b=${d}${p}_${r}${Q}.tgz
test -f "$b" || {
*" $b "*)
;;
*) case $# in
code=1
;;
*) shift
y=$1
shift
set '' $y $f "$@"
esac
continue
;;
esac
}
# -m with delta bug fixed 2005-02-08
code=1
continue
}
code=1
continue
}
;;
*) z=$d${p}[_.]$v$q.tgz
;;
esac
*" $f "*) ;;
esac
;;
*) b=${d}${p}_${v}${Q}.tgz
test -f "$b" || {
*" $b "*)
;;
*) case $# in
code=1
;;
*) shift
y=$1
shift
set '' $y $f "$@"
esac
continue
;;
esac
}
# -m with delta bug fixed 2005-02-08
code=1
continue
}
;;
esac
;;
code=1
continue
;;
esac
# check for ini files
if executable $w/$p.ini
code=1
continue
}
fi
# add to the obsolete list
k=
for i in `ls $d$p[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]????$m* $z 2>/dev/null`
do case $i in
*.md5) continue
;;
$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*)
continue
;;
esac
case $k in
*" $k "*) ;;
esac
;;
esac
k=$i
done
x="$x $y"
*" $u "*) ;;
esac
done
if test ! -f $PACKAGEROOT/bin/package -a -f $PACKAGEROOT/bin/package.old
fi
# drop obsolete archives
esac
# mark the updated archives
esac
# check the requirements
0) requirements - $x ;;
esac
exit $code
;;
regress)if test ! -d $PACKAGEBIN/gen
exit 1
fi
cd $dir
regress*)
;;
test*) if test -f regress.$s
then $exec mv regress.$s regress.old
fi
-e '/^TEST.\//s,/[^ ]*/,,' \
-e 's,[ ][ ]*$,,' \
-e 's/[0123456789][0123456789]*:* \([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789 ]*([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789 ]*[Cc][Oo][Rr][Ee][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789 ]*)\)/\1/' \
-e 's/\.sh failed at .* with /.sh failed /' \
> regress.$s
;;
;;
esac
;;
esac
done
if test -f regress.out -a -f regress.old
then $exec diff -b regress.out regress.old
exit 1
fi
;;
requirements source $package
shift
case $# in
0) ;;
*) case $1 in
-|[0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789])
case $1 in
esac
shift
case $1 in
-|[0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789])
case $1 in
-) hi= ;;
esac
shift
;;
esac
;;
[0123456789]|[0123456789][0123456789]|[0123456789][0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789][0123456789]*)
count=$1
shift
;;
esac
;;
esac
case $# in
esac
;;
;;
exit 1
;;
esac
;;
esac
echo
::) echo "All recorded changes follow." ;;
1::) echo "Changes since the last release follow." ;;
esac
x=
for r in $INSTALLROOT $PACKAGEROOT
do for s in $package_src
if test -d $d
then cd $d
then continue
fi
*" $i "*) continue ;;
esac
do if test -f $i/$f
x="$x $i"
for f in $i/*/$f
do if test -f $f
fi
done
break
fi
done
done
fi
done
done
;;
exit 1
;;
shift
esac
path=0
on=
while :
do case $# in
0) break ;;
esac
case $1 in
--) shift
break
;;
;;
;;
def=$1
errors:*:*) ;;
esac
;;
;;
exit 1
;;
esac
shift
esac
;;
;;
test) def=test
;;
*) break
;;
esac
shift
done
esac
;;
esac
case $# in
esac
m=
t=
for i
do k=0
shift
for j
do case $j in
-) case $k in
1) continue 2 ;;
esac
;;
*) if test -f $j
then k=1
case /$j in
*/test.*) t="$t $j" ;;
*) m="$m $j" ;;
esac
fi
;;
esac
done
exit 1
done
sep=
case $t in
0) for j in $t
do echo "$sep==> $j <=="
;;
errors) $exec egrep -i '\*\*\*|FAIL[ES]|^TEST.* [123456789][0123456789]* error|core.*dump' $j | sed -e '/^TEST.\//s,/[^ ]*/,,'
;;
;;
;;
esac
done
;;
1) echo $t
;;
esac
;;
esac
case $m in
;;
*) if test -f $HOME/.pkgresults
case $i in
'|'*) ;;
*) i="|$i" ;;
esac
else i=
fi
for j in $m
do echo "$sep==> $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 |
;;
esac
done
;;
esac
;;
1) echo $m
;;
esac
esac
;;
test) requirements source $package
0) only= ;;
esac
# must have nmake
exit 1
fi
# all work under $INSTALLROOT/src
$make cd $INSTALLROOT/src
# disable core dumps (could be disasterous over nfs)
# do the tests
;;
update) # download the latest release.version for selected packages
# all work in $PACKAGEROOT/lib/package/tgz
if test ! -d $PACKAGEROOT/lib/package/tgz
else cd $PACKAGEROOT/lib/package/tgz
fi
# get the architectures, update query url, and packages
source=
url=
while :
do shift
case $# in
0) break ;;
esac
case $1 in
--) shift
break
;;
;;
;;
;;
source) source=1
;;
*://*) url=$1
shift
break
;;
if test ! -s $urlfile
fi
break
;;
binary=1
;;
*) break
;;
esac
done
:) source=1 binary=1
;;
esac
;;
esac
if test ! -s $urlfile
fi
;;
*) default_url=
;;
esac
url=
then a=$authorize
*/*) ;;
esac
. $urlfile
case $a:$p in
;;
*) case $a in
?*) authorize=$a ;;
esac
case $p in
?*) password=$p ;;
esac
;;
esac
fi
;;
esac
?*) default_url= ;;
esac
# get the update list
1) source_packages=$* ;;
*) source_packages= ;;
esac
1) binary_packages=$* ;;
*) binary_packages= ;;
esac
package_hit=$*
;;
"
1) p=
do case $f in
*.????-??-??.????-??-??.*.*)
;;
*.????-??-??.????-??-??.*)
p=$p$nl$f
;;
*.????-??-??.*.*)
;;
*.????-??-??.*)
p=$p$nl$f
;;
esac
done
shift
;;
*) source_packages=
;;
esac
1) p=
do case $f in
*.????-??-??.????-??-??.*.*)
p=$p$nl$f
;;
*.????-??-??.????-??-??.*)
;;
*.????-??-??.*.*)
p=$p$nl$f
;;
*.????-??-??.*)
;;
esac
done
shift
;;
*) binary_packages=
;;
esac
;;
1) source_packages=$* ;;
*) source_packages= ;;
esac
1) binary_packages=$* ;;
*) binary_packages= ;;
esac
;;
esac
# get the latest updates
case $default_url in
case $authorize in
?*) chmod go-rwx $default_url ;;
esac
;;
esac
0) exec < got.tmp
while read name suffix type base base_size delta delta_size sync sync_size requires covers base_sum delta_sum sync_sum comment
''|-*) continue ;;
esac
IFS=:
for name
;;
;;
esac
done
;;
esac
;;
for name
;;
;;
esac
done
;;
esac
;;
esac
done
?*) x=$source_packages
*:$name:*) ;;
esac
done
*:$name:*) ;;
esac
done
;;
esac
;;
esac
for i in $checksum_commands
${checksum_empty}|${checksum_empty}[\ \ ]*)
checksum=$i
break
;;
esac
done
'') echo $command: warning: '{' $checksum_commands '}' command not found -- only download sizes will be checked >&2 ;;
esac
exec < got.tmp
while read name suffix type base base_size delta delta_size sync sync_size requires covers base_sum delta_sum sync_sum comment
-) i= ;;
*) i=.$type ;;
esac
-) j="$j -" ;;
esac
-) j="$j -" ;;
esac
echo $command: $j $base_size:$base_sum $delta_size:$delta_sum $sync_size:$sync_sum $requires >&2
esac
;;
*) package_hit="$package_hit $name"
;;
esac
then continue
fi
if test -f $lcl
esac
fi
then rmt=
case $sync:$sync_size in
-*|*[-:])
;;
if test -f $lcl
then rmt=1
fi
;;
esac
case $base:$base_size in
-*|*[-:])
;;
;;
esac
;;
esac
fi
case $delta:$delta_size in
-*|*[-:])
;;
if test -f $lcl
then case $checksum:$delta_sum in
esac
fi
then get $host $dir $lcl $delta_size $delta_sum
fi
;;
esac
;;
esac
;;
then continue
fi
*" - "*);;
;;
*) types_test="$types_test $type"
do if test -f $i
then types_local="$types_local $type"
fi
break
done
;;
esac
;;
*) continue
;;
esac
;;
;;
*) continue
;;
esac
;;
esac
if test -f $lcl
esac
fi
then rmt=
case $sync:$sync_size in
-*|*[-:])
;;
if test -f $lcl
then rmt=1
fi
;;
esac
case $base:$base_size in
-*|*[-:])
;;
;;
esac
;;
esac
fi
case $delta:$delta_size in
-*|*[-:])
;;
if test -f $lcl
else sum=X
fi
if test -f $lcl
then case $checksum:$delta_sum in
esac
fi
then get $host $dir $lcl $delta_size $delta_sum
fi
;;
esac
;;
esac
;;
esac
done
-) ;;
;;
;;
esac
;;
esac
;;
;;
esac
;;
esac
done
exec <&-
?*) echo $closure ;;
esac
;;
use) # finalize the environment
x=:..
for d in `( cd $PACKAGEROOT; ls src/*/Makefile src/*/Nmakefile 2>/dev/null | sed 's,/[^/]*$,,' | sort -u )`
do x=$x:$INSTALLROOT/$d
done
x=$x:$INSTALLROOT
$x:*) ;;
export CDPATH
;;
esac
$show P=$P
$show export P
export P
$show A=$A
$show export A
export A
case $_hostinfo_ in
0|1) ;;
*) NPROC=$_hostinfo_
export NPROC
;;
esac
;;
esac
eval PACKAGE_USE=$package_use
export PACKAGE_USE
# run the command
esac
;;
;;
esac
;;
verify) cd $PACKAGEROOT
if executable ! $SUM
exit 1
fi
set '' *
shift
target=$*
cd ..
;;
esac
code=0
shift
if test -f $1
then for i
do package_verify $i || code=1
done
fi
;;
fi
done
;;
esac
done
exit $code
;;
shift
list=
while :
do case $1 in
qualifier="$qualifier $1"
;;
type=$HOSTTYPE
eval list=$PACKAGESRC/tgz/$admin_list
;;
cyg) qualifier="$qualifier $1"
only=1
;;
runtime|source)
action=$1
;;
tst) qualifier="$qualifier tgz"
;;
;;
*) break
;;
esac
shift
done
exit 1
;;
esac
shift
shift
;;
esac
case $# in
exit 1
;;
esac
exit 1
fi
# all work under $PACKAGEBIN
$make cd $PACKAGEBIN
esac
# go for it
for package
then eval capture \$MAKE \$makeflags -X ignore \$noexec -f \$package.pkg \$qualifier \$action $assign
fi
done
;;
shift
case $1 in
binary|source)
action=$1
shift
;;
esac
order "$@"
;;
exit 1
;;
esac