swvi [ -a ][ -r ]
With the swvi command the "software inventory file" is created or edited. This file ( ..sw_inventory ) contains the information about the software installed in a certain directory.
A "software inventory file" can be created by everyone having the permissions to write into the directory where the software is installed to. So the task to maintain the "software inventory file" and finally the software inventory of a system is not only dependent of the system administrator which has the root password.
This "software inventory files" spread over many directories on the system are collected with the sw_report command to generate either a plain ASCII- or a CSV report of all installed software.
To place this information into the same directory as the software is installed has the advantage that it is moved/copied if the directory containing the software is moved/copied to an other location. Furthermore it is more likely updated then a manually maintained list residing on some documentation server.
To create a new "software inventory file" you have to change to the directory where the software is installed and call the swvi command. An interactive dialog will query you information needed. All information except the SOFTWARE, VERSION, INST_USER and INST_GROUP fields are optional.
If there is already an existing ..sw_inventory file in the directory, the current file is loaded into vi for editing.
If a second software is installed into the same directory (what is often the case for /usr/local ) you can invoke swvi -a to append a new record to the file answering the interactive dialog.
Be aware that using the -a option will ensure that only one identical SOFTWARE, VERSION pair exists in one ..sw_inventory file.
The "software inventory file" is created with the permissions '644' and the user/group of the creating user. If the 'root' user invokes swvi the user/group setting of the overlying directory are set to ensure that the software owner (= the user ID that has been used to install the software) is able to modify the ..sw_inventory file in the future.
* = required entries
You might hear the argument, that maintaining a software inventory
that way is not needed at all, due to the fact that the operating
system provides this information via the built in software package
management mechanism.
But from experience, this is not sufficient for the most systems. Many
software is distributed in a variety of formats, and I personally know
not a single system administrator which creates for *each* piece of
software that is installed a software package that is recognized by
the operating system (rpm for Linux, SW-Depots for HP-UX,
pkg for Solaris, ...).
But at latest, when the date of migrating the system (and all installed
software and applications) to a newer one comes, the big
worries/questions/issues/no-go's/show-stoppers, however you like to name
it, about not knowing what is installed on the current system and a not
up-to-date software inventory, will come up. And this is one moment where
the usage
swvi
and
sw_report
really pays back.
This is free software; see edrc/doc/COPYING for copying conditions. There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.