Go to main content

Packaging and Delivering Software With the Image Packaging System in Oracle® Solaris 11.3

Exit Print View

Updated: July 2017
 
 

Transform Rules

This section shows an example transform rule and describes the parts of all transform rules.

In Oracle Solaris, files delivering in a subdirectory named kernel are treated as kernel modules and are tagged as requiring a reboot. The following tag is applied to actions whose path attribute value includes kernel:

reboot-needed=true

To apply this tag, the following rule is specified in the pkgmogrify rule file:

<transform file path=.*kernel/.+ -> default reboot-needed true>
delimiters

The rule is enclosed with < and >. The portion of the rule to the left of the -> is the selection section or matching section. The portion to the right of the -> is the execution section of the operation.

transform

The type of the rule.

file

Apply this rule only to file actions. This is called the selection section of the rule.

path=.*kernel/.+

Transform only file actions with a path attribute that matches the regular expression path=.*kernel/.+. This is called the matching section of the rule.

default

Add the attribute and value that follow default to any matching action that does not already have a value set for that attribute.

reboot-needed

The attribute being set.

true

The value of the attribute being set.

The selection or matching section of a transform rule can restrict by action type and by action attribute value. See the pkgmogrify man page for detail about how these matching rules work. Typical uses are for selecting actions that deliver to specified areas of the file system. For example, in the following rule, operation could be used to ensure that usr/bin and everything delivered inside usr/bin defaults to the correct user or group.

<transform file dir link hardlink path=usr/bin.* -> operation>

The pkgmogrify(1) man page describes the many operations that pkgmogrify can perform to add, remove, set, and edit action attributes as well as add and remove entire actions.