installpkg_parseargs

Synopsis

installpkg_parseargs

Description

It defines a local getargs array containing the various arguments accepted by installpkg and a helping function _installpkg_parseargs_set_mode_ to set and ensure the exclusivity of variable MODE.Then it redefines itself ,i.e. defines another function named installpkg_parseargs which is serves as callback function to getargs setting various variables.

If getargs returns unsuccessfully due to general option parsing errors or due to unsuccessful call to callback function or GETARGS_IND is more than $# ( ie no mass arguments were specified), the variables VERBOSE, RAW and ASK are redefined as they may affect the output and input behaviour while exiting.After which, installpkg_usage is called and functions returns non zero.

If call to getargs was successful and mass arguments are present, the variables ASK RAW MD5SUM ROOT overwrite MODE PARANOID VERBOSE are made readonly.MODE may already be readonly in case an argument setting a mode such as --warn was specified via a call to _installpkg_parseargs_set_mode_ through callback function of getargs.However, if no mode option was given, MODE with its default value is made readonly for rest of execution of the script.

On return, wether successfully or unsuccessfully, redefined installpkg_parseargs and _installpkg_parseargs_set_mode_ are unset, so that no function named installpkg_parseargs and _installpkg_parseargs_set_mode_ exists after a single call to installpkg_parseargs.This function, thus can be used only once.

For further details, refer doc for getargs.