From 4045b211c5de6aaa03247273d0032b4bfc8c86a7 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Sat, 11 Jun 2016 08:12:13 +0200 Subject: [PATCH] Move pacfiles script to a simpler shell function --- .scripts/pacfiles | 46 ---------------------------------------------- .shell.d/funs_rc | 4 ++++ 2 files changed, 4 insertions(+), 46 deletions(-) delete mode 100755 .scripts/pacfiles diff --git a/.scripts/pacfiles b/.scripts/pacfiles deleted file mode 100755 index d922e7be..00000000 --- a/.scripts/pacfiles +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh - -_usage () { - cat </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). -## WARNING: this only works with GNU 'du'. -du -bch $(pacman -Qlq "$@" | grep -v '.*/$' | sort -u) 2>/dev/null | eval ${OPTION_SORT} diff --git a/.shell.d/funs_rc b/.shell.d/funs_rc index adcaef1c..fec91e24 100644 --- a/.shell.d/funs_rc +++ b/.shell.d/funs_rc @@ -223,6 +223,10 @@ if command -v pacman >/dev/null 2>&1; then pli () { expac -t '%F %T' '%-8l %n' | sort -rn | head -${1:-30} } + + pacfiles () { + pacman -Qlq "$@" | grep -v '/$' | xargs du -cbh | sort -h + } fi ##==============================================================================