diff options
author | merakor <cem@ckyln.com> | 2021-07-22 09:06:45 +0000 |
---|---|---|
committer | merakor <cem@ckyln.com> | 2021-07-22 09:06:45 +0000 |
commit | 686435fc9fced939a525b7437ec3e7af6c01aee0 (patch) | |
tree | b9b04b65e175e48f9d884da3d6fabadce7c95026 | |
parent | a61e707828228c11860c6573ca992ad55a379c0a (diff) | |
download | cpt-686435fc9fced939a525b7437ec3e7af6c01aee0.tar.gz |
cpt-revdepends: fix grep usage, and $tmp_dir
FossilOrigin-Name: f51f87ee1550beaf2b698922c8887806d39c9aa85c9325037f5a46061716624d
-rwxr-xr-x | contrib/cpt-revdepends | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/cpt-revdepends b/contrib/cpt-revdepends index 833dea2..e8e8143 100755 --- a/contrib/cpt-revdepends +++ b/contrib/cpt-revdepends @@ -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 |