chpt14.txt revision 2525
2525N/A
2525N/A Chapter 14, Package Republication, describes how administrators
2525N/A can modify existing packages if needed for local conditions.
2525N/A
2525N/AOccasitionally administrators may wish or need to override attributes
2525N/Aor modify packages they did not produce. This may be to replace a
2525N/Aportion of the package with an internal implementation, or something
2525N/Aas simple as removing binaries not permitted on systems. While other
2525N/Apackaging systems provide various mechanisms to "force" installation,
2525N/Athe IPS team decided to make it easy to republish an existing package
2525N/Awith the desired modifications; this makes upgrade much easier since
2525N/Anew versions can be re-published with the same modifications. It also
2525N/Aallows the rest of the packaging system to function normally since
2525N/Ainstead of forcing IPS to ignore changes, we just change the
2525N/Apackages from the begining.
2525N/A
2525N/AOf course, running a system with a republished package may cause
2525N/Aissues with the support organization if any connection is suspected
2525N/Abetween observed problems and the modified package.
2525N/A
2525N/AThe basic steps are as follows:
2525N/A
2525N/A 1) pkgrecv the package to be re-published in a raw format. This
2525N/A pulls down the package under the specified directory in a special
2525N/A format: all of the files are named by their hash value, and
2525N/A the manifest is named "manifest". Remember to set any needed
2525N/A proxy configuration in the http_proxy environment variable.
2525N/A
2525N/A 2) Use pkgmogrify to modify the manifest in the desired manner.
2525N/A In order to prevent problems with machines caching package
2525N/A manifests, we always recommend deleting the timestamp from
2525N/A the internal package fmri.
2525N/A
2525N/A If changes are significant, running the resulting package
2525N/A through pkglint as shown in chapter 4 is a good idea.
2525N/A
2525N/A 3) Republish the package with pkgsend. Note that this republication
2525N/A will strip the package of any signatures that are present; to
2525N/A prevent a (harmless) warning message you may wish to remove
2525N/A signature actions in the pkgmogrify step.
2525N/A
2525N/A 4) Optionally, sign the package so that internal processes can be
2525N/A followed.
2525N/A
2525N/AHere's an simple manual example, where we change the pkg.summary field
2525N/Ato be "IPS has lots of features" instead of whatever was there originally:
2525N/A
2525N/A % mkdir republish; cd republish
2525N/A % pkgrecv -d . --raw -s http://pkg.oracle.com/solaris/release package/pkg
2525N/A % cd package* # package name contains a '/', and is url-encoded.
2525N/A % cd * # we pulled down just the latest package by default
2525N/A % cat > fix-pkg
2525N/A # change value of pkg.summary
2525N/A <transform set name=pkg.summary -> edit value '.*' "IPS has lots of features">
2525N/A # delete any signature actions
2525N/A <transform signature -> drop>
2525N/A # remove timestamp from fmri so we get our own
2525N/A <transform set name=pkg.fmri -> edit value ":20.+" "">
2525N/A ^D
2525N/A % pkgmogrify manifest fix-pkg > new-manifest
2525N/A % pkgrepo create ./mypkg
2525N/A % pkgrepo -s ./mypkg add-publisher solaris
2525N/A % pkgsend -s ./mypkg publish -d . new-manifest
2525N/A
2525N/A