PKGMERGE(1) User Commands PKGMERGE(1)

pkgmergeImage Packaging System package merging utility

pkgmerge [-n] -d dest_repo [-p publisher_prefix]... -s variant=value[,...],src_repo ... [pkg_fmri_pattern ...]

pkgmerge is a package publication tool for creating multi-variant packages. It does this by merging packages with identical names and versions (excluding time stamp), tagging actions that are unique in the versions being merged with the specified variant name and value for the given source, and then publishing the new packages to the target repository. Only the newest version of every package from each source is used.

If an action has the attribute pkg.merge.blend set to the name of the variant being merged, that action is copied to the other manifests prior to merging so that the action appears without any added variant tags in the final output. Note that the attribute pkg.merge.blend itself is removed from any actions in the output manifest. This attribute can be repeated with different values for multiple pass merges.

Non-identical actions that deliver to the same path in an input manifest result in pkgmerge exiting with an error.

After a pkgmerge operation, if your destination repository must support operations, run on the repository to update search indexes.

The following options are supported:

, -?
Display a usage message.
dest_repo
Specify the file system path or URI of the target repository to publish the merged packages to. The target repository must already exist. New repositories can be created using pkgrepo(1).
Perform a trial run with no changes made to the target repository.
publisher_prefix
Specify the name of the publisher from which to merge packages. This option can be specified multiple times.

By default, packages from all publishers in all source repositories are merged.

-s variant=value[,...],src_repo ...
Specify the variant name and value to use for packages from this source, followed by the file system path or URI of the source repository or package archive to retrieve packages from. Multiple variants can be specified separated by commas. The same variants must be named for all sources. This option can be specified multiple times.

The following operand is supported:

pkg_fmri_pattern
Specifies packages to merge. The pkg_fmri_pattern operand can include the ‘?’ and ‘*’ characters as glob(3C)-style wildcards to match one or more packages.

The following environment variable is supported:

The absolute path of the directory where temporary data should be stored during program execution. If not set, the default is to store temporary data in /var/tmp.

The following exit values are returned:

0
Command succeeded.
1
An error occurred.
2
Invalid command line options were specified.
99
An unanticipated exception occurred.

Example 1 Specify Variant Name and Value

Tag each package found in the specified source with the given variant name and value specified for the source it was retrieved from:

pkgmerge -s arch=sparc,http://src.example.com \
    -d http://dest.example.com

Sample package:

set name=pkg.fmri value=pkg://example/foo@5.11,200:20381001T163427Z
dir group=sys mode=0755 owner=root path=usr

Sample package after operation:

set name=pkg.fmri value=pkg://example/foo@5.11,200:20381001T163427Z
set name=variant.arch value=sparc
dir group=sys mode=0755 owner=root path=usr

Example 2 Merge and Publish Packages

Merge the newest version of each package from the given sources and publish the new packages to the target repository:

pkgmerge -s arch=sparc,http://src1.example.com \
    -s arch=i386,http://src2.example.com \
    -d /path/to/target/repository

Sample package from source 1 (SPARC):

set name=pkg.fmri \
  value=pkg://example.com/foo@5.11,5.11-0.200:20381001T121410Z
file id mode=0555 owner=root group=bin path=usr/bin/foo
dir group=sys mode=0755 owner=root path=usr

Sample package from source 2 (i386):

set name=pkg.fmri \
  value=pkg://example.com/foo@5.11,5.11-0.200:20381001T163427Z
file id mode=0555 owner=root group=bin path=usr/bin/foo
dir group=sys mode=0755 owner=root path=usr

Merged package:

set name=pkg.fmri \
  value=pkg://example.com/foo@5.11,5.11-0.200:20381001T163427Z
set name=variant.arch value=sparc value=i386
file id mode=0555 owner=root group=bin \
  path=usr/bin/foo variant.arch=sparc
file id mode=0555 owner=root group=bin \
  path=usr/bin/foo variant.arch=i386
dir group=sys mode=0755 owner=root path=usr

Example 3 Merge Debug and Non-Debug Packages for i386 and SPARC Systems

Merge the newest version of each package in a set of debug and non-debug repositories for i386 and SPARC systems:

pkgmerge -s arch=sparc,debug=false,/repo/sparc-nondebug \
    -s arch=sparc,debug=true,/repo/sparc-debug \
    -s arch=i386,debug=false,/repo/i386-nondebug \
    -s arch=i386,debug=true,/repo/i386-debug \
    -d /path/to/target/repository

