From 4dfb509cc4b2b48a3712db170d0299303feb247b Mon Sep 17 00:00:00 2001 From: Mikaela Suomalainen Date: Thu, 11 Jun 2020 17:22:14 +0300 Subject: [PATCH] deb-update.bash: indent comments, add one on if hash Comments are also moved down to where they belong in case they were explaining the if hash incorrectly --- bash/deb-update.bash | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/bash/deb-update.bash b/bash/deb-update.bash index 3e367c9..1d5af83 100755 --- a/bash/deb-update.bash +++ b/bash/deb-update.bash @@ -5,37 +5,38 @@ # Show commands being executed set -x -# I am not sure if -y here even does anything, at least it won't work for -# accepting suite changes for Debian when testing becomes stable. -# Checking for updates or new packages. +# if hash checks that the command exists if hash apt-get 2>/dev/null; then + # I am not sure if -y here even does anything, at least it won't work for + # accepting suite changes for Debian when testing becomes stable. + # Checking for updates or new packages. apt-get -y update -# If arguments like -y are passed to the script, they become "$@" + # If arguments like -y are passed to the script, they become "$@" apt-get "$@" upgrade --with-new-pkgs -# potentially unsafe + # potentially unsafe apt-get "$@" autoremove fi -# Flatpak apps are sandboxed and should be safe to update automatically if hash flatpak 2>/dev/null; then + # Flatpak apps are sandboxed and should be safe to update automatically flatpak update --assumeyes --noninteractive # Flatpak's version of `apt autoremove` flatpak uninstall --unused --assumeyes fi -# Snap packages auto-update anyway though, but I like checking them while -# doing everything else too if hash snap 2>/dev/null; then + # Snap packages auto-update anyway though, but I like checking them while + # doing everything else too snap refresh # so I may have some sort of an idea when snap packages have been updated # if they have auto-refreshed snap changes fi -# So the local apt-file database is up-to-date. if hash apt-file 2>/dev/null; then + # So the local apt-file database is up-to-date. apt-file update fi