Skip to content

Commit

Permalink
Fixes #37545 - Fix package_action for dash
Browse files Browse the repository at this point in the history
Ubuntu-24.04 defaults to dash
  • Loading branch information
m-bucher authored and adamruzicka committed Jun 20, 2024
1 parent 274a71d commit b61f0c5
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions app/views/templates/script/package_action.erb
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,27 @@ handle_zypp_res_codes () {
end
end
-%>
OUTFILE=$(mktemp)
trap "rm -f $OUTFILE" EXIT
set -o pipefail
run_cmd()
{
LANG=C apt-get -o APT::Get::Upgrade-Allow-New="true" -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -y <%= input("options") %> <%= action %> <%= input("package") %> 2>&1
}
export DEBIAN_FRONTEND=noninteractive
apt-get -y update
LANG=C apt-get -o APT::Get::Upgrade-Allow-New="true" -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -y <%= input("options") %> <%= action %> <%= input("package") %> 2>&1 | tee $OUTFILE
RETVAL=$?
if grep -q "Unable to locate" $OUTFILE && [ "<%= action %>" = "remove" ]; then
true
if [ "<%= action %>" = "remove" ]; then
OUTFILE=$(mktemp)
trap "rm -f $OUTFILE" EXIT
run_cmd > $OUTFILE
RETVAL=$?
cat $OUTFILE
if grep -q "Unable to locate" $OUTFILE; then
RETVAL=0
fi
else
setReturnValue() { RETVAL=$1; return $RETVAL; }
setReturnValue $RETVAL
run_cmd
RETVAL=$?
fi
setReturnValue() { RETVAL=$1; return $RETVAL; }
setReturnValue $RETVAL
<% elsif package_manager == 'zypper' -%>
<%-
if action == "group install"
Expand Down

0 comments on commit b61f0c5

Please sign in to comment.