Changes made in the v4_5 release of ups (1999-12-17): Added tests of the -C option to inhibit executing unchain actions in the declare and undeclare routines. Reworked the code some to emit -v messages when -C causes actions to be skipped. Added a "free" to match the "malloc" for the unchain in ups_declare.c Added code to override the -j option setting saved in the SETUP_prod environment variable when unsetting up a product either directly or indirectly by setting up a previously set up product. This prevents a dependent product's getting set up twice without an intervening unsetup in situations like the following: Product A has Product B as a dependent product. Product B is setup. Product A is setup with the -j option. Setting up Product A unsets up A with the -j from the SETUP_A environment variable, failing to unsetup B, but going on to set it up again. Made the upsutl_finish_up routine return an error status if a problem occurs, most likely in calls to the upsfil_flush routine. This prevents ups from exiting with a success code when a declare fails, due to file permission problems for example, which in turn confuses upd. Mapped the appropriate [un]declare action's option list to the various [un]chain actions in the get_ugo routine for its call to upsugo_bldcmd, and fixed the upsugo_next routine crash if we get null for the valid_option list. These changes allow table files to have setupRequired/Optional actions in chain stanzas (current, development, etc.) and not have ups crash when called with -H, as upd is wont to do. Changed the upsget_remall and upsget_allout routines in upsget.c to use the g_var_subs table to write environment variables to the temporary file. The initial motivation for this was to make a generic fix to crashes caused by attempts to use UPS_ENV in actions when no database is available, and hence some of the environment variables have null values. The other motivation is that is makes it easier to add items to the list to be written to the temporary file, and eliminates some redundant code. The upsget_allout and upsget_envout routines now use apostrophes for quoting values, rather than quote marks, which fixes the problem when defining SETUP_ with an -O "some options" string embedded in it. All environment variables are now quoted, and the formatting is a little easier to look at. Fixed the cat/man page copy code in upscpy.c to not get confused by dots occuring in directories or in product names (like kadmin.local, e.g.). Fixed the code to properly handle .z, .gz, and .Z extensions. It now also accepts most any subsection letter (but not g, z, or Z). Moved the UPSCPY informational messages from level 0 to level 1, meaning that the user will have to use -v with declare to see the long list of "UPSCPY: Copying man files" and similar messages. This change has the happy side-effect of clearing up much clutter in the testing process. Defined the UPS_UPS_DIR variable if UPS_ENV is specified, in upsget.c. Fixed the handling of the DB alias for the DATABASE keyword, so that ups list -KDB works. Enabled the -R option for the setup command. Added a ups(1) man page. Changed the command index passed to upsutl_finish_up by main to e_help if help is requested. This prevents a spurious /dev/null from being echoed for ups -?, ups setup -?, and ups unsetup -? commands. Option list clean-up items in upsact.c: - Removed dead options A:b:CD:O:p:r:T:u:U:V from the list for touch. - Removed all instances of the B: option, for now at least. - Removed the : from the e options. - Removed all instances of the h: option. - Removed options K:l from the list for verify. - Removed misleading options m:M: from the list for touch. - Removed option o from the list for modify. - Removed option V from the lists for declare, get, list and verify. - Removed option x, which will never be implemented. - Removed most items from the option list for help. - Made the ordering of the option lists consistent. Test case clean-up and other changes: - Changed the get (get3.in, get4.in, relchk.in) and action routine (fly1.in and fly2.in) test input files to reflect the changes in the quoting of environment variables in upsget.c. - Made the /dev/null output in the action (oregano.in) test disappear. - Added numerous real and bogus cat/man files (spot) to copy and ignore. - Doctored the declare test list (tostuff.in) to match the newly added cat/man files. - Made the blank line output in the depend test disappear (bee4.in). - Returned to using the lp account for tilde expansion checks in get (get1.in and get2.in). - Added UPS_UPS_DIR to get test output (get3.in, get4.in, relchk.in). - Added code to sort the undeclare action list (spot3.in), since it depends on file system order otherwise. Eliminated the old [un]setup.[c]sh scripts. Code clean-up items to eliminate compiler warnings: - Large number of void casts added to printf's, strcpy's, etc. - Added zero comparisons in some if, while, and ?: statements - Added the macro SHUTUP and routine shutup to pretend to use standardized parameters - Eliminated some empty else clauses - Moved some return statements to the bottom of the routine - Removed some unused parameters - Fixed the widening of some unsigned chars - Defined some missing prototypes, fix some function declarations - Added initializers to some declarations - Changed some NULL initializers to 0s - Fixed some "unreachable" breaks in switches Makefile clean-up items: - Added man and ups to the clean and spotless actions in the main Makefile