* updated gtk (4.14.4 -> 4.15.2)
[t2sde.git] / scripts / Find-Pkg
blobceec435c8bc64e76820dd3d630785dc578c4541e
1 #!/usr/bin/env bash
2 # --- T2-COPYRIGHT-NOTE-BEGIN ---
3 # T2 SDE: scripts/Find-Pkg
4 # Copyright (C) 2004 - 2023 The T2 SDE Project
5 #
6 # This Copyright note is generated by scripts/Create-CopyPatch,
7 # more information can be found in the files COPYING and README.
8 #
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License version 2.
11 # --- T2-COPYRIGHT-NOTE-END ---
13 matched=0
15 echo "Searching for matching package names ..."
16 pkg="`echo "$1" | tr A-Z a-z`"
17 x="`cd package/; ls -d */*$pkg* 2>/dev/null`"
19 if [ -n "$x" ]; then
20 echo -e "$x\n"
21 matched=1
24 echo "Searching in package descriptions (may take some time) ..."
25 # grep --color does not work with -i (at least not in GNU sed 2.5.1),
26 # so colorize via sed
27 grep -i "[(\I\|T\)].*$1" package/*/*/*.desc | sed "/$1/I s//\o033[31;1m&\o033[0m/g"
28 [ $? -eq 0 ] && matched=1
30 [ $matched = 0 ] && echo "No match found ..."