diff options
author | merakor <cem@ckyln.com> | 2021-07-27 09:24:26 +0000 |
---|---|---|
committer | merakor <cem@ckyln.com> | 2021-07-27 09:24:26 +0000 |
commit | ab960e47945033bea128474a255ccf52ea1ddf6c (patch) | |
tree | 4ce7f857fcba417dbe709bf7a6ec1b61e8053f60 /contrib/cpt-revdepends | |
parent | d8bb119df5965b154719958656032e38abc52ec3 (diff) | |
parent | 57093831d9c125b1ee872ecf21792324d2238354 (diff) | |
download | cpt-ab960e47945033bea128474a255ccf52ea1ddf6c.tar.gz |
blake3: merge trunk
FossilOrigin-Name: 8bba905c9082ee971fbe79d4be7eaa96072362689725add1f5341c0ec1d282fa
Diffstat (limited to 'contrib/cpt-revdepends')
-rwxr-xr-x | contrib/cpt-revdepends | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/contrib/cpt-revdepends b/contrib/cpt-revdepends index 833dea2..3529a53 100755 --- a/contrib/cpt-revdepends +++ b/contrib/cpt-revdepends @@ -22,7 +22,7 @@ ## .El parser_definition() { - setup REST help:usage -- "usage: ${0##*/} [options...] [pkg...]" + setup REST help:usage -- "usage: ${0##*/} [options...] [pkg]" flag tree -t --tree -- "Also print indirect reverse dependencies" flag make -m --make -- "Include make dependencies" global_options @@ -41,11 +41,11 @@ parser_definition() { cd "$sys_db" get_revdep() { - query="^$1\$" + pkg=$1; set -- "^$pkg\$" # Defined by parser. # shellcheck disable=2154 - [ "$make" ] && query="$query\\|^$1 *make\$" - grep "$query" -- */depends | while read -r pkg _; do + [ "$make" ] && set -- -e "$1" -e "^$pkg " + grep "$@" -- */depends | while read -r pkg _; do printf '%s\n' "${pkg%%/*}" done } @@ -53,7 +53,7 @@ get_revdep() { # Defined by parser. # shellcheck disable=2154 if [ "$tree" ]; then - create_cache nobuild + mkdir -p "$tmp_dir" :> "$tmp_dir/processed" get_revdep "$1" > "$tmp_dir/dep" while ! diff -q "$tmp_dir/dep" "$tmp_dir/processed" >/dev/null 2>&1; do |