From 5c91ed92d5fff0ca1cf9ffce79f1d15225ae7ae3 Mon Sep 17 00:00:00 2001 From: emmett1 Date: Wed, 7 Dec 2022 21:25:34 +0800 Subject: [PATCH] fix scratch_search when only single port exist in repo --- scratch | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scratch b/scratch index da43056..33a29e5 100755 --- a/scratch +++ b/scratch @@ -959,7 +959,11 @@ scratch_search() { arg=$* for repo in $PORT_REPO; do [ -d $repo ] || continue - out=$(grep -R "# description" $repo/*/$BUILD_SCRIPT | grep -i "$arg" | awk -F : '{print $1}' | sort) + dummyport=/tmp/dummyport + mkdir -p $dummyport + touch $dummyport/spkgbuild + out=$(grep -R "# description" $repo/*/$BUILD_SCRIPT /tmp/dummy-port/spkgbuild | grep -i "$arg" | awk -F : '{print $1}' | sort) + rm -fr $dummyport [ "$out" ] || continue found=1 for line in $out; do