Added a -R flag for redownloading all packages associated with an installer.

This commit is contained in:
Storm Dragon 2021-08-08 15:02:06 -04:00
parent a8c68bda89
commit 8952485f8b

View File

@ -307,6 +307,9 @@ download() {
dest="${dest//%20/ }" dest="${dest//%20/ }"
# Remove the destination file if it is empty. # Remove the destination file if it is empty.
test -s "${cache}/${dest}" || rm -f "${cache}/${dest}" 2> /dev/null test -s "${cache}/${dest}" || rm -f "${cache}/${dest}" 2> /dev/null
if [[ "${redownload}" == "true" ]] && [[ -e "${cache}/${dest}" ]]; then
rm -v "${cache}/${dest}"
fi
# Skip if the item is in cache. # Skip if the item is in cache.
test -e "${cache}/${dest}" && continue test -e "${cache}/${dest}" && continue
if ! wget -4 -O "${cache}/${dest}" "${i}" ; then if ! wget -4 -O "${cache}/${dest}" "${i}" ; then
@ -818,7 +821,7 @@ gameList=(
"Castaways 2" "Castaways 2"
#"Chopper Challenge" #"Chopper Challenge"
"Christmas WhoopAss" "Christmas WhoopAss"
#"Constant Battle" "Constant Battle"
"Copter Mission" "Copter Mission"
"Crazy Party" "Crazy Party"
"Crazy Tennis" "Crazy Tennis"
@ -927,6 +930,7 @@ declare -A command=(
[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." [P]="Print a list of packages required by audiogame-manager."
[R]="Redownload. Removes old versions of packages from cache before installing."
[r]="Remove a game. This will delete all game data." [r]="Remove a game. This will delete all game data."
) )
@ -951,6 +955,7 @@ while getopts "${args}" i ; do
l) game_launcher "${OPTARG}";; l) game_launcher "${OPTARG}";;
N) noCache="true";; N) noCache="true";;
P) checklist quiet;; P) checklist quiet;;
R) redownload="true";;
r) game_removal;; r) game_removal;;
esac esac
done done