#!/bin/bash # --- T2-COPYRIGHT-NOTE-BEGIN --- # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # T2 SDE: scripts/Find-Pkg # Copyright (C) 2004 - 2006 The T2 SDE Project # # More information can be found in the files COPYING and README. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. A copy of the # GNU General Public License can be found in the file COPYING. # --- T2-COPYRIGHT-NOTE-END --- matched=0 echo "Searching for matching package names ..." pkg="`echo "$1" | tr A-Z a-z`" x="`cd package/ ; ls -d */*$pkg* 2>/dev/null`" if [ -n "$x" ] ; then echo -e "$x\n" matched=1 fi echo "Searching in package descriptions (may take some time) ..." # grep --color does not work with -i (at least not in GNU sed 2.5.1), # so colorize via sed grep -i "[(\I\|T\)].* $1" package/*/*/*.desc | sed "/$1/I s//\o033[31;1m&\o033[0m/g" [ $? -eq 0 ] && matched=1 [ $matched = 0 ] && echo "No match found ..."