Skip to content

Commit

Permalink
set DEBIAN_FRONTEND and allow it to be passed into sudo context by …
Browse files Browse the repository at this point in the history
…default

fixes issues with any application that needs to use the debian frontend to interact with a user (such as used when restarting systemd services on reboot and accepting EULAs)

fixes wps-office install which requires ttf-mscorefonts-installer which asks to sign a EULA and would previously show a non-functional purple/pink screen (dialog)
  • Loading branch information
theofficialgman committed Mar 10, 2024
1 parent b9735d8 commit b83baff
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
7 changes: 7 additions & 0 deletions etc/runonce-entries
Original file line number Diff line number Diff line change
Expand Up @@ -403,4 +403,11 @@ runonce <<"EOF"
fi
EOF

#include DEBIAN_FRONTEND variable in sudo default environment if set
runonce <<"EOF"
sudo_popup sh -c "cat > /etc/sudoers.d/debian_frontend << _EOF_
Defaults env_keep += DEBIAN_FRONTEND
_EOF_"
EOF

true
2 changes: 1 addition & 1 deletion gui
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ generate_logo &

#install dependencies
runonce <<"EOF"
dependencies='yad curl wget aria2 lsb-release software-properties-common apt-utils apt-transport-https gnupg imagemagick bc librsvg2-bin locales shellcheck git wmctrl xdotool x11-utils rsync unzip debsums'
dependencies='yad curl wget aria2 lsb-release software-properties-common apt-utils apt-transport-https gnupg imagemagick bc librsvg2-bin locales shellcheck git wmctrl xdotool x11-utils rsync unzip debsums libgtk3-perl'
# Install dependencies if necessary
if ! dpkg -s $dependencies >/dev/null 2>&1; then
sudo_popup apt install $dependencies -y -f --no-install-recommends
Expand Down
2 changes: 1 addition & 1 deletion install
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fi
sudo apt update || error "The command 'sudo apt update' failed. Before Pi-Apps will work, you must fix your apt package-management system."

#install dependencies
dependencies='yad curl wget aria2 lsb-release software-properties-common apt-utils apt-transport-https gnupg imagemagick bc librsvg2-bin locales shellcheck git wmctrl xdotool x11-utils rsync unzip debsums'
dependencies='yad curl wget aria2 lsb-release software-properties-common apt-utils apt-transport-https gnupg imagemagick bc librsvg2-bin locales shellcheck git wmctrl xdotool x11-utils rsync unzip debsums libgtk3-perl'

if ! dpkg -s $dependencies &>/dev/null ;then
sudo apt install $dependencies -y -f --no-install-recommends || error "Pi-Apps dependencies failed to install and so the Pi-Apps install has been aborted. Before Pi-Apps can be installed you must solve any errors above."
Expand Down
5 changes: 5 additions & 0 deletions manage
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,11 @@ elif [ "$1" == 'install' ] || [ "$1" == 'uninstall' ];then
else
script_input=""
fi
#always overwrite DEBIAN_FRONTEND with gnome
#dialog and readline are not functional due to the logfile pipe
#noninteractive cannot be used as many debian scripts set their default as option as no (when the user needs to click yet) or do not allow for noninteractive use
#this will fallback to another option if the gnome dialog cannot be launched
export DEBIAN_FRONTEND=gnome
nice "${appscript[@]}" "$script_input" &> >(tee -a "$logfile")
exitcode="${PIPESTATUS[0]}"

Expand Down

0 comments on commit b83baff

Please sign in to comment.