diff options
author | merakor <cem@ckyln.com> | 2020-10-20 11:33:12 +0000 |
---|---|---|
committer | merakor <cem@ckyln.com> | 2020-10-20 11:33:12 +0000 |
commit | 7e6b592744f31ab43553e7c8246b30def5c47a90 (patch) | |
tree | f2dec1d8d27d3ccae4623212b2d691c337c9f10c /contrib/cpt-size | |
parent | e3a4904dc82814051a6a35d0b1a9ab78f9f739d8 (diff) | |
download | cpt-7e6b592744f31ab43553e7c8246b30def5c47a90.tar.gz |
cpt-size: add ability to check the size of multiple packages
FossilOrigin-Name: 48470adaaeb2d09a0cbbf6eb13463d2e231555d592225496c778281ba1b173de
Diffstat (limited to 'contrib/cpt-size')
-rwxr-xr-x | contrib/cpt-size | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/contrib/cpt-size b/contrib/cpt-size index f55f72a..0e7b9d6 100755 --- a/contrib/cpt-size +++ b/contrib/cpt-size @@ -3,21 +3,23 @@ case "$1" in --help|-h) - printf '%s\n' "usage: ${0##*/} [pkg]" + printf '%s\n' "usage: ${0##*/} [pkg...]" exit 0 ;; '') set -- "${PWD##*/}" esac -cpt-search "$1" >/dev/null +for pkg; do cpt-list "$pkg" >/dev/null; done files= -while read -r file; do - # Filter directories from manifest and leave only files. - # Directories in the manifest end in a trailing '/'. - case $file in */) continue; esac - files="$files '$file'" -done < "$CPT_ROOT/var/db/cpt/installed/$1/manifest" +for pkg; do + while read -r file; do + # Filter directories from manifest and leave only files. + # Directories in the manifest end in a trailing '/'. + case $file in */) continue; esac + files="$files '$file'" + done < "$CPT_ROOT/var/db/cpt/installed/$pkg/manifest" +done eval "set -- $files" # Send the file list to 'du'. |