|
|
To create a database file at the time of installation and save a copy on removal, you must:
This package requires three classes:
Notice in the sample prototype(F) file that none of the pathnames begin with a slash or a variable. This indicates that they are collectively relocatable.
The sample script initializes a database using the data files belonging to the admin class. To perform this task, it:
No special action is required for the admin class at removal time so no removal class action script is created. This means that all files and directories in the admin class will simply be removed from the system.
The sample removal script makes a copy of the database file before it is deleted during package removal. No special action is required for this class at installation time, so no installation class action script is needed.
Remember that the input to a removal script is a list of pathnames to remove. Pathnames always appear in lexical order with the directories appearing first. This script captures directory names so that they can be acted upon later and copies any files to a directory named /tmp. When all of the pathnames have been processed, the script then goes back and removes all directories and files associated with the cfgdata class.
The outcome of this removal script is to copy config.data to /tmp and then remove the config.data file and the data directory.