The preserve class preserves a package object file by determining whether or not an existing file should be overwritten when the package is installed. Two possible scenarios when using a preserve class script are:
If the file to be installed does not already exist in the target directory, the file will be installed normally.
If the file to be installed exists in the target directory, a message describing the file exists is displayed, and the file is not installed.
Both scenario outcomes are considered successful by the preserve script. A failure occurs only, when in the second scenario, the file is unable to be copied to the target directory.
Starting with the Solaris 7 release, the i.preserve script and a copy of this script, i.CONFIG.prsv, can be found in the /usr/sadm/install/scripts directory with the other class action scripts.
#ident "$Header: i.CONFIG.prsv,v 12.1 1997/09/19 $" error=no echo "## checking common configuration files" while read src dest do [ "$src" = /dev/null ] && continue if [ -f "$dest" ] then echo $dest preserved else echo $dest cp $src $dest || error=yes fi done [ "$error" = yes ] && exit 2 exit 0 |
Modify the script to include the filename or filenames you would like to preserve.