The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Solaris::InstallDB - Manages Solaris package information

SYNOPSIS

use Solaris::InstallDB $instdb=Solaris::InstallDB::new(-directory => $dir, -loadContents);

DESCRIPTION

The Solaris::InstallDB class manages a directory of Solaris packages. It searches for all of the packages in a directory, and then records them in a hash table by name and architecture. It is also capable of spawning a Solaris::Contents object.

With this class, you can get a list of all packages available, and all architectures it supports. It can also report some basic system about the hardware it is running on.

CONSTRUCTOR METHOD

$instdb=Solaris::InstallDB::new(-directory => $dir, -loadContents);

The new method creates a Solaris::InstallDB object. By default, it will search for objects in the /var/sadm/pkg directory, but you can change that by using the -directory parameter.

If you want to create a Solaris::Contents object automatically, add the -loadContents flag.

OBJECT METHODS

release()

Returns the operating system release number in uname format. For example, if you were running a script on a Solaris 7 system, it would return 5.7.

releaseAlias()

Returns the commercial name of the operating system. For example, if you were running a script on an Intel system running Solaris 7, it would return 7_x86.

isa()

Returns the Instruction Set Architecture of the hardware.

processor()

Returns the processor type.

hardwareClass()

Returns the hardware class.

arch()

Returns a combination of the ISA and hardware class.

packages()

Returns a list of the packages found in the specified directory

arches($pkg)

Returns a list of architectures supported by a given package.

contents()

Returns the Solaris::Contents object that was created when the object was initialized.

package(-name => $pkg, -arch => $arch, -debug)

Returns a Solaris::Package object.

If -arch isn't specified, the object will search the database for a suitable match based on the system the script is running on.

If -debug is specified and the method fails to return a package object, an error message to STDOUT will explain why the method failed.

pkgFile(-name => $name, -arch => $arch)

Returns the filename of a particular package for the specified architecture

directory()

Returns the directory the object is looking for packages in

NOTES

This object only works on packages in the directory format, not the data stream format.

The code may seem a bit complex, but it's due to the fact that there are different package directories for the same package, but with different architectures.

Since I have a lot of code that gives hardware information, I may work on the idea of a Solaris::Hardware package during a later code revision.

AUTHOR

Chris Josephes, chrisj@onvoy.com