export LANG
if test "$1" = "-h" -o "$1" = "--help" -o $# -gt 2; then
- echo "Usage: $0 [new_prefix] [old prefix]
+ echo "Usage: $0 [old prefix] [new prefix]
Without arguments, this script assumes old prefix = @@CONTRIB_PREFIX@@,
and new prefix = current directory.
new_prefix=$2
fi
-# process [dir] [filemask]
+# process [dir] [filemask] [text only]
process() {
for file in `find $1 -maxdepth 1 -type f -name "$2"`
do
+ if [ -n "$3" ]
+ then
+ file $file | sed "s/^.*: //" | grep -q 'text\|shell' || continue
+ fi
echo "Fixing up $file"
sed -i.orig -e "s,$old_prefix,$new_prefix,g" $file
rm -f $file.orig
done
}
-process bin/ "*"
+process bin/ "*" check
process lib/ "*.la"
process lib/pkgconfig/ "*.pc"