core: fix logic of merging units
set -eux
set -o pipefail
+ # shellcheck source=test/units/assert.sh
+ . "$(dirname "$0")"/assert.sh
+
+ : >/failed
+
at_exit() {
if [[ -v UNIT_NAME && -e "/usr/lib/systemd/system/$UNIT_NAME" ]]; then
- rm -fv "/usr/lib/systemd/system/$UNIT_NAME"
+ rm -fvr "/usr/lib/systemd/system/$UNIT_NAME" "/etc/systemd/system/$UNIT_NAME.d" "+4"
fi
+
+ rm -f /etc/init.d/issue-24990
+ return 0
}
+# shellcheck source=test/units/assert.sh
+. "$(dirname "$0")"/assert.sh
+
trap at_exit EXIT
# Create a simple unit file for testing