blob: 14202f3bb064d6468c5b9c023e1822378d4e2d0f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
#!/bin/sh
# $NetBSD: prepare-import.sh,v 1.2 2021/12/19 10:20:38 riastradh Exp $
#
# $ /path/to/prepare-import.sh
#
# Run from the directory that will be imported as
# sys/external/bsd/drm2/dist. Be sure to also run drm/drm2netbsd and
# nouveau/nouveau2netbsd in their respective directories.
set -Ceu
find . -name '*.h' \
| while read f; do
cleantags "$f"
(printf '/*\t%c%s%c\t*/\n\n' '$' NetBSD '$' && cat -- "$f") > "$f".tmp
mv -f -- "$f".tmp "$f"
done
find . -name '*.c' \
| while read f; do
# Probably not necessary -- Linux tends not to have RCS ids --
# but a precaution out of paranoia.
cleantags "$f"
# Heuristically apply NetBSD RCS ids: a comment at the top of
# the file, and a __KERNEL_RCSID before the first cpp line,
# which, with any luck, should be the first non-comment line
# and lie between the copyright notice and the header.
awk '
BEGIN {
done = 0
printf("/*\t%c%s%c\t*/\n\n", "$","NetBSD","$")
}
/^#/ && !done {
printf("#include <sys/cdefs.h>\n")
printf("__KERNEL_RCSID(0, \"%c%s%c\");\n",
"$","NetBSD","$")
printf("\n")
done = 1
}
{
print
}
' < "$f" > "$f".tmp
mv -f -- "$f".tmp "$f"
done
|