apply2sw_inventory

Package: WA2L/edrc 1.5.57
Section: General Commands (1)
Updated: 24 April 2007
Index Return to Main Contents

 

NAME

apply2sw_inventory - apply data stream with named swvi fields to software inventory file

 

SYNOPSIS

edrc/bin/apply2sw_inventory [ -h ]

apply2sw_inventory [ -d output_dir ] [ -r ]

 

AVAILABILITY

WA2L/edrc

 

DESCRIPTION

This is the scripting frontend to the interactive swvi command.

With apply2sw_inventory it is possible to automatically update a software inventory file in a install script without the need to enter the software inventory information by hand using the swvi command or to write directly to the ..sw_inventory file which format might change in future releases.

For more information about the software inventory creation and maintenance see swvi(1) and sw_report(1).

As in the swvi command, only the entries for SOFTWARE, VERSION, INST_USER and INST_GROUP are compulsory. The sequence of the entries provided is not significant. For a complete list and description of all entries see swvi(1).

See section EXAMPLES for common usages of apply2sw_inventory in an install script.

 

OPTIONS

-h
usage message.

-d output_dir
directory where the software inventory is modified.

-r
remove (clear) contents of an eventually existing inventory file. This option equals to the -r option of swvi. If not specified the software specification provided is appended (equals to swvi -a ) to the software inventory file.

 

ENVIRONMENT

-

 

EXIT STATUS

0
no error.

1
software inventory not modified.

2
operating system not supported, see osid(3).

3
cannot write to the output_dir directory.

4
usage displayed.

5
the command has been aborted pressing Ctrl+C.

6
apply2sw_inventory could not write to the target file.

 

FILES

..sw_inventory
software inventory file. This file contains the software information (version, name, ...) for a software installed into a certain directory and is used to create a software inventory with the sw_report(1) command.

 

EXAMPLES

1) Install script for automated installation of WA2L/edrc having an interactive install procedure

This are the major parts of a simplified installation script to give an idea of updating/creating the software inventory file without manual intervention.

This installation script installs WA2L/edrc that is available in the package file /dat/sw/apps/edrc-1.5.02/edrc-1.5.02-20070428.sh to the installation directory /opt. All manual input queried by the shell archive edrc-1.5.02-20070428.sh is provided via input redirection. After that the software inventory file is updated using apply2sw_inventory. Because in this case WA2L/edrc is the only software in the installation directory the probably existing software inventory file is cleared using the -r option ahead of writing to it.

#!/bin/sh
#
# My_INSTALL - My Install Script for: EDRC Shell archive 
#
# [00] 21.09.2005 CWa   Initial Version
#

# Const
PATH=$PATH:~edrc/bin ; export PATH
Installbasedir=/opt
Pkgfile=/dat/sw/apps/edrc-1.5.02/edrc-1.5.02-20070428.sh

# package installation
#
cat <<EOM | $Pkgfile
n
$Installbasedir
n
n
y
y
EOM

# update software inventory
#
cat <<EOM | apply2sw_inventory -r -d $Installbasedir/edrc
        SOFTWARE   = EDRC - Enterprise Disaster Recovery Console 
        VERSION    = 1.5.02
        INST_USER  = root
        INST_GROUP = root
        RUN_USER   =
        RUN_GROUP  =
        CFG_DIR    = etc
        VAR_DIR    = var
        LICENSE    = GNU GPL
        LIC_MGMT   =
        WEB        =
        DOC        = ~edrc/doc/edrc_manpages-1.5.02.pdf
        INST_SRC   = $Pkgfile
        PRODUCT    = System
        INSTANCE   =
        COMMENT    = disaster recovery and system administration
EOM

2) Install script of the GNU C compilers using a HP-UX depot

This are the major parts of a simplified installation script to give an idea of updating/creating the software inventory file without manual intervention.

This installation script installs the GNU C compilers that are available in the HP-UX depot file /dat/sw/apps/gcc-3.3.2/gcc-3.3.2-hppa-11.11.depot.gz to the installation directory /usr/local. The installation is performed with the swinstall command of HP-UX. After that the software inventory file is updated using apply2sw_inventory. Due to the fact that in /usr/local often many different software are installed the most likely existing software inventory should not be cleared ahead of writing to it. That's why apply2sw_inventory is called without the remove (clear) option.

#!/bin/sh
#
# My_INSTALL - My Install Script for: GNU C Compiler
#
# [00] 21.09.2005 CWa   Initial Version
#

# Const
PATH=$PATH:~edrc/bin ; export PATH
Installbasedir=/usr/local
Pkgfile=/dat/sw/apps/gcc-3.3.2/gcc-3.3.2-hppa-11.11.depot.gz

# package installation
#
cd /
swinstall -s $Pkgfile gcc

# update software inventory
#
cat <<EOM | apply2sw_inventory -d $Installbasedir
        SOFTWARE   = GNU C Compilers 
        VERSION    = 3.3.2 
        INST_USER  = root
        INST_GROUP = sys
        RUN_USER   =
        RUN_GROUP  =
        CFG_DIR    = 
        VAR_DIR    = 
        LICENSE    = GNU GPL
        LIC_MGMT   =
        WEB        = http://hpux.cs.utah.edu/hppd/hpux/Gnu/gcc-3.3.2
        DOC        = http://gcc.gnu.org 
        INST_SRC   = $Pkgfile
        PRODUCT    = Development
        INSTANCE   =
        COMMENT    =
EOM

 

SEE ALSO

edrcintro(1), sw_inventory(4) sw_report(1), swvi(1), fields2swvi(3)

 

NOTES

-

 

BUGS

-

 

AUTHOR

apply2sw_inventory was developed by Christian Walther. Send suggestions and bug reports to wa2l@users.sourceforge.net .

 

COPYRIGHT

Copyright © 2008 Christian Walther

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.


 

Index

NAME
SYNOPSIS
AVAILABILITY
DESCRIPTION
OPTIONS
ENVIRONMENT
EXIT STATUS
FILES
EXAMPLES
SEE ALSO
NOTES
BUGS
AUTHOR
COPYRIGHT

This document was created by man2html using the manual pages.
Time: 00:13:54 GMT, March 08, 2025