Solaris::InstallDB - Manages Solaris package information
use Solaris::InstallDB $instdb=Solaris::InstallDB::new(-directory => $dir, -loadContents);
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.
$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.
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.
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.
Returns the Instruction Set Architecture of the hardware.
Returns the processor type.
Returns the hardware class.
Returns a combination of the ISA and hardware class.
Returns a list of the packages found in the specified directory
Returns a list of architectures supported by a given package.
Returns the Solaris::Contents object that was created when the object was initialized.
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.
Returns the filename of a particular package for the specified architecture
Returns the directory the object is looking for packages in
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.
Chris Josephes, firstname.lastname@example.org