2002-10-29 09:56:16 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
# Shell code to remove FreeBSD tags before merging
|
2002-10-29 10:12:51 +00:00
|
|
|
grep -rl '\$Fre.BSD:' . |
|
2002-10-29 09:56:16 +00:00
|
|
|
while read f ; do
|
2002-10-29 10:12:51 +00:00
|
|
|
sed -i.orig -e '/\$Fre.BSD:/d' $f
|
2002-10-29 09:56:16 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
# Shell + Perl code to add FreeBSD tags wherever an OpenBSD or Id tag occurs
|
2002-10-29 10:12:51 +00:00
|
|
|
egrep -rl '\$(Id|OpenBSD):' . |
|
2002-10-29 09:56:16 +00:00
|
|
|
xargs perl -n -i.orig -e 'print; s/\$(Id|OpenBSD): [^\$]*\$/\$FreeBSD\$/ && print'
|
|
|
|
|
|
|
|
# Shell code to reexpand FreeBSD tags
|
2002-10-29 10:12:51 +00:00
|
|
|
grep -rl '\$FreeBSD\$' . |
|
2002-10-29 09:56:16 +00:00
|
|
|
while read f ; do
|
2002-10-29 10:12:51 +00:00
|
|
|
id=$(cvs diff $f | grep '\$Fre.BSD:' | sed 's/.*\(\$Fre.BSD:.*\$\).*/\1/') ;
|
2002-10-29 09:56:16 +00:00
|
|
|
if [ -n "$id" ] ; then
|
2002-10-29 10:12:51 +00:00
|
|
|
sed -i.orig -e "s@\\\$Fre.BSD\\\$@$id@" $f ;
|
2002-10-29 09:56:16 +00:00
|
|
|
fi ;
|
|
|
|
done
|