Skip to content

Fix spec file post install script

Ani Sinha requested to merge anisinha/cloud-init:fix-c10s-spec into c10s

Jira: https://issues.redhat.com/browse/RHEL-33954

There is a missing "if" clause terminator ("fi") in the post-install script. This results in errors like the following when installing the rpm:

D: setexecfilecon: (/bin/sh, rpm_script_t)
+ '[' 2 -eq 1 ']'
/var/tmp/rpm-tmp.U0u5sz: line 43: syntax error: unexpected end of file
D: %post(cloud-init-24.1.4-2.el10.noarch): waitpid(5319) rc 5319 status 200
warning: %post(cloud-init-24.1.4-2.el10.noarch) scriptlet failed, exit status 2

Fix it. After this fix, we get:

D: %post(cloud-init-24.1.4-1.el10.anisinha202404251122.noarch): scriptlet start
D: %post(cloud-init-24.1.4-1.el10.anisinha202404251122.noarch): execv(/bin/sh) pid 5859
D: Plugin: calling hook scriptlet_fork_post in selinux plugin
D: setexecfilecon: (/bin/sh, rpm_script_t) 
+ '[' 2 -eq 1 ']'
+ '[' 2 -eq 1 ']'
+ '[' 2 -eq 2 ']'
+ '[' -f /etc/cloud/cloud.cfg.rpmnew ']'
+ /bin/systemctl is-enabled cloud-config.service
+ /bin/systemctl reenable cloud-config.service
D: %post(cloud-init-24.1.4-1.el10.anisinha202404251122.noarch): waitpid(5859) rc 5859 status 0

Fixes: 23abe3d5d237b0f037 ("Created .distro directory")

X-downstream-only: true

Signed-off-by: Ani Sinha anisinha@redhat.com

Merge request reports