add sort to pkgquery and scratch search function

This commit is contained in:
emmett1
2020-01-31 23:19:21 +08:00
parent cf8d6c9cc9
commit be8cbb552a
2 changed files with 2 additions and 2 deletions

View File

@@ -145,7 +145,7 @@ pkg_search() {
needarg $@
arg=$*
for repo in $REPO; do
out=$(grep -R "# description" $repo | grep $BUILD_SCRIPT | grep "$arg" | awk -F : '{print $1}')
out=$(grep -R "# description" $repo | grep $BUILD_SCRIPT | grep "$arg" | awk -F : '{print $1}' | sort)
[ "$out" ] || continue
for line in $out; do
repo=$(echo $line | rev | awk -F / '{print $3}' | rev)

View File

@@ -902,7 +902,7 @@ scratch_search() {
needarg $@
arg=$*
for repo in $PORT_REPO; do
out=$(grep -R "# description" $repo | grep $BUILD_SCRIPT | grep "$arg" | awk -F : '{print $1}')
out=$(grep -R "# description" $repo | grep $BUILD_SCRIPT | grep "$arg" | awk -F : '{print $1}' | sort)
[ "$out" ] || continue
found=1
for line in $out; do