X-Git-Url: https://pd.if.org/git/?p=zpackage;a=blobdiff_plain;f=zpm-contents;h=d466478dd11d2581aee9c86967f4dd4c8e5657b3;hp=acd06362da3edf78791437629a1efb9853eb2d9d;hb=77544f57c8617cf232cdf21e02924ae03d4da685;hpb=e21785a5c6b2f84521d1a63ba504ebeece4bc75d diff --git a/zpm-contents b/zpm-contents index acd0636..d466478 100755 --- a/zpm-contents +++ b/zpm-contents @@ -41,28 +41,28 @@ elif [ $quiet -eq 0 ]; then fi pkglist= +efail=0 while [ $# -gt 0 ]; do pkg=$1 shift - if [ "$pkg" = '--' ]; then - break; + + if [ "$pkg" = ':' ]; then + break fi pkgid=$(zpm findpkg -f $pkgfile "$pkg") if [ -n "$pkgid" ]; then - q=$(zpm quote -q "$pkgid") - pkglist=",$q" + pkglist="$pkglist $pkgid" else - printf "package $pkg not found, ignoring\n" 1>&2 - exit 1 - fi - pkglist=${pkglist#,} - if [ -z "$pkglist" ]; then - printf "can't find any packages\n" 1>&2 - exit 1 + printf "package $pkg not found\n" 1>&2 + efail=1 fi done +if [ $efail -eq 1 ]; then + exit 1; +fi + globlist= for glob in "$@"; do q=$(zpm quote -q "$glob") @@ -102,7 +102,7 @@ cols=${cols%,} printf "and (%s)\n" "$globlist" fi if [ -n "$pkglist" ]; then - printf "and pkgid in (%s)\n" "$pkglist" + printf "and pkgid in (%s)\n" "$(zpm quote -d, -q $pkglist)" fi case $config in only) printf "and configuration = 1\n" ;; @@ -114,7 +114,7 @@ cols=${cols%,} if [ -n "$status" ]; then printf "and P.status = '%s'\n" "$status" fi - printf 'order by package,version collate vercmp, release, path\n' + printf 'order by PF.package, PF.version collate vercmp, PF.release, PF.path\n' printf ';\n' } | zpm shell $pkgfile #} | cat