summaryrefslogtreecommitdiffstats
path: root/crypto/openssh/FREEBSD-tricks
blob: 4ae543986b3f44cdf14b9fe22e0023f9cca9f0d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# $FreeBSD$

# Shell code to remove FreeBSD tags before merging
grep -rl '\$Fre.BSD:' . >tags
cat tags | while read f ; do
    sed -i.orig -e '/\$Fre.BSD:/d' $f
done

# Shell + Perl code to add FreeBSD tags wherever an OpenBSD or Id tag occurs
cat tags |
xargs perl -n -i.orig -e 'print; s/\$(Id|OpenBSD): [^\$]*\$/\$FreeBSD\$/ && print'

# Shell code to reexpand FreeBSD tags
cat tags | while read f ; do
    id=$(cvs diff $f | grep '\$Fre.BSD:' | sed 's/.*\(\$Fre.BSD:.*\$\).*/\1/') ;
    if [ -n "$id" ] ; then
        sed -i.orig -e "s@\\\$Fre.BSD\\\$@$id@" $f ;
    fi ;
done
OpenPOWER on IntegriCloud