pacman-*: better error handling

master
Pierre Neidhardt 2013-10-29 21:49:48 +01:00
parent 090f80dc9f
commit 8111ebc7d0
6 changed files with 17 additions and 6 deletions

View File

@ -1,7 +1,5 @@
aspell-sv
ccan-git
dropbox
dropbox-cli
dwb-git
emacs-bison-mode
emacs-flex-mode
@ -16,9 +14,12 @@ emacs-xclip
emacs-yasnippet-git
foo2zjs
foomatic-db-foo2zjs
gmp-ecm
google-talkplugin
gtk2-pruned
lib32-sdl_mixer
lib32-smpeg
msieve
mutt-sidebar
package-query
pkgtools

View File

@ -108,7 +108,6 @@ fuseiso
gawk
gc
gcc-fortran
gcc-go
gcc-libs-multilib
gcc-multilib
gcolor2
@ -138,7 +137,6 @@ gmp
gnupg
gnuplot
gnutls
go
gobject-introspection
gpgme
gpm
@ -414,6 +412,7 @@ llvm-libs
lm_sensors
logrotate
lrzip
lsb-release
lshw
lsof
ltrace

View File

@ -6,6 +6,7 @@ babel-french
babel-german
babel-swedish
bigfoot
caption
carlisle
comment
dvipng

View File

@ -41,6 +41,10 @@ if [ $# -eq 0 ]; then
fi
! command -v pacman >/dev/null && echo "You need pacman to run this script." && exit 1
if [ $(pacman -Qq "$@" 2>/dev/null | wc -l) -eq 0 ]; then
echo "No valid package given." >&2
exit
fi
## We use "eval" to be compatible with non-POSIX wordsplitting (e.g. zsh).
du -bch $(pacman -Qlq "$@" | grep -v ".*/$" | sort -u) 2>/dev/null | eval ${OPTION_SORT}

View File

@ -55,12 +55,17 @@ fi
if [ -f "${0%/*}/.pacman-init" ];then
. "${0%/*}/.pacman-init"
else
echo "Missing init file" && exit 1
echo "Missing init file" >&2 && exit 1
fi
if [ $(pacman -Qq "$@" 2>/dev/null | wc -l) -eq 0 ]; then
echo "No valid package given." >&2
exit
fi
## We use external variable for awk to fit current locales.
## We use "eval" to be compatible with non-POSIX wordsplitting (e.g. zsh).
RESULT="$(${CMD} $@ 2>/dev/null | awk -F "$SEP" -v filter="$pacman_size" -v pkg="$pacman_name" \
RESULT="$(${CMD} $@ | awk -F "$SEP" -v filter="$pacman_size" -v pkg="$pacman_name" \
'$0 ~ pkg {pkgname=$2} $0 ~ filter {gsub(/\..*/,"") ; printf("%6s KiB %s\n", $2, pkgname)}' | sort -uk3 | eval $OPT_SORTN)"
echo "$RESULT"

View File

@ -360,6 +360,7 @@ Noteworthy apps
* openshot
* openssh
* p7zip
* parallel
* pari
* parted
* patch