aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Mende <angelos@unkreativ.org>2011-05-06 20:22:15 +0200
committerChristoph Mende <angelos@unkreativ.org>2011-05-06 20:22:15 +0200
commit0500eaa203e255a71cb55e6332bf8d6e6eb3a166 (patch)
treee08e3af698dda40932521701718d12b98f127e56 /filesdir-usage.sh
parentadd a simple script to show usage of FILESDIRs in the tree (diff)
downloadqa-scripts-0500eaa203e255a71cb55e6332bf8d6e6eb3a166.tar.gz
qa-scripts-0500eaa203e255a71cb55e6332bf8d6e6eb3a166.tar.bz2
qa-scripts-0500eaa203e255a71cb55e6332bf8d6e6eb3a166.zip
Minor improvements to filesdur-usage.sh
Use pushd/popd instead of cd. Don't rely on portdir being in /usr/portage
Diffstat (limited to 'filesdir-usage.sh')
-rwxr-xr-xfilesdir-usage.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/filesdir-usage.sh b/filesdir-usage.sh
index 4677277..920b5af 100755
--- a/filesdir-usage.sh
+++ b/filesdir-usage.sh
@@ -3,11 +3,12 @@
# $1 is a number, N. The top N directories that are consuming space. Defaults to
# all.
-cd /usr/portage/
+pushd $(portageq portdir) >/dev/null
if [[ -z $1 ]]; then
du -h */*/files | sort -nr
else
du -h */*/files | sort -nr | head -n $1
fi
+popd >/dev/null
echo
echo $(emerge --info | grep Timestamp)