update-pkg - A script which is used to update files within a package held in the data stream format.
update-pkg [-hIT] file [[src dest] ... ]
Required arguments are:
update-pkg.
Supported options are:
InstallPackage with those
in the package itself.
This is automatically used if there is no InstallPackage directory in the
current working directory.
template-control to process any package control script template
files.
This is automatically used if there is no InstallPackage directory in the
current working directory.
src is copied onto
dest which should be relative to the package's root; ie in
most cases should be a fully-qualified path. The exception to
this is with relocatable packages.
The dest file must already exist within the package, mainly since
we'd have to recreate the entire pkgmap file to cope otherwise.
This script allows you to update files within a package stored in a datastream format of
the type created by build-pkg. In this format the package is a single file which contains
all of the package; this type of package is much easier to deal with since it is just a
single file which can be easily moved around and given directly to pkgadd.
However updating files within this type of package is problematical due to it being a single file. Realistically the only way to update the package contents is to:
pkgtrans
<package name>/pkgmap file to account for changes in file size,
modes, checksums, etc.
pkgtrans
This script performs this task.
It will automatically update the package control scripts, calling template-control
to re-build package control scripts from any template files as required. It will also
update files in the distribution as directed by the end user.
The following example shows how we could update the package SItestpkg
stored in the datastream file SItestpkg.pkg with an updated test.conf
file which is available in the current working directory and will end up at
/usr/local/etc/test.conf when the package is installed:
update-pkg SItestpkg.pkg test.conf /usr/local/etc/test.conf
Simon Burr <simes@bpfh.net>
Copyright (c) 2003, Simon Burr <simes@bpfh.net> All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the author nor the names of its contributors may
be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.