cpt

Carbs Packaging Tools
git clone git://git.carbslinux.org/cpt
Log | Files | Refs | README | LICENSE

commit 231a14f625d35c85e922599cb3ed262399ee2cf5
parent a583ac1387ea1be1bf9f0da8956a942753d2f9d7
Author: Cem Keylan <cem@ckyln.com>
Date:   Sat,  5 Sep 2020 10:13:29 +0300

contrib: use current directory if no arguments are given

Diffstat:
Mcontrib/cpt-cat | 9++++++++-
Mcontrib/cpt-depends | 8+++++++-
Mcontrib/cpt-export | 8+++++++-
Mcontrib/cpt-manifest | 8+++++++-
Mcontrib/cpt-manifest-tree | 8+++++++-
Mcontrib/cpt-repodepends | 10++++++++--
Mcontrib/cpt-revdepends | 8+++++++-
Mcontrib/cpt-size | 9++++++++-
8 files changed, 59 insertions(+), 9 deletions(-)

diff --git a/contrib/cpt-cat b/contrib/cpt-cat @@ -1,7 +1,14 @@ #!/bin/sh -e # Concatanate package files in the installed package database # File names are printed to stderr. -case "$1" in ''|--help|-h) printf '\033[1;33m-> \033[musage: %s [pkg] [file...]\n' "${0##*/}" ; exit 0; esac +case "$1" in + --help|-h) + printf '\033[1;33m-> \033[musage: %s [pkg] [file...]\n' "${0##*/}" + exit 0 + ;; + '') + set -- "${PWD##*/}" +esac cpt-list "${pkg:=$1}" >/dev/null ; shift diff --git a/contrib/cpt-depends b/contrib/cpt-depends @@ -1,7 +1,13 @@ #!/bin/sh -ef # Display a package's dependencies -case "$1" in ''|--help|-h) printf '\033[1;33m-> \033[m%s\n' "usage: ${0##*/} [pkg]" ; exit 0 ; esac +case "$1" in + --help|-h) + printf '\033[1;33m-> \033[m%s\n' "usage: ${0##*/} [pkg]" + exit 0 + ;; + '') set -- "${PWD##*/}" +esac cpt-list "$1" >/dev/null cat "$CPT_ROOT/var/db/cpt/installed/$1/depends" 2>/dev/null diff --git a/contrib/cpt-export b/contrib/cpt-export @@ -1,7 +1,13 @@ #!/bin/sh -ef # Turn an installed package into a CPT tarball -case "$1" in ''|--help|-h) printf '\033[1;33m-> \033[m%s\n' "usage: ${0##*/} [pkg]" ; exit 0 ; esac +case "$1" in + --help|-h) + printf '\033[1;33m-> \033[m%s\n' "usage: ${0##*/} [pkg]" + exit 0 + ;; + '') set -- "${PWD##*/}" +esac cpt-list "${1:-null}" >/dev/null diff --git a/contrib/cpt-manifest b/contrib/cpt-manifest @@ -1,6 +1,12 @@ #!/bin/sh -ef # Display all files owned by a package -case "$1" in ''|--help|-h) printf '\033[1;33m-> \033[m%s\n' "usage: ${0##*/} [pkg]" ; exit 0 ; esac +case "$1" in + --help|-h) + printf '\033[1;33m-> \033[m%s\n' "usage: ${0##*/} [pkg]" + exit 0 + ;; + '') set -- "${PWD##*/}" +esac cpt-list "$1" >/dev/null cat "$CPT_ROOT/var/db/cpt/installed/$1/manifest" 2>/dev/null diff --git a/contrib/cpt-manifest-tree b/contrib/cpt-manifest-tree @@ -1,7 +1,13 @@ #!/bin/sh -ef # Display all files owned by a package with a tree view -case "$1" in ''|--help|-h) printf '\033[1;33m-> \033[m%s\n' "usage: ${0##*/} [pkg]" ; exit 0 ; esac +case "$1" in + --help|-h) + printf '\033[1;33m-> \033[m%s\n' "usage: ${0##*/} [pkg]" + exit 0 + ;; + '') set -- "${PWD##*/}" +esac cpt-list "$1" >/dev/null printf '%s\n' "[$1]:" tree -C --fromfile "$CPT_ROOT/var/db/cpt/installed/$1/manifest" | sed 1,2d diff --git a/contrib/cpt-repodepends b/contrib/cpt-repodepends @@ -1,7 +1,13 @@ #!/bin/sh -e # Display a package's dependencies in the repository -case "$1" in ''|--help|-h) printf '%s\n' "usage: ${0##*/} [pkg]" ; exit 0 ; esac -cpt-search "$1" >/dev/null +case "$1" in + --help|-h) + printf '%s\n' "usage: ${0##*/} [pkg]" + exit 0 + ;; + '') set -- "${PWD##*/}" +esac +cpt-search "$1" >/dev/null cat "$(cpt-search --single "$1")/depends" 2>/dev/null diff --git a/contrib/cpt-revdepends b/contrib/cpt-revdepends @@ -1,7 +1,13 @@ #!/bin/sh -e # Display packages which depend on package -case "$1" in ''|--help|-h) printf '%s\n' "usage: ${0##*/} [pkg]" ; exit 0 ; esac +case "$1" in + --help|-h) + printf '%s\n' "usage: ${0##*/} [pkg]" + exit 0 + ;; + '') set -- "${PWD##*/}" +esac # 'cd' to the database directory as a simple way of # stripping the path and performing a 'basename'. diff --git a/contrib/cpt-size b/contrib/cpt-size @@ -1,7 +1,14 @@ #!/bin/sh -ef # Show the size on disk for a package -case "$1" in ''|--help|-h) printf '%s\n' "usage: ${0##*/} [pkg]" ; exit 0 ; esac +case "$1" in + --help|-h) + printf '%s\n' "usage: ${0##*/} [pkg]" + exit 0 + ;; + '') set -- "${PWD##*/}" +esac + cpt-search "$1" >/dev/null # Filter directories from manifest and leave only files.