From ae7d62320daeda36f7e5d5577b7752230dd6f50b Mon Sep 17 00:00:00 2001 From: Nathan Wagner Date: Tue, 20 Nov 2018 21:28:35 +0000 Subject: [PATCH] add -I option to zpm-contents --- zpm-contents | 9 +++++++-- zpm-gc | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/zpm-contents b/zpm-contents index 6cdd485..ff607fb 100755 --- a/zpm-contents +++ b/zpm-contents @@ -7,8 +7,9 @@ pkgonly=0 quiet=0 config=include showsoname=0 +status= -while getopts f:qlncCL opt; do +while getopts f:qlncCLI opt; do case $opt in f) pkgfile="$OPTARG" ;; l) long=1 ;; @@ -17,6 +18,7 @@ while getopts f:qlncCL opt; do c) config=only ;; C) config=exclude ;; L) showsoname=1 ;; + I) status=installed esac done shift $((OPTIND - 1)) @@ -80,7 +82,7 @@ cols=${cols%,} fi printf "else path end as path\n" fi - printf 'from packagefiles_pkgid PF left join elflibraries EL on EL.file = PF.hash\nwhere true\n' + printf 'from packagefiles_status PF left join elflibraries EL on EL.file = PF.hash\nwhere true\n' if [ -n "$globlist" ]; then printf "and (%s)\n" "$globlist" fi @@ -91,6 +93,9 @@ cols=${cols%,} only) printf "and configuration = 1\n" ;; exclude) printf "and configuration = 0\n" ;; esac + if [ -n "$status" ]; then + printf "and status = '%s'\n" "$status" + fi printf 'order by pkgid,path\n' printf ';\n' } | zpm shell $pkgfile diff --git a/zpm-gc b/zpm-gc index 95dcbe4..bc84e34 100755 --- a/zpm-gc +++ b/zpm-gc @@ -20,6 +20,7 @@ # -oO remove outdated packages, unless preserved # -pP remove history for removed packages # -rR remove orphaned rows in files table packagefiles, notes, scripts, ... +# -hH remove all file content that is not scripts or configs # -rR remove removed packages, unless preserved # -vV compactify the database file -- 2.40.0