POSTINSTALL scriptlet may fail if data/tmp/ is present but empty

Description

The “Clean out the data directory" step of the package postinstall script checks whether ${ROOT_INST}/data/tmp is a directory.

If it is, the script runs find "$ROOT_INST/data/tmp"/* -maxdepth 0 -name README -prune -o -print0 | xargs -0 rm -rf

However, if the tmp directory exists and is empty, the find command will exit with an error and a non-zero exit code.

This may cause package installation evaluation to assume that the install failed, resulting in the package manager also exiting with a non-zero exit code.

Environment

RHEL 7, RHEL 8, openSUSE Leap 15.4

Acceptance / Success Criteria

None

Activity

Show:

Jesse White July 12, 2023 at 3:03 PM

New PR:

Will Keaney June 30, 2023 at 1:41 PM

PR:

Will Keaney June 29, 2023 at 10:08 PM

This may be a suitable change:
find "$ROOT_INST/data/tmp/" -maxdepth 1 -mindepth 1 -name README -prune -o -print0 | xargs -0 rm -rf

Fixed

Details

Assignee

Reporter

Components

Affects versions

Priority

PagerDuty

Created June 29, 2023 at 9:32 PM
Updated July 12, 2023 at 6:05 PM
Resolved July 12, 2023 at 6:04 PM