| @@ -1,16 +1,16 @@ | | | @@ -1,16 +1,16 @@ |
1 | #! /bin/sh | | 1 | #! /bin/sh |
2 | # | | 2 | # |
3 | # $NetBSD: heimdal2netbsd,v 1.6 2014/04/22 14:07:31 pettai Exp $ | | 3 | # $NetBSD: heimdal2netbsd,v 1.7 2017/01/27 18:02:09 christos Exp $ |
4 | # | | 4 | # |
5 | # Copyright (c) 2011 The NetBSD Foundation, Inc. | | 5 | # Copyright (c) 2011 The NetBSD Foundation, Inc. |
6 | # All rights reserved. | | 6 | # All rights reserved. |
7 | # | | 7 | # |
8 | # Redistribution and use in source and binary forms, with or without | | 8 | # Redistribution and use in source and binary forms, with or without |
9 | # modification, are permitted provided that the following conditions | | 9 | # modification, are permitted provided that the following conditions |
10 | # are met: | | 10 | # are met: |
11 | # 1. Redistributions of source code must retain the above copyright | | 11 | # 1. Redistributions of source code must retain the above copyright |
12 | # notice, this list of conditions and the following disclaimer. | | 12 | # notice, this list of conditions and the following disclaimer. |
13 | # 2. Redistributions in binary form must reproduce the above copyright | | 13 | # 2. Redistributions in binary form must reproduce the above copyright |
14 | # notice, this list of conditions and the following disclaimer in the | | 14 | # notice, this list of conditions and the following disclaimer in the |
15 | # documentation and/or other materials provided with the distribution. | | 15 | # documentation and/or other materials provided with the distribution. |
16 | # | | 16 | # |
| @@ -174,36 +174,36 @@ for f in $d/lib/sl/slc-gram.y $d/lib/com | | | @@ -174,36 +174,36 @@ for f in $d/lib/sl/slc-gram.y $d/lib/com |
174 | sed -E -e "s,(.#include <)($KRB5_INCRE)\\.h>,\\1krb5/\\2.h>," \ | | 174 | sed -E -e "s,(.#include <)($KRB5_INCRE)\\.h>,\\1krb5/\\2.h>," \ |
175 | < $f > /tmp/heimdal1f$$ && mv /tmp/heimdal1f$$ $f && \ | | 175 | < $f > /tmp/heimdal1f$$ && mv /tmp/heimdal1f$$ $f && \ |
176 | echo fixing include paths in $f | | 176 | echo fixing include paths in $f |
177 | done | | 177 | done |
178 | | | 178 | |
179 | # Freeze imported NetBSD RCSID's. | | 179 | # Freeze imported NetBSD RCSID's. |
180 | find $d -type f -print | xargs egrep -l '\$NetBSD:' | while read f; do | | 180 | find $d -type f -print | xargs egrep -l '\$NetBSD:' | while read f; do |
181 | sed \ | | 181 | sed \ |
182 | -e 's/\$\(NetBSD.*\) \$/\1/' \ | | 182 | -e 's/\$\(NetBSD.*\) \$/\1/' \ |
183 | < $f > /tmp/heimdal1f$$ && mv /tmp/heimdal1f$$ $f && \ | | 183 | < $f > /tmp/heimdal1f$$ && mv /tmp/heimdal1f$$ $f && \ |
184 | echo froze NetBSD RCSID for $f | | 184 | echo froze NetBSD RCSID for $f |
185 | done | | 185 | done |
186 | | | 186 | |
| | | 187 | ### Remove the $'s around RCS tags |
| | | 188 | cleantags $d |
| | | 189 | |
187 | # Convert unexpanded RCSID's to the NetBSD way. | | 190 | # Convert unexpanded RCSID's to the NetBSD way. |
188 | find $d -type f -print | xargs egrep -l 'RCSID\("\$Id\$"\)' | while read f; do | | 191 | find $d -type f -print | xargs egrep -l 'RCSID\("Id"\)' | while read f; do |
189 | sed -e 's/RCSID("\$\Id\$")/__RCSID("\$NetBSD\$")/' \ | | 192 | sed -e 's/RCSID("Id")/__RCSID("\$NetBSD\$")/' \ |
190 | < $f > /tmp/heimdal1f$$ && mv /tmp/heimdal1f$$ $f && \ | | 193 | < $f > /tmp/heimdal1f$$ && mv /tmp/heimdal1f$$ $f && \ |
191 | echo converted RCSID to NetBSD for $f | | 194 | echo converted RCSID to NetBSD for $f |
192 | done | | 195 | done |
193 | | | 196 | |
194 | ### Remove the $'s around RCS tags | | | |
195 | cleantags $d | | | |
196 | | | | |
197 | ### Add our NetBSD RCS Id | | 197 | ### Add our NetBSD RCS Id |
198 | find $d -type f -name '*.[chly]' -print | while read c; do | | 198 | find $d -type f -name '*.[chly]' -print | while read c; do |
199 | sed 1q < $c | grep -q '\$NetBSD' || ( | | 199 | sed 1q < $c | grep -q '\$NetBSD' || ( |
200 | echo "/* \$NetBSD\$ */" >/tmp/${prog}3n$$ | | 200 | echo "/* \$NetBSD\$ */" >/tmp/${prog}3n$$ |
201 | echo "" >>/tmp/${prog}3n$$ | | 201 | echo "" >>/tmp/${prog}3n$$ |
202 | cat $c >> /tmp/${prog}3n$$ | | 202 | cat $c >> /tmp/${prog}3n$$ |
203 | mv /tmp/${prog}3n$$ $c && echo added NetBSD RCS tag to $c | | 203 | mv /tmp/${prog}3n$$ $c && echo added NetBSD RCS tag to $c |
204 | ) | | 204 | ) |
205 | done | | 205 | done |
206 | | | 206 | |
207 | find $d -type f -name '*.[0-9]' -print | while read m; do | | 207 | find $d -type f -name '*.[0-9]' -print | while read m; do |
208 | sed 1q < $m | grep -q '\$NetBSD' || ( | | 208 | sed 1q < $m | grep -q '\$NetBSD' || ( |
209 | echo ".\\\" \$NetBSD\$" >/tmp/${prog}2m$$ | | 209 | echo ".\\\" \$NetBSD\$" >/tmp/${prog}2m$$ |