[pacman-dev] [PATCH 1/3] checkupdates: show error when fakeroot is missing
--- contrib/checkupdates.sh.in | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/contrib/checkupdates.sh.in b/contrib/checkupdates.sh.in index f4f36c0..a3a308b 100644 --- a/contrib/checkupdates.sh.in +++ b/contrib/checkupdates.sh.in @@ -21,6 +21,9 @@ declare -r myname='checkupdates' declare -r myver='@PACKAGE_VERSION@' +m4_include(../scripts/library/output_format.sh) +m4_include(../scripts/library/term_colors.sh) + if (( $# > 0 )); then echo "${myname} (pacman) v${myver}" echo @@ -32,6 +35,11 @@ if (( $# > 0 )); then 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 -- 2.2.0
Especially useful now that pacman -Qu will also show the new version. --- contrib/checkupdates.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/checkupdates.sh.in b/contrib/checkupdates.sh.in index a3a308b..e8a8198 100644 --- a/contrib/checkupdates.sh.in +++ b/contrib/checkupdates.sh.in @@ -52,7 +52,7 @@ eval $(awk -F' *= *' '$1 ~ /DBPath/ { print $1 "=" $2 }' @sysconfdir@/pacman.con mkdir -p "$CHECKUPDATES_DB" ln -s "${DBPath}/local" "$CHECKUPDATES_DB" &> /dev/null fakeroot pacman -Sy --dbpath "$CHECKUPDATES_DB" --logfile /dev/null &> /dev/null -pacman -Qqu --dbpath "$CHECKUPDATES_DB" 2> /dev/null | grep -v '\[.*\]' +pacman -Qu --dbpath "$CHECKUPDATES_DB" 2> /dev/null | grep -v '\[.*\]' exit 0 -- 2.2.0
--- contrib/paclist.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/paclist.sh.in b/contrib/paclist.sh.in index 1c10b32..f4fd540 100644 --- a/contrib/paclist.sh.in +++ b/contrib/paclist.sh.in @@ -31,7 +31,7 @@ if ! type gettext &>/dev/null; then fi usage() { - printf "%s (pacman) v%s\n" "${myname}" "myver" + printf "%s (pacman) v%s\n" "${myname}" "${myver}" echo printf "List all packages installed from a given repository\n" "${myname}" echo -- 2.2.0
participants (1)
-
Evangelos Foutras