We've been making do with a non-productized merge command
in the packaging gate; it's now time to finish this piece of
functionality.
Proposed man page for pkgmerge:
NAME
pkgmerge - merge multiple package variants together to form
multivariant packages.
SYNOPSIS
pkgmerge [-r] [-b] [-d repo_uri] -s variant_value,uri
-s variant_value,uri
[-s variant_value,uri ...] [ -M path-to-file ...]
variant_name [pkg FMRI ...]
DESCRIPTION
pkgmerge composites one or more sets of packages together,
producing one or more merged packages that have multiple variants,
and publishes the results to a image packaging repository.
Each pkg FMRI argument will be merged; if no pkg FMRIs are
specified pkgmerge will merge the latest version of each package
in the specified repositories; these versions must match (modulo
timestamp).
The default behavior is to produce merged package(s) containing
variant tags on any actions that are not identical across all
variants; in addition a set action is added to identify which
variant values this package supports.
If the -b (blend) option is selected, a package is produced that
combines the contents of both packages, with exactly duplicated
actions removed so only one copy is delivered. Contents unique to a
single package are included in the output; actions that have the
same key attribute but differ in any way result in an error. In
this case, no variant tags are used, and any set actions
describing the variants being blended are removed. This is useful
for packages that are shared via NFS to both architectures.
Packages that are not present in each repository are marked
as supporting only those variants for which packages are
available. It is an error if a package is present in a
repository but not at the correct version.
Pkgmerge will merge as many values as desired for the specifed
variant name. Existing other variants are unaffected.
OPTIONS
The following options are supported:
-b Blend two packages to form a single package
that implements both variants in a single
package.
-d repo_uri A URI representing the location of the target
repository. Both HTTP and filesystem-based
publication are supported. The default value is
http://localhost:10000/.
For filesystem-based publication, the repo_uri
should be specified as follows:
file://<absolute_path_to_repository>
-f cmd This option causes the named cmd to be invoked as
a filter on the merged manifest prior to
publication. If the cmd exits with a non-zero
exit status, processing will halt; if the output
of the filter is zero length then that package
will not be published. The -f option can be used
to do post-merge addition of package metadata or
other desired changes to packages using pkgmogrify.
May be repeated as needed; filters are pipelined
in the order specified.
-n Merge the manifests and run any specified filters
over them, but don't download files
or attempt to publish any packages. Useful for
checking results of merges.
-r This option causes pkgmerge to recursively
follow dependencies in the specified packages
as if they had been specified on the command line.
Dependencies that are not found in the current
repo are ignored.
-s variant_value,uri
This option specifies a repository as providing
packages with the specified value of the variant.
Both HTTP and filesystem repositories are supported.
-v This option causes pkgmerge to describe its
actions in detail; the output format is subject
to change and is not intended to be parsable.
EXAMPLES
Example 1: Merge kernel debug and non-debug builds together,
producing a single set of fat packages that allow customers
to select whether or not they wish to run a debug kernel. The
-r causes all packages mentioned in the osnet-incorporation to
be merged. The repo running on port 10001 contains non-debug
bits while the repo on 10002 contains debug bits. The resulting
merged packages are published to the repo running on port 10000.
pkgmerge -r -s false,http://localhost:10001 \
-s true,http://localhost:10002 debug.kernel \
consolidation/osnet/osnet-incorporation
Example 2: Merge sparc and x86 debug ON builds together
pkgmerge -r -s sparc,/mybuild/packages/sparc/nightly/repo.redist\
-s i386,/mybuild/packages/i386/nightly/repo.redist \
-d file:///mybuild/packages/merge/repo.redist arch \
consolidation/osnet/osnet-incorporation
Example 3: Merge debug and non-debug builds for both sparc and
x86 builds together to form a single repo that
supports debug and non-debug sparc and x86 packages.
pkgmerge -r -s
false,file:///mybuild/packages/sparc/nightly-nd/repo.redist\
-s true,file:///mybuild/packages/sparc/nightly/repo.redist \
-d file:///mybuild/packages/sparc/merge/repo.redist debug.osnet \
consolidation/osnet/osnet-incorporation
pkgmerge -r -s
false,file:///mybuild/packages/i386/nightly-nd/repo.redist\
-s true,file:///mybuild/packages/i386/nightly/repo.redist \
-d file:///mybuild/packages/i386/merge/repo.redist debug.osnet \
consolidation/osnet/osnet-incorporation
pkgmerge -r -s sparc,file:///mybuild/packages/sparc/merge/repo.redist\
-s i386,file:///mybuild/packages/i386/merge/repo.redist\
-d file:///mybuild/packages/merge/repo.redist arch \
consolidation/osnet/osnet-incorporation
Example 4: Merge a repo that already contains sparc and x86
merged packages with a repo that has a third architecture. Note
multiple specification of merged repo to permit merge of all
three architectures.
pkgmerge -r -s
sparc,file:///mybuild/packages/merge/nightly/repo.redist \
-s i386,file:///mybuild/packages/merge/nightly/repo.redist \
-s 6502,/experimental/packages/6502/nightly/repo.redist \
-d file:///mybuild/packages/sparc/merge/repo.redist arch \
consolidation/osnet/osnet-incorporation
Example 5: Merge sparc and x86 repos, running a check script
over the build:
pkgmerge -r -s
sparc,file:///mybuild/packages/sparc/nightly/repo.redist\
-s i386,file:///mybuild/packages/i386/nightly/repo.redist \
-d file:///mybuild/packages/merge/repo.redist arch \
-f '/mybuild/mycheckscript -f "test script"'
consolidation/osnet/osnet-incorporation
SEE ALSO
pkgmogrify(1) pkgrepo(1), pkgsend(1), pkg(5)
NOTES
The image packaging system is an under-development feature.
Command names, invocation, formats, and operations are all subject
to change. Development is hosted in the OpenSolaris community
at:
http://hub.opensolaris.org/bin/view/Project+pkg/
--
Bart Smaalders Solaris Kernel Performance
[email protected] http://blogs.sun.com/barts
"You will contribute more with mercurial than with thunderbird."
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss