]> pd.if.org Git - zpackage/commitdiff
add options only list shared libraries
authorNathan Wagner <nw@hydaspes.if.org>
Thu, 6 Dec 2018 13:56:32 +0000 (13:56 +0000)
committerNathan Wagner <nw@hydaspes.if.org>
Fri, 7 Dec 2018 07:47:34 +0000 (07:47 +0000)
zpm-contents

index 447e095a1eab9d97dfbf084474a7ee6993fbf83f..acd06362da3edf78791437629a1efb9853eb2d9d 100755 (executable)
@@ -8,8 +8,9 @@ quiet=0
 config=include
 showsoname=0
 status=
+sharedlibsonly=0
 
-while getopts f:qlncCLI opt; do
+while getopts f:qlncCLIs opt; do
        case $opt in
                f) pkgfile="$OPTARG" ;;
                l) long=1 ;;
@@ -18,7 +19,8 @@ while getopts f:qlncCLI opt; do
                c) config=only ;;
                C) config=exclude ;;
                L) showsoname=1 ;;
-               I) status=installed
+               s) sharedlibsonly=1 ;;
+               I) status=installed ;;
        esac
 done
 shift $((OPTIND - 1))
@@ -89,7 +91,7 @@ cols=${cols%,}
                printf "else path end as path\n"
        fi
        printf "from packagefiles_pkgid PF\n"
-       if [ $showsoname -eq 1 ]; then
+       if [ $showsoname -eq 1 ] || [ $sharedlibsonly -eq 1 ]; then
                printf "left join elflibraries EL on EL.file = PF.hash\n"
        fi
        if [ -n "$status" ]; then
@@ -106,6 +108,9 @@ cols=${cols%,}
                only) printf "and configuration = 1\n" ;;
                exclude) printf "and configuration = 0\n" ;;
        esac
+       if [ $sharedlibsonly -eq 1 ]; then
+               printf "and EL.soname is not null\n"
+       fi
        if [ -n "$status" ]; then
                printf "and P.status = '%s'\n" "$status"
        fi