Added -P flag to show a list of packages required by audiogame-manager.

This commit is contained in:
Storm Dragon 2021-05-10 13:38:30 -04:00
parent e258ed3450
commit d2b6119502

View File

@ -148,71 +148,92 @@ EOF
checklist() { checklist() {
declare -a errorList declare -a errorList
echo "Checking your system..." declare -a packageList
echo if [[ $# -eq 0 ]]; then
echo "Checking your system..."
echo
fi
if command -v wine &> /dev/null ; then if command -v wine &> /dev/null ; then
echo "Wine is installed." [[ $# -eq 0 ]] && echo "Wine is installed."
else else
errorList+=("Critical: Wine is not installed. You will not be able to play any games.") errorList+=("Critical: Wine is not installed. You will not be able to play any games.")
fi fi
packageList+=("wine")
if command -v winetricks &> /dev/null ; then if command -v winetricks &> /dev/null ; then
echo "Winetricks is installed." [[ $# -eq 0 ]] && echo "Winetricks is installed."
else else
errorList+=("Critical: Winetricks is not installed. This means wine cannot be configured, dependancies cannot be installed, and only self-voicing games have any chance of working.") errorList+=("Critical: Winetricks is not installed. This means wine cannot be configured, dependancies cannot be installed, and only self-voicing games have any chance of working.")
fi fi
packageList+=("winetricks")
if command -v wget &> /dev/null ; then if command -v wget &> /dev/null ; then
echo "Wget is installed." [[ $# -eq 0 ]] && echo "Wget is installed."
else else
errorList+=("Critical: Wget is not installed. You will not be able to install any games.") errorList+=("Critical: Wget is not installed. You will not be able to install any games.")
fi fi
packageList+=("wget")
if command -v dialog &> /dev/null ; then if command -v dialog &> /dev/null ; then
echo "Dialog is installed." [[ $# -eq 0 ]] && echo "Dialog is installed."
else else
errorList+=("Critical: Dialog is not installed. You will not be able to install, launch, or remove any games.") errorList+=("Critical: Dialog is not installed. You will not be able to install, launch, or remove any games.")
fi fi
packageList+=("dialog")
for i in 7z cabextract unzip xz ; do for i in 7z cabextract unzip xz ; do
if command -v $i &> /dev/null ; then if command -v $i &> /dev/null ; then
echo "${i^} is installed." [[ $# -eq 0 ]] && echo "${i^} is installed."
else else
errorList+=("Critical: ${i^} is not installed. You will not be able to install some games or their components.") errorList+=("Critical: ${i^} is not installed. You will not be able to install some games or their components.")
fi fi
packageList+=("$i")
done done
if command -v gawk &> /dev/null ; then if command -v gawk &> /dev/null ; then
echo "Gawk is installed." [[ $# -eq 0 ]] && echo "Gawk is installed."
else else
errorList+=("Warning: gawk is not installed. Game removal with -r will not work.") errorList+=("Warning: gawk is not installed. Game removal with -r will not work.")
fi fi
packageList+=("gawk")
if command -v ocrdesktop &> /dev/null ; then if command -v ocrdesktop &> /dev/null ; then
echo "Ocrdesktop is installed." [[ $# -eq 0 ]] && echo "Ocrdesktop is installed."
else else
errorList+=("Warning: ocrdesktop is not installed. It can help if the installer gets stuck to figure out what is happening.") errorList+=("Warning: ocrdesktop is not installed. It can help if the installer gets stuck to figure out what is happening.")
fi fi
packageList+=("ocrdesktop")
if command -v qjoypad &> /dev/null ; then if command -v qjoypad &> /dev/null ; then
echo "Qjoypad is installed." [[ $# -eq 0 ]] && echo "Qjoypad is installed."
else else
errorList+=("Warning: qjoypad is not installed. Qjoypad allows you to play keyboard only games with a gamepad.") errorList+=("Warning: qjoypad is not installed. Qjoypad allows you to play keyboard only games with a gamepad.")
fi fi
packageList+=("qjoypad")
if command -v unix2dos &> /dev/null ; then if command -v unix2dos &> /dev/null ; then
echo "Dos2unix is installed." [[ $# -eq 0 ]] && echo "Dos2unix is installed."
else else
errorList+=("Warning: unix2dos is not installed. Some games need a configuration file in dos format before they will run.") errorList+=("Warning: unix2dos is not installed. Some games need a configuration file in dos format before they will run.")
fi fi
packageList+=("unix2dos")
if command -v w3m &> /dev/null ; then if command -v w3m &> /dev/null ; then
echo "W3m is installed." [[ $# -eq 0 ]] && echo "W3m is installed."
else else
errorList+=("Warning: w3m is not installed. W3m is used to view game documentation.") errorList+=("Warning: w3m is not installed. W3m is used to view game documentation.")
fi fi
packageList+=("w3m")
if command -v xclip &> /dev/null ; then if command -v xclip &> /dev/null ; then
echo "Xclip is installed." [[ $# -eq 0 ]] && echo "Xclip is installed."
else else
errorList+=("Warning: Xclip is not installed. Some games may not speak or register properly.") errorList+=("Warning: Xclip is not installed. Some games may not speak or register properly.")
fi fi
packageList+=("xclip")
if command -v xdotool &> /dev/null ; then if command -v xdotool &> /dev/null ; then
echo "Xdotool is installed." [[ $# -eq 0 ]] && echo "Xdotool is installed."
else else
errorList+=("Warning: Xdotool is not installed. Some installers may not work or may need manual intervention.") errorList+=("Warning: Xdotool is not installed. Some installers may not work or may need manual intervention.")
fi fi
packageList+=("xdotool")
# Show the results # Show the results
if [[ $# -ne 0 ]]; then
for i in "${packageList[@]}" ; do
echo "$i"
done | sort
exit 0
fi
if [[ ${#errorList[@]} -eq 0 ]]; then if [[ ${#errorList[@]} -eq 0 ]]; then
echo "No problems found, you are good to go." echo "No problems found, you are good to go."
exit 0 exit 0
@ -695,6 +716,7 @@ declare -A command=(
[L]="Display license information." [L]="Display license information."
[l:]="Launch given game without interactive audiogame-manager menu specified by its wine bottle." [l:]="Launch given game without interactive audiogame-manager menu specified by its wine bottle."
[N]="No cache, delete the installer after it has been extracted." [N]="No cache, delete the installer after it has been extracted."
[P]="Print a list of packages required by audiogame-manager."
[r]="Remove a game. This will delete all game data." [r]="Remove a game. This will delete all game data."
) )
@ -718,6 +740,7 @@ while getopts "${args}" i ; do
L) license;; L) license;;
l) game_launcher "${OPTARG}";; l) game_launcher "${OPTARG}";;
N) noCache="true";; N) noCache="true";;
P) checklist quiet;;
r) game_removal;; r) game_removal;;
esac esac
done done