Fix update for Flatpak. (#8)

* Change to 2 spaced indent.

* Change flatpak to never "fail" so that update can be run on servers as well.

* Change indent to 2 spaces.

* Be fancier than an always-true.
This commit is contained in:
Hyperling 2021-08-14 12:43:42 -05:00 committed by GitHub
parent 37c5b122f8
commit 89961ad08f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 14 deletions

View File

@ -71,17 +71,24 @@
parrot_mirrors_suck=true parrot_mirrors_suck=true
sudo apt update --fix-missing sudo apt update --fix-missing
fi fi
done done &&
when: ansible_distribution == "Parrot OS" when: ansible_distribution == "Parrot OS"
- name: General | Facts | Package | Update Commands | flatpak (Linux)
- name: General | Facts | Package | Update Commands | flatpak | check
shell: which flatpak
register: flatpak_exec
ignore_errors: yes
- name: General | Facts | Package | Update Commands | flatpak | exists
set_fact: set_fact:
update_flatpak: | update_flatpak: |
echo "*** Flatpak ***" && echo "*** Flatpak ***" &&
flatpak update && flatpak update {{ update_accept_var }} &&
when: ansible_system == "Linux" when: flatpak_exec is defined and flatpak_exec.failed is defined and not flatpak_exec.failed
- name: General | Facts | Package | Update Commands | flatpak (FreeBSD) - name: General | Facts | Package | Update Commands | flatpak | not exists
set_fact: set_fact:
update_flatpak: echo "*** No Flatpak ***" update_flatpak: |
when: ansible_system == "FreeBSD" echo "*** Flatpak Not Installed ***" &&
when: update_flatpak is not defined

View File

@ -120,8 +120,8 @@
PROG=$FUNCNAME PROG=$FUNCNAME
usage="Usage: $PROG [-y] usage="Usage: $PROG [-y]
$PROG is used to run all the system's package manager commands $PROG is used to run all the system's package manager commands
in one swoop. Flow stops if any command returns a failure code. in one swoop. Flow stops if any command returns a failure code.
The hope is to run something as easy as 'pacman -Syyu'. The hope is to run something as easy as 'pacman -Syyu'.
-y : Assume yes to any prompts." -y : Assume yes to any prompts."
unset OPTIND unset OPTIND
@ -140,7 +140,7 @@
{{ update_flatpak }} {{ update_flatpak }}
return 0 return 0
echo "$PROG experienced a problem and has aborted." echo "ERROR: $PROG experienced a problem and has aborted."
return 1 return 1
} }

View File

@ -49,7 +49,7 @@
# Use a specific branch if it was asked for. # Use a specific branch if it was asked for.
branch="dev" branch="dev"
if [[ $1 != "" ]]; then if [[ $1 != "" ]]; then
branch="$1" branch="$1"
fi fi

View File

@ -49,7 +49,7 @@
# Use a specific branch if it was asked for. # Use a specific branch if it was asked for.
branch="dev" branch="dev"
if [[ $1 != "" ]]; then if [[ $1 != "" ]]; then
branch="$1" branch="$1"
fi fi