3
# This Source Code Form is subject to the terms of the Mozilla Public
4
# License, v. 2.0. If a copy of the MPL was not distributed with this
5
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
# This script will match a dir with a set of dirs.
10
# Usage: match-dir.sh match [dir1 dir2 ... dirn]
12
# Send comments, improvements, bugs to ramiro@netscape.com
15
if [ -f Makefile ]; then
18
if [ -f Makefile.in ]; then
19
MAKEFILE="Makefile.in"
22
echo "There ain't no 'Makefile' or 'Makefile.in' over here: $pwd, dude."
28
# Use DEPTH in the Makefile.in to determine the depth
29
depth=`grep -w DEPTH ${MAKEFILE} | grep "\.\." | awk -F"=" '{ print $2; }'`
32
# Determine the depth count
33
n=`echo $depth | tr '/' ' ' | wc -w`
38
path=`echo $cwd | sed "s|^${objdir}/||"`
44
# echo "Looking for $match in $i"
46
echo $i | grep -q -x $match
55
# echo "Looking for $i in $match"
57
echo $match | grep -q $i