Sample package from source 1 (SPARC non-debug):

set name=pkg.fmri \
  value=pkg://example.com/foo@5.11,5.11-0.200:20381001T121410Z
file id mode=0555 owner=root group=bin path=usr/bin/foo
dir group=sys mode=0755 owner=root path=usr

Sample package from source 2 (SPARC debug):

set name=pkg.fmri \
  value=pkg://example.com/foo@5.11,5.11-0.200:20381001T121411Z
file id mode=0555 owner=root group=bin path=usr/bin/foo
dir group=sys mode=0755 owner=root path=usr

Sample package from source 3 (i386 non-debug):

set name=pkg.fmri \
  value=pkg://example.com/foo@5.11,5.11-0.200:20381001T163427Z
file id mode=0555 owner=root group=bin path=usr/bin/foo
dir group=sys mode=0755 owner=root path=usr

Sample package from source 4 (i386 debug):

set name=pkg.fmri \
  value=pkg://example.com/foo@5.11,5.11-0.200:20381001T163428Z
file id mode=0555 owner=root group=bin path=usr/bin/foo
dir group=sys mode=0755 owner=root path=usr

Merged package:

set name=pkg.fmri \
  value=pkg://example.com/foo@5.11,5.11-0.200:20381001T163428Z
set name=variant.arch value=sparc value=i386
set name=variant.debug value=false value=true
file id mode=0555 owner=root group=bin path=usr/bin/foo \
  variant.arch=sparc variant.debug=false
file id mode=0555 owner=root group=bin path=usr/bin/foo \
  variant.arch=sparc variant.debug=true
file id mode=0555 owner=root group=bin path=usr/bin/foo \
  variant.arch=i386 variant.debug=false
file id mode=0555 owner=root group=bin path=usr/bin/foo \
  variant.arch=i386 variant.debug=true
dir group=sys mode=0755 owner=root path=usr

Example 4 Merge Using pkg.merge.blend

Merge packages for two architectures that do not collide, using the pkg.merge.blend attribute.

pkgmerge -s arch=sparc,http://src1/example.com \
    -s arch=i386,http://src2.example.com \
    -d /path/to/target/repository

Sample package from source 1 (SPARC):

set name=pkg.fmri \
  value=pkg://example.com/foo@5.11,5.11-0.200:20381001T121410Z
file 1d5eac1aab628317f9c088d21e4afda9c754bb76 mode=0555 owner=root \
  group=bin path=usr/bin/sparc/foo pkg.merge.blend=arch
file d285ada5f3cae14ea00e97a8d99bd3e357caadc0 mode=0555 owner=root \
  group=bin path=usr/bin/foo
dir group=sys mode=0755 owner=root path=usr

Sample package from source 2 (i386):

set name=pkg.fmri \
  value=pkg://example.com/foo@5.11,5.11-0.200:20381001T163427Z
file a285ada5f3cae14ea00e97a8d99bd3e357cb0dca mode=0555 owner=root \
  group=bin path=usr/bin/i386/foo pkg.merge.blend=arch
file d285ada5f3cae14ea00e97a8d99bd3e357caadc0 mode=0555 owner=root \
  group=bin path=usr/bin/foo
dir group=sys mode=0755 owner=root path=usr

Merged package:

set name=pkg.fmri \
  value=pkg://example.com/foo@5.11,5.11-0.200:20381001T163427Z
set name=variant.arch value=sparc value=i386
file d285ada5f3cae14ea00e97a8d99bd3e357caadc0 mode=0555 owner=root \
  group=bin path=usr/bin/foo
file a285ada5f3cae14ea00e97a8d99bd3e357cb0dca mode=0555 owner=root \
  group=bin path=usr/bin/i386/foo
file 1d5eac1aab628317f9c088d21e4afda9c754bb76 mode=0555 owner=root \
  group=bin path=usr/bin/sparc/foo
dir group=sys mode=0755 owner=root path=usr

Example 5 Merge Packages With Different Publisher Prefixes

Merge only packages with the prefix, even though other packages in these repositories have the prefix.

pkgmerge -p dev -s arch=sparc,http://src1.example.com \
    -s arch=i386,http://src2.example.com \
    -d /path/to/target/repository

pkg(1), pkgrepo(1), glob(3C), pkg(7)

February 17, 2022 OmniOS