Skip to content

Commit

Permalink
Merge pull request #823 from puppetlabs/revert_post_install_change
Browse files Browse the repository at this point in the history
Revert "(PA-5786) Add ability to execute direct post installation scriptlets"
  • Loading branch information
isaac-hammes authored Oct 26, 2023
2 parents 79e113f + fdda3ee commit 0609756
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 37 deletions.
4 changes: 0 additions & 4 deletions lib/vanagon/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@ class Component
# activate_triggers is a one-dimentional Array of Strings, describing scripts that
# should be executed when a package identifies an activate trigger
attr_accessor :activate_triggers
# postinstall_required_actions is a two-dimensional Array, describing scripts that
# must be executed successfully after a given component is installed.
attr_accessor :postinstall_required_actions
# postinstall_actions is a two-dimensional Array, describing scripts that
# should be executed after a given component is installed.
attr_accessor :postinstall_actions
Expand Down Expand Up @@ -179,7 +176,6 @@ def initialize(name, settings, platform) # rubocop:disable Metrics/AbcSize
@install_triggers = []
@interest_triggers = []
@activate_triggers = []
@postinstall_required_actions = []
@postinstall_actions = []
@preremove_actions = []
@postremove_actions = []
Expand Down
10 changes: 0 additions & 10 deletions lib/vanagon/component/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -503,16 +503,6 @@ def add_debian_activate_triggers(activate_name)
@component.activate_triggers << OpenStruct.new(:activate_name => activate_name)
end

# Add post installation action that must exit successfully before restarting the service
#
# @param pkg_state [Array] the state in which the scripts should execute. Can be
# one or multiple of 'install' and 'upgrade'.
# @param scripts [Array] the Bourne shell compatible scriptlet(s) to execute
def add_postinstall_required_action(pkg_state, scripts)
check_pkg_state_array(pkg_state)
@component.postinstall_required_actions << OpenStruct.new(:pkg_state => Array(pkg_state), :scripts => Array(scripts))
end

# Adds action to run during the postinstall phase of packaging
#
# @param pkg_state [Array] the state in which the scripts should execute. Can be
Expand Down
12 changes: 0 additions & 12 deletions lib/vanagon/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -494,18 +494,6 @@ def get_postinstall_actions(pkg_state)
end
end

# Collects the postinstall packaging actions that must exit successfully for the project and it's components
# for the specified packaging state
#
# @param pkg_state [String] the package state we want to run the given scripts for.
# Can be one of 'install' or 'upgrade'
# @return [String] string of Bourne shell compatible scriptlets to execute during the postinstall
# phase of packaging during the state of the system defined by pkg_state (either install or upgrade)
def get_postinstall_required_actions(pkg_state)
scripts = components.flat_map(&:postinstall_required_actions).compact.select { |s| s.pkg_state.include? pkg_state }.map(&:scripts)
return ': no postinstall required scripts provided' if scripts.empty?
scripts.join("\n")
end
# Collects the preremove packaging actions for the project and it's components
# for the specified packaging state
#
Expand Down
11 changes: 0 additions & 11 deletions resources/rpm/project.spec.erb
Original file line number Diff line number Diff line change
Expand Up @@ -242,17 +242,6 @@ fi


%post
# Run required postinstall scripts on install if defined
if [ -e %{_localstatedir}/lib/rpm-state/%{name}/install ] ; then
<%= get_postinstall_required_actions("install") %>
rm %{_localstatedir}/lib/rpm-state/%{name}/install
fi

# Run required postinstall scripts on upgrade if defined
if [ -e %{_localstatedir}/lib/rpm-state/%{name}/upgrade ] ; then
<%= get_postinstall_required_actions("upgrade") %>
rm %{_localstatedir}/lib/rpm-state/%{name}/upgrade
fi
<%- 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
Expand Down

0 comments on commit 0609756

Please sign in to comment.