Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(PA-5786) Stop using posttrans for post-install steps #819

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 9 additions & 20 deletions resources/rpm/project.spec.erb
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,17 @@ fi


%post
<%- if @platform.is_aix? || (@platform.is_el? && @platform.os_version.to_i == 4) -%>
## EL-4 and AIX RPM don't have %posttrans, so we'll put them here
# Run postinstall scripts on install if defined
if [ "$1" -eq 1 ] ; then
# Run post-transaction scripts on install if defined
if [ -e %{_localstatedir}/lib/rpm-state/%{name}/install ] ; then
<%= get_postinstall_actions("install") %>
rm %{_localstatedir}/lib/rpm-state/%{name}/install
fi

# Run post-transaction scripts on upgrade if defined
if [ -e %{_localstatedir}/lib/rpm-state/%{name}/upgrade ] ; then
<%= get_postinstall_actions("upgrade") %>
rm %{_localstatedir}/lib/rpm-state/%{name}/upgrade
fi
<%- end -%>
<%- get_services.each do |service| -%>
# switch based on systemd vs systemv vs smf vs aix
#
Expand Down Expand Up @@ -352,21 +356,6 @@ fi
<%- end -%>


<%- unless @platform.is_aix? || (@platform.is_el? && @platform.os_version.to_i == 4) -%>
%posttrans
# Run post-transaction scripts on install if defined
if [ -e %{_localstatedir}/lib/rpm-state/%{name}/install ] ; then
<%= get_postinstall_actions("install") %>
rm %{_localstatedir}/lib/rpm-state/%{name}/install
fi

# Run post-transaction scripts on upgrade if defined
if [ -e %{_localstatedir}/lib/rpm-state/%{name}/upgrade ] ; then
<%= get_postinstall_actions("upgrade") %>
rm %{_localstatedir}/lib/rpm-state/%{name}/upgrade
fi
<%- end -%>

%files <%- unless get_directories.empty? -%>-f %{SOURCE1}<%- end -%>

<%- unless @bill_of_materials -%>
Expand Down