]> pd.if.org Git - zpackage/commitdiff
add -I option to zpm-contents
authorNathan Wagner <nw@hydaspes.if.org>
Tue, 20 Nov 2018 21:28:35 +0000 (21:28 +0000)
committerNathan Wagner <nw@hydaspes.if.org>
Tue, 20 Nov 2018 22:27:58 +0000 (22:27 +0000)
zpm-contents
zpm-gc

index 6cdd485d4562397bb10baffac3334fe5d156c40a..ff607fbb0b24726e84767aa7d461f347f92bdd4a 100755 (executable)
@@ -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 95dcbe4cd4e2176c992a7cd6682eeba001554680..bc84e342c4b83171eb8e33531403659832406589 100755 (executable)
--- 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