2006-07-17 20:50:06 -04:00
|
|
|
#!/bin/sh
|
2006-07-20 11:25:26 -04:00
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# Name: is_text.sh
|
|
|
|
# Purpose: returns 0 if the file in cvs tree is text, 1 if binary
|
|
|
|
# Version: $Id$
|
|
|
|
# Author: VZ
|
|
|
|
# Created: 2006-07-19
|
|
|
|
# Copyright: (c) Vadim Zeitlin 2006 <vadim@wxwindows.org>
|
|
|
|
###############################################################################
|
|
|
|
|
2006-07-17 20:50:06 -04:00
|
|
|
if [ $# != 1 ]; then
|
|
|
|
echo "Usage: $0 <file>" >&2
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
|
|
|
entries=`dirname $1`/CVS/Entries
|
|
|
|
if [ ! -f $entries ]; then
|
|
|
|
echo "CVS entries file \"$entries\" not found." >&2
|
|
|
|
exit 3
|
|
|
|
fi
|
|
|
|
|
2006-07-20 11:25:26 -04:00
|
|
|
# we look for -kb in the last field, optionally followed by tag name
|
|
|
|
re="^/`basename $1`/.*/-kb/\(T[^/]*\)\{0,1\}$"
|
2006-07-17 20:50:06 -04:00
|
|
|
if grep -q "$re" $entries; then
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2006-07-20 11:12:34 -04:00
|
|
|
exit 0
|