5 Making Control Script Invocations of swremove DRD-Safe

This chapter describes how to safely invoke swremove in a control script. This assumes that swremove has been determined to be the best way to remove the desired files and update the IPD.

Invoking swremove in a control script is often done in new software to obsolete old software.

5.1 How to Make Packages DRD-Safe for swremove

If either of the following is true, the invocation of swremove in your control script is already DRD- safe:

1.If the software being removed does not have any remove control scripts (checkremove, preremove, postremove, or unconfigure), and updates are only delivered as new revisions (no current patches and no chance that it will have patches), then the use of swremove on that software is DRD-safe.

2.If the software being removed has the is_drd_safe attribute set, it is safe to swremove that software (from a DRD perspective). All HP-provided software for HP-UX 11i v3 and later is required to be DRD-safe and have the is_drd_safe attribute set.

If the software being removed is not DRD-safe, one of the following solutions should be used to make its removal DRD-safe, while keeping it update safe.

Solution 1:

Put the swremove invocation in the update_prep control script. New for HP-UX 11i v3 is the ability to deliver the update_prep script with an SD-product package (as a control_file specified in the PSF).

Cautions:

A swremove in an update_prep script will only get executed during an OE update. Therefore, software not included in OEs should not use this method.

A swremove in an update_prep script will remove the software so that it is not there during the update operation.

When to Use this Solution:

This solution is useful for:

OE software.

When removing HP-UX 11i v1 and/or HP-UX 11i v2 software.

When the software does not need to be there during the OE update operation.

Solution 2:

Put the invocation of the swremove command in a preinstall control script and include: –x run_scripts = false. This will avoid running control scripts that may not be DRD-safe.

Cautions:

No swremove control scripts will execute, so logic that is required for the removal of the software needs to be duplicated in the install control scripts invoking the swremove command.

When to use this solution:

This can be used for products not included in an OE that need to remove software:

And the software being removed has no logic required for the removal

Or the logic can be put in the preinstall from which the swremove is invoked.

Note that products not in an OE are usually updated by using swinstall rather than update_ux.