check-pkg - A script to aid in the checking to see if a package is correctly installed
check-pkg [-hvqs] [-e path] [pkg ...]
Supported options are:
-s
-v option if it was also
given. By default a full list of the errors with a package is displayed.
This script checks the contents of the /var/sadm/install/contents file
against what is actually on the machine it is running on. Any discrepancies
are shown.
With the use of the -e flag all this script will do is to check to see
what packages the given entry is from.
An optional list of packages can be given to constrain the checking to a sub-set of the packages installed on the system.
By default a full list of the errors for all packages is printed out. The format for this list is:
package<TAB>Entry<TAB>Reason
This list is sent to the standard output of the script. This display can
be disabled by the use of the -q flag. A summary of the work done can
be generated by the use of the -s flag; that is sent to the standard
error of the script.
In all cases if there are any errors in the packages checked, the script
will return an exit code of 1. Otherwise it returns an exit code of
0.
It is recommended that this script be run as root so that checksums for all files can be calculated.
pkgadd command. This file has the same format as pkgmap
files, with the addition of a space separated list of packages an entry has been
installed for at the end of the line for that entry.
This script takes a while to run as it has to parse the entire
/var/sadm/install/contents file.
Since this script contains the entire /var/sadm/install/contents file
as a data structure in memory, it can consume a lot of system memory;
on my machine it will use about 43Mb of memory with 42Mb resident.
The calculation of checksums for all files will probably require this
program to be run with root privilages. If this program is not
run as root there is a good chance that there will be files it can
not calculate a checksum for.
Simon Burr <simes@bpfh.net>
Copyright (c) 2002, 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.