Update 2024-02-14 07:51 OpenBSD/amd64-x13
This commit is contained in:
29
.bin/OLD/psearch
Executable file
29
.bin/OLD/psearch
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
|
||||
_term="$@"
|
||||
_dir="/usr/ports"
|
||||
|
||||
find $_dir/* -mindepth 1 -maxdepth 1 -name "Makefile" \
|
||||
| while read _cmakefile
|
||||
do
|
||||
echo $_cmakefile | sed "s|$_dir/\(.*\)/Makefile|\1|g" \
|
||||
| while read _cat
|
||||
do
|
||||
cat $_dir/$_cat/Makefile \
|
||||
| fgrep SUBDIR \
|
||||
| cut -d"=" -f2 \
|
||||
| while read _port
|
||||
do
|
||||
if [ -f "$_dir/$_cat/$_port/pkg/DESCR" ]
|
||||
then
|
||||
fgrep -q "$_term" $_dir/$_cat/$_port/pkg/DESCR
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
echo "Match in $_cat/$_port:"
|
||||
cat $_dir/$_cat/$_port/pkg/DESCR
|
||||
echo "--------------------------"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
done
|
||||
Reference in New Issue
Block a user