]> pd.if.org Git - zpackage/blobdiff - zpm-contents
add -I option to zpm-contents
[zpackage] / zpm-contents
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