Improvements to the proposed shell code.
This commit is contained in:
parent
07a3a2906c
commit
ae48cf5798
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=113913
@ -1,20 +1,19 @@
|
||||
# $FreeBSD$
|
||||
|
||||
# Shell code to remove FreeBSD tags before merging
|
||||
grep -rl '\$Fre.BSD:' . |
|
||||
while read f ; do
|
||||
grep -rl '\$Fre.BSD:' . >tags
|
||||
while read f < tags ; do
|
||||
sed -i.orig -e '/\$Fre.BSD:/d' $f
|
||||
done
|
||||
|
||||
# Shell + Perl code to add FreeBSD tags wherever an OpenBSD or Id tag occurs
|
||||
egrep -rl '\$(Id|OpenBSD):' . |
|
||||
cat tags |
|
||||
xargs perl -n -i.orig -e 'print; s/\$(Id|OpenBSD): [^\$]*\$/\$FreeBSD\$/ && print'
|
||||
|
||||
# Shell code to reexpand FreeBSD tags
|
||||
grep -rl '\$FreeBSD\$' . |
|
||||
while read f ; do
|
||||
while read f < tags ; do
|
||||
id=$(cvs diff $f | grep '\$Fre.BSD:' | sed 's/.*\(\$Fre.BSD:.*\$\).*/\1/') ;
|
||||
if [ -n "$id" ] ; then
|
||||
if [ -n "$id" ] ; then
|
||||
sed -i.orig -e "s@\\\$Fre.BSD\\\$@$id@" $f ;
|
||||
fi ;
|
||||
fi ;
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user