installpkg_install package compression basename csize usize fulldesc [md5sum]
installpkg_install_state
installpkg_move_db_partial
Install the given package.The various arguments are:
Package the fullpath to package to be installed compression The compression utility to use basename the basename of the package csize the compressed size usize the uncompressed size fulldesc the variable name holding the full desc which should be used via indirection md5sum the md5sum if to be recorded or an empty argument
The global state variable for a call to installpkg_install is set to zero initially.It is set to 1 when installpkg_install is called and back to zero when it returns wether successfully or unsuccessfully.If the calling script is interrupted while installpkg_install was called but did not yet return, the value of this variable remains 1.This can be checked by a call to installpkg_install_state which returns the value of this variable.If the returned status is 1, a call to installpkg_move_db_partial should be done and also bkup should be restored.
If an error occurs while moving the temporary file to the actual database directory, the database file should be moved to the partial database directory. This is done by installpkg_move_db_partial.