dotfiles/dot_config/polybar/cuts/scripts/executable_checkupdates
punkfairie 0931fb492f
Add .config/polybar/blocks/bars.ini
Add .config/polybar/blocks/colors.ini
Add .config/polybar/blocks/config.ini
Add .config/polybar/blocks/launch.sh
Add .config/polybar/blocks/preview.sh
Add .config/polybar/blocks/modules.ini
Add .config/polybar/blocks/preview.ini
Add .config/polybar/blocks/scripts/checkupdates
Add .config/polybar/blocks/scripts/launcher.sh
Add .config/polybar/blocks/scripts/powermenu.sh
Add .config/polybar/blocks/scripts/style-switch.sh
Add .config/polybar/blocks/scripts/styles.sh
Add .config/polybar/blocks/scripts/updates.sh
Add .config/polybar/blocks/scripts/rofi/colors.rasi
Add .config/polybar/blocks/scripts/rofi/confirm.rasi
Add .config/polybar/blocks/scripts/rofi/launcher.rasi
Add .config/polybar/blocks/scripts/rofi/message.rasi
Add .config/polybar/blocks/scripts/rofi/networkmenu.rasi
Add .config/polybar/blocks/scripts/rofi/powermenu.rasi
Add .config/polybar/blocks/scripts/rofi/styles.rasi
Add .config/polybar/blocks/user_modules.ini
Add .config/polybar/colorblocks/bars.ini
Add .config/polybar/colorblocks/colors.ini
Add .config/polybar/colorblocks/config.ini
Add .config/polybar/colorblocks/launch.sh
Add .config/polybar/colorblocks/preview.sh
Add .config/polybar/colorblocks/modules.ini
Add .config/polybar/colorblocks/preview.ini
Add .config/polybar/colorblocks/scripts/checkupdates
Add .config/polybar/colorblocks/scripts/color-switch.sh
Add .config/polybar/colorblocks/scripts/colors-dark.sh
Add .config/polybar/colorblocks/scripts/colors-light.sh
Add .config/polybar/colorblocks/scripts/launcher.sh
Add .config/polybar/colorblocks/scripts/powermenu.sh
Add .config/polybar/colorblocks/scripts/pywal.sh
Add .config/polybar/colorblocks/scripts/random.sh
Add .config/polybar/colorblocks/scripts/updates.sh
Add .config/polybar/colorblocks/scripts/rofi/colors.rasi
Add .config/polybar/colorblocks/scripts/rofi/confirm.rasi
Add .config/polybar/colorblocks/scripts/rofi/launcher.rasi
Add .config/polybar/colorblocks/scripts/rofi/message.rasi
Add .config/polybar/colorblocks/scripts/rofi/networkmenu.rasi
Add .config/polybar/colorblocks/scripts/rofi/powermenu.rasi
Add .config/polybar/colorblocks/scripts/rofi/styles.rasi
Add .config/polybar/colorblocks/user_modules.ini
Add .config/polybar/cuts/bars.ini
Add .config/polybar/cuts/colors.ini
Add .config/polybar/cuts/config.ini
Add .config/polybar/cuts/launch.sh
Add .config/polybar/cuts/preview.sh
Add .config/polybar/cuts/modules.ini
Add .config/polybar/cuts/preview.ini
Add .config/polybar/cuts/scripts/checkupdates
Add .config/polybar/cuts/scripts/color-switch.sh
Add .config/polybar/cuts/scripts/colors-dark.sh
Add .config/polybar/cuts/scripts/colors-light.sh
Add .config/polybar/cuts/scripts/launcher.sh
Add .config/polybar/cuts/scripts/powermenu.sh
Add .config/polybar/cuts/scripts/pywal.sh
Add .config/polybar/cuts/scripts/random.sh
Add .config/polybar/cuts/scripts/style-switch.sh
Add .config/polybar/cuts/scripts/styles.sh
Add .config/polybar/cuts/scripts/updates.sh
Add .config/polybar/cuts/scripts/rofi/colors.rasi
Add .config/polybar/cuts/scripts/rofi/confirm.rasi
Add .config/polybar/cuts/scripts/rofi/launcher.rasi
Add .config/polybar/cuts/scripts/rofi/message.rasi
Add .config/polybar/cuts/scripts/rofi/networkmenu.rasi
Add .config/polybar/cuts/scripts/rofi/powermenu.rasi
Add .config/polybar/cuts/scripts/rofi/styles.rasi
Add .config/polybar/cuts/user_modules.ini
Add .config/polybar/docky/bars.ini
Add .config/polybar/docky/colors.ini
Add .config/polybar/docky/config.ini
Add .config/polybar/docky/launch.sh
Add .config/polybar/docky/preview.sh
Add .config/polybar/docky/modules.ini
Add .config/polybar/docky/preview.ini
Add .config/polybar/docky/scripts/checkupdates
Add .config/polybar/docky/scripts/color-switch.sh
Add .config/polybar/docky/scripts/colors-dark.sh
Add .config/polybar/docky/scripts/colors-light.sh
Add .config/polybar/docky/scripts/launcher.sh
Add .config/polybar/docky/scripts/powermenu.sh
Add .config/polybar/docky/scripts/pywal.sh
Add .config/polybar/docky/scripts/random.sh
Add .config/polybar/docky/scripts/updates.sh
Add .config/polybar/docky/scripts/rofi/colors.rasi
Add .config/polybar/docky/scripts/rofi/confirm.rasi
Add .config/polybar/docky/scripts/rofi/launcher.rasi
Add .config/polybar/docky/scripts/rofi/message.rasi
Add .config/polybar/docky/scripts/rofi/networkmenu.rasi
Add .config/polybar/docky/scripts/rofi/powermenu.rasi
Add .config/polybar/docky/scripts/rofi/styles.rasi
Add .config/polybar/docky/user_modules.ini
Add .config/polybar/launch.sh
Add .config/polybar/forest/bars.ini
Add .config/polybar/forest/colors.ini
Add .config/polybar/forest/config.ini
Add .config/polybar/forest/launch.sh
Add .config/polybar/forest/preview.sh
Add .config/polybar/forest/modules.ini
Add .config/polybar/forest/preview.ini
Add .config/polybar/forest/scripts/checkupdates
Add .config/polybar/forest/scripts/launcher.sh
Add .config/polybar/forest/scripts/powermenu.sh
Add .config/polybar/forest/scripts/style-switch.sh
Add .config/polybar/forest/scripts/styles.sh
Add .config/polybar/forest/scripts/updates.sh
Add .config/polybar/forest/scripts/rofi/colors.rasi
Add .config/polybar/forest/scripts/rofi/confirm.rasi
Add .config/polybar/forest/scripts/rofi/launcher.rasi
Add .config/polybar/forest/scripts/rofi/message.rasi
Add .config/polybar/forest/scripts/rofi/networkmenu.rasi
Add .config/polybar/forest/scripts/rofi/powermenu.rasi
Add .config/polybar/forest/scripts/rofi/styles.rasi
Add .config/polybar/forest/user_modules.ini
Add .config/polybar/grayblocks/bars.ini
Add .config/polybar/grayblocks/colors.ini
Add .config/polybar/grayblocks/config.ini
Add .config/polybar/grayblocks/launch.sh
Add .config/polybar/grayblocks/preview.sh
Add .config/polybar/grayblocks/modules.ini
Add .config/polybar/grayblocks/preview.ini
Add .config/polybar/grayblocks/scripts/checkupdates
Add .config/polybar/grayblocks/scripts/color-switch.sh
Add .config/polybar/grayblocks/scripts/colors-dark.sh
Add .config/polybar/grayblocks/scripts/colors-light.sh
Add .config/polybar/grayblocks/scripts/launcher.sh
Add .config/polybar/grayblocks/scripts/powermenu.sh
Add .config/polybar/grayblocks/scripts/pywal.sh
Add .config/polybar/grayblocks/scripts/random.sh
Add .config/polybar/grayblocks/scripts/updates.sh
Add .config/polybar/grayblocks/scripts/rofi/colors.rasi
Add .config/polybar/grayblocks/scripts/rofi/confirm.rasi
Add .config/polybar/grayblocks/scripts/rofi/launcher.rasi
Add .config/polybar/grayblocks/scripts/rofi/message.rasi
Add .config/polybar/grayblocks/scripts/rofi/networkmenu.rasi
Add .config/polybar/grayblocks/scripts/rofi/powermenu.rasi
Add .config/polybar/grayblocks/scripts/rofi/styles.rasi
Add .config/polybar/grayblocks/user_modules.ini
Add .config/polybar/hack/bars.ini
Add .config/polybar/hack/colors.ini
Add .config/polybar/hack/config.ini
Add .config/polybar/hack/launch.sh
Add .config/polybar/hack/preview.sh
Add .config/polybar/hack/modules.ini
Add .config/polybar/hack/preview.ini
Add .config/polybar/hack/scripts/check-network
Add .config/polybar/hack/scripts/checkupdates
Add .config/polybar/hack/scripts/color-switch.sh
Add .config/polybar/hack/scripts/colors-dark.sh
Add .config/polybar/hack/scripts/colors-light.sh
Add .config/polybar/hack/scripts/launcher.sh
Add .config/polybar/hack/scripts/powermenu.sh
Add .config/polybar/hack/scripts/pywal.sh
Add .config/polybar/hack/scripts/random.sh
Add .config/polybar/hack/scripts/updates.sh
Add .config/polybar/hack/scripts/rofi/colors.rasi
Add .config/polybar/hack/scripts/rofi/confirm.rasi
Add .config/polybar/hack/scripts/rofi/launcher.rasi
Add .config/polybar/hack/scripts/rofi/message.rasi
Add .config/polybar/hack/scripts/rofi/networkmenu.rasi
Add .config/polybar/hack/scripts/rofi/powermenu.rasi
Add .config/polybar/hack/scripts/rofi/styles.rasi
Add .config/polybar/hack/user_modules.ini
Add .config/polybar/material/bars.ini
Add .config/polybar/material/colors.ini
Add .config/polybar/material/config.ini
Add .config/polybar/material/launch.sh
Add .config/polybar/material/preview.sh
Add .config/polybar/material/modules.ini
Add .config/polybar/material/preview.ini
Add .config/polybar/material/scripts/checkupdates
Add .config/polybar/material/scripts/color-switch.sh
Add .config/polybar/material/scripts/colors-dark.sh
Add .config/polybar/material/scripts/colors-light.sh
Add .config/polybar/material/scripts/launcher.sh
Add .config/polybar/material/scripts/powermenu.sh
Add .config/polybar/material/scripts/pywal.sh
Add .config/polybar/material/scripts/random.sh
Add .config/polybar/material/scripts/updates.sh
Add .config/polybar/material/scripts/rofi/colors.rasi
Add .config/polybar/material/scripts/rofi/confirm.rasi
Add .config/polybar/material/scripts/rofi/launcher.rasi
Add .config/polybar/material/scripts/rofi/message.rasi
Add .config/polybar/material/scripts/rofi/networkmenu.rasi
Add .config/polybar/material/scripts/rofi/powermenu.rasi
Add .config/polybar/material/scripts/rofi/styles.rasi
Add .config/polybar/material/user_modules.ini
Add .config/polybar/panels/config.ini
Add .config/polybar/panels/launch.sh
Add .config/polybar/panels/menu/budgie/colors.rasi
Add .config/polybar/panels/menu/budgie/confirm.rasi
Add .config/polybar/panels/menu/budgie/launcher.rasi
Add .config/polybar/panels/menu/budgie/message.rasi
Add .config/polybar/panels/menu/budgie/networkmenu.rasi
Add .config/polybar/panels/menu/budgie/powermenu.rasi
Add .config/polybar/panels/menu/budgie/styles.rasi
Add .config/polybar/panels/menu/deepin/colors.rasi
Add .config/polybar/panels/menu/deepin/confirm.rasi
Add .config/polybar/panels/menu/deepin/launcher.rasi
Add .config/polybar/panels/menu/deepin/message.rasi
Add .config/polybar/panels/menu/deepin/networkmenu.rasi
Add .config/polybar/panels/menu/deepin/powermenu.rasi
Add .config/polybar/panels/menu/deepin/styles.rasi
Add .config/polybar/panels/menu/elementary/colors.rasi
Add .config/polybar/panels/menu/elementary/confirm.rasi
Add .config/polybar/panels/menu/elementary/launcher.rasi
Add .config/polybar/panels/menu/elementary/message.rasi
Add .config/polybar/panels/menu/elementary/networkmenu.rasi
Add .config/polybar/panels/menu/elementary/powermenu.rasi
Add .config/polybar/panels/menu/elementary/styles.rasi
Add .config/polybar/panels/menu/elementary_dark/colors.rasi
Add .config/polybar/panels/menu/elementary_dark/confirm.rasi
Add .config/polybar/panels/menu/elementary_dark/launcher.rasi
Add .config/polybar/panels/menu/elementary_dark/message.rasi
Add .config/polybar/panels/menu/elementary_dark/networkmenu.rasi
Add .config/polybar/panels/menu/elementary_dark/powermenu.rasi
Add .config/polybar/panels/menu/elementary_dark/styles.rasi
Add .config/polybar/panels/menu/gnome/colors.rasi
Add .config/polybar/panels/menu/gnome/confirm.rasi
Add .config/polybar/panels/menu/gnome/launcher.rasi
Add .config/polybar/panels/menu/gnome/message.rasi
Add .config/polybar/panels/menu/gnome/networkmenu.rasi
Add .config/polybar/panels/menu/gnome/powermenu.rasi
Add .config/polybar/panels/menu/gnome/styles.rasi
Add .config/polybar/panels/menu/kde/colors.rasi
Add .config/polybar/panels/menu/kde/confirm.rasi
Add .config/polybar/panels/menu/kde/launcher.rasi
Add .config/polybar/panels/menu/kde/message.rasi
Add .config/polybar/panels/menu/kde/networkmenu.rasi
Add .config/polybar/panels/menu/kde/powermenu.rasi
Add .config/polybar/panels/menu/kde/styles.rasi
Add .config/polybar/panels/menu/kde_dark/colors.rasi
Add .config/polybar/panels/menu/kde_dark/confirm.rasi
Add .config/polybar/panels/menu/kde_dark/launcher.rasi
Add .config/polybar/panels/menu/kde_dark/message.rasi
Add .config/polybar/panels/menu/kde_dark/networkmenu.rasi
Add .config/polybar/panels/menu/kde_dark/powermenu.rasi
Add .config/polybar/panels/menu/kde_dark/styles.rasi
Add .config/polybar/panels/menu/liri/colors.rasi
Add .config/polybar/panels/menu/liri/confirm.rasi
Add .config/polybar/panels/menu/liri/launcher.rasi
Add .config/polybar/panels/menu/liri/message.rasi
Add .config/polybar/panels/menu/liri/networkmenu.rasi
Add .config/polybar/panels/menu/liri/powermenu.rasi
Add .config/polybar/panels/menu/liri/styles.rasi
Add .config/polybar/panels/menu/mint/colors.rasi
Add .config/polybar/panels/menu/mint/confirm.rasi
Add .config/polybar/panels/menu/mint/launcher.rasi
Add .config/polybar/panels/menu/mint/message.rasi
Add .config/polybar/panels/menu/mint/networkmenu.rasi
Add .config/polybar/panels/menu/mint/powermenu.rasi
Add .config/polybar/panels/menu/mint/styles.rasi
Add .config/polybar/panels/menu/ubuntu_gnome/colors.rasi
Add .config/polybar/panels/menu/ubuntu_gnome/confirm.rasi
Add .config/polybar/panels/menu/ubuntu_gnome/launcher.rasi
Add .config/polybar/panels/menu/ubuntu_gnome/message.rasi
Add .config/polybar/panels/menu/ubuntu_gnome/networkmenu.rasi
Add .config/polybar/panels/menu/ubuntu_gnome/powermenu.rasi
Add .config/polybar/panels/menu/ubuntu_gnome/styles.rasi
Add .config/polybar/panels/menu/ubuntu_unity/colors.rasi
Add .config/polybar/panels/menu/ubuntu_unity/confirm.rasi
Add .config/polybar/panels/menu/ubuntu_unity/launcher.rasi
Add .config/polybar/panels/menu/ubuntu_unity/message.rasi
Add .config/polybar/panels/menu/ubuntu_unity/networkmenu.rasi
Add .config/polybar/panels/menu/ubuntu_unity/powermenu.rasi
Add .config/polybar/panels/menu/ubuntu_unity/styles.rasi
Add .config/polybar/panels/menu/xubuntu/colors.rasi
Add .config/polybar/panels/menu/xubuntu/confirm.rasi
Add .config/polybar/panels/menu/xubuntu/launcher.rasi
Add .config/polybar/panels/menu/xubuntu/message.rasi
Add .config/polybar/panels/menu/xubuntu/networkmenu.rasi
Add .config/polybar/panels/menu/xubuntu/powermenu.rasi
Add .config/polybar/panels/menu/xubuntu/styles.rasi
Add .config/polybar/panels/menu/zorin/colors.rasi
Add .config/polybar/panels/menu/zorin/confirm.rasi
Add .config/polybar/panels/menu/zorin/launcher.rasi
Add .config/polybar/panels/menu/zorin/message.rasi
Add .config/polybar/panels/menu/zorin/networkmenu.rasi
Add .config/polybar/panels/menu/zorin/powermenu.rasi
Add .config/polybar/panels/menu/zorin/styles.rasi
Add .config/polybar/panels/panel/budgie.ini
Add .config/polybar/panels/panel/deepin.ini
Add .config/polybar/panels/panel/elementary.ini
Add .config/polybar/panels/panel/elementary_dark.ini
Add .config/polybar/panels/panel/gnome.ini
Add .config/polybar/panels/panel/kde.ini
Add .config/polybar/panels/panel/kde_dark.ini
Add .config/polybar/panels/panel/liri.ini
Add .config/polybar/panels/panel/mint.ini
Add .config/polybar/panels/panel/ubuntu_gnome.ini
Add .config/polybar/panels/panel/ubuntu_unity.ini
Add .config/polybar/panels/panel/xubuntu.ini
Add .config/polybar/panels/panel/zorin.ini
Add .config/polybar/panels/scripts/launcher.sh
Add .config/polybar/panels/scripts/powermenu.sh
Add .config/polybar/panels/scripts/style-switch.sh
Add .config/polybar/panels/scripts/styles.sh
Add .config/polybar/panels/wallpapers/budgie.jpg
Add .config/polybar/panels/wallpapers/deepin.jpg
Add .config/polybar/panels/wallpapers/elementary.jpg
Add .config/polybar/panels/wallpapers/elementary_2.jpg
Add .config/polybar/panels/wallpapers/gnome.jpg
Add .config/polybar/panels/wallpapers/kde.jpg
Add .config/polybar/panels/wallpapers/kde_2.jpg
Add .config/polybar/panels/wallpapers/liri.png
Add .config/polybar/panels/wallpapers/mint.jpg
Add .config/polybar/panels/wallpapers/ubuntu.jpg
Add .config/polybar/panels/wallpapers/xubuntu.png
Add .config/polybar/panels/wallpapers/zorin.png
Add .config/polybar/pwidgets/apps.ini
Add .config/polybar/pwidgets/colors.ini
Add .config/polybar/pwidgets/cpu.ini
Add .config/polybar/pwidgets/launch.sh
Add .config/polybar/pwidgets/fs.ini
Add .config/polybar/pwidgets/main.ini
Add .config/polybar/pwidgets/memory.ini
Add .config/polybar/pwidgets/mpd.ini
Add .config/polybar/pwidgets/scripts/launcher.sh
Add .config/polybar/pwidgets/scripts/powermenu.sh
Add .config/polybar/pwidgets/scripts/pywal.sh
Add .config/polybar/pwidgets/scripts/random.sh
Add .config/polybar/pwidgets/scripts/style-switch.sh
Add .config/polybar/pwidgets/scripts/styles.sh
Add .config/polybar/pwidgets/scripts/rofi/colors.rasi
Add .config/polybar/pwidgets/scripts/rofi/confirm.rasi
Add .config/polybar/pwidgets/scripts/rofi/launcher.rasi
Add .config/polybar/pwidgets/scripts/rofi/message.rasi
Add .config/polybar/pwidgets/scripts/rofi/networkmenu.rasi
Add .config/polybar/pwidgets/scripts/rofi/powermenu.rasi
Add .config/polybar/pwidgets/scripts/rofi/styles.rasi
Add .config/polybar/pwidgets/system.ini
Add .config/polybar/pwidgets/workspace.ini
Add .config/polybar/shades/bars.ini
Add .config/polybar/shades/colors.ini
Add .config/polybar/shades/config.ini
Add .config/polybar/shades/launch.sh
Add .config/polybar/shades/preview.sh
Add .config/polybar/shades/modules.ini
Add .config/polybar/shades/preview.ini
Add .config/polybar/shades/scripts/checkupdates
Add .config/polybar/shades/scripts/color-switch.sh
Add .config/polybar/shades/scripts/colors-dark.sh
Add .config/polybar/shades/scripts/colors-light.sh
Add .config/polybar/shades/scripts/launcher.sh
Add .config/polybar/shades/scripts/powermenu.sh
Add .config/polybar/shades/scripts/pywal.sh
Add .config/polybar/shades/scripts/random.sh
Add .config/polybar/shades/scripts/updates.sh
Add .config/polybar/shades/scripts/rofi/colors.rasi
Add .config/polybar/shades/scripts/rofi/confirm.rasi
Add .config/polybar/shades/scripts/rofi/launcher.rasi
Add .config/polybar/shades/scripts/rofi/message.rasi
Add .config/polybar/shades/scripts/rofi/networkmenu.rasi
Add .config/polybar/shades/scripts/rofi/powermenu.rasi
Add .config/polybar/shades/scripts/rofi/styles.rasi
Add .config/polybar/shades/user_modules.ini
Add .config/polybar/shapes/bars.ini
Add .config/polybar/shapes/colors.ini
Add .config/polybar/shapes/config.ini
Add .config/polybar/shapes/launch.sh
Add .config/polybar/shapes/preview.sh
Add .config/polybar/shapes/glyphs.ini
Add .config/polybar/shapes/modules.ini
Add .config/polybar/shapes/preview.ini
Add .config/polybar/shapes/scripts/checkupdates
Add .config/polybar/shapes/scripts/color-switch.sh
Add .config/polybar/shapes/scripts/colors-dark.sh
Add .config/polybar/shapes/scripts/colors-light.sh
Add .config/polybar/shapes/scripts/launcher.sh
Add .config/polybar/shapes/scripts/powermenu.sh
Add .config/polybar/shapes/scripts/pywal.sh
Add .config/polybar/shapes/scripts/random.sh
Add .config/polybar/shapes/scripts/style-switch.sh
Add .config/polybar/shapes/scripts/updates.sh
Add .config/polybar/shapes/scripts/rofi/colors.rasi
Add .config/polybar/shapes/scripts/rofi/confirm.rasi
Add .config/polybar/shapes/scripts/rofi/launcher.rasi
Add .config/polybar/shapes/scripts/rofi/message.rasi
Add .config/polybar/shapes/scripts/rofi/networkmenu.rasi
Add .config/polybar/shapes/scripts/rofi/powermenu.rasi
Add .config/polybar/shapes/scripts/rofi/styles.rasi
Add .config/polybar/shapes/user_modules.ini
2024-08-03 11:32:16 -07:00

