]>
Commit | Line | Data |
---|---|---|
37ab190f | 1 | #!/bin/sh |
da44b91e VZ |
2 | |
3 | ############################################################################### | |
4 | # Name: is_text.sh | |
5 | # Purpose: returns 0 if the file in cvs tree is text, 1 if binary | |
6 | # Version: $Id$ | |
7 | # Author: VZ | |
8 | # Created: 2006-07-19 | |
9 | # Copyright: (c) Vadim Zeitlin 2006 <vadim@wxwindows.org> | |
10 | ############################################################################### | |
11 | ||
37ab190f KO |
12 | if [ $# != 1 ]; then |
13 | echo "Usage: $0 <file>" >&2 | |
14 | exit 2 | |
15 | fi | |
16 | ||
948ddccf CE |
17 | # don't do configure; config.sub; config.guess |
18 | if [ `basename $1` = "configure" ] ; then | |
19 | exit 1 | |
20 | fi | |
21 | if [ `basename $1` = "config.sub" ] ; then | |
22 | exit 1 | |
23 | fi | |
24 | if [ `basename $1` = "config.guess" ] ; then | |
25 | exit 1 | |
26 | fi | |
27 | ||
37ab190f KO |
28 | entries=`dirname $1`/CVS/Entries |
29 | if [ ! -f $entries ]; then | |
30 | echo "CVS entries file \"$entries\" not found." >&2 | |
31 | exit 3 | |
32 | fi | |
33 | ||
da44b91e VZ |
34 | # we look for -kb in the last field, optionally followed by tag name |
35 | re="^/`basename $1`/.*/-kb/\(T[^/]*\)\{0,1\}$" | |
37ab190f KO |
36 | if grep -q "$re" $entries; then |
37 | exit 1 | |
38 | fi | |
39 | ||
708e7305 | 40 | exit 0 |