117 lines
3 KiB
Bash

#!/usr/bin/bash
#
# checkupdates: Safely print a list of pending updates.
#
# Copyright (c) 2013 Kyle Keen <keenerd@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
declare -r myname='checkupdates'
declare -r myver='1.0.0'
plain() {
(( QUIET )) && return
local mesg=$1; shift
printf "${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&1
}
msg() {
(( QUIET )) && return
local mesg=$1; shift
printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&1
}
msg2() {
(( QUIET )) && return
local mesg=$1; shift
printf "${BLUE} ->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&1
}
ask() {
local mesg=$1; shift
printf "${BLUE}::${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}" "$@" >&1
}
warning() {
local mesg=$1; shift
printf "${YELLOW}==> $(gettext "WARNING:")${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
}
error() {
local mesg=$1; shift
printf "${RED}==> $(gettext "ERROR:")${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" >&2
}
# check if messages are to be printed using color
unset ALL_OFF BOLD BLUE GREEN RED YELLOW
if [[ -t 2 && ! $USE_COLOR = "n" ]]; then
# prefer terminal safe colored and bold text when tput is supported
if tput setaf 0 &>/dev/null; then
ALL_OFF="$(tput sgr0)"
BOLD="$(tput bold)"
BLUE="${BOLD}$(tput setaf 4)"
GREEN="${BOLD}$(tput setaf 2)"
RED="${BOLD}$(tput setaf 1)"
YELLOW="${BOLD}$(tput setaf 3)"
else
ALL_OFF="\e[1;0m"
BOLD="\e[1;1m"
BLUE="${BOLD}\e[1;34m"
GREEN="${BOLD}\e[1;32m"
RED="${BOLD}\e[1;31m"
YELLOW="${BOLD}\e[1;33m"
fi
fi
readonly ALL_OFF BOLD BLUE GREEN RED YELLOW
if (( $# > 0 )); then
echo "${myname} v${myver}"
echo
echo "Safely print a list of pending updates"
echo
echo "Usage: ${myname}"
echo
echo 'Note: Export the "CHECKUPDATES_DB" variable to change the path of the temporary database.'
exit 0
fi
if ! type -P fakeroot >/dev/null; then
error 'Cannot find the fakeroot binary.'
exit 1
fi
if [[ -z $CHECKUPDATES_DB ]]; then
CHECKUPDATES_DB="${TMPDIR:-/tmp}/checkup-db-${USER}/"
fi
trap 'rm -f $CHECKUPDATES_DB/db.lck' INT TERM EXIT
DBPath="$(pacman-conf DBPath)"
if [[ -z "$DBPath" ]] || [[ ! -d "$DBPath" ]]; then
DBPath="/var/lib/pacman/"
fi
mkdir -p "$CHECKUPDATES_DB"
ln -s "${DBPath}/local" "$CHECKUPDATES_DB" &> /dev/null
if ! fakeroot -- pacman -Sy --dbpath "$CHECKUPDATES_DB" --logfile /dev/null &> /dev/null; then
error 'Cannot fetch updates'
exit 1
fi
pacman -Qu --dbpath "$CHECKUPDATES_DB" 2> /dev/null | grep -v '\[.*\]'
exit 0
# vim: set noet: