Module Name:    src
Committed By:   riastradh
Date:           Mon Aug 27 00:46:22 UTC 2018

Modified Files:
        src/sys/external/bsd/drm2/nouveau: nouveau2netbsd
Added Files:
        src/sys/external/bsd/drm2: prepare-import.sh

Log Message:
Move cleantags and rcsid decorations to prepare-import.sh.

Also decorate .h files.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/external/bsd/drm2/prepare-import.sh
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm2/nouveau/nouveau2netbsd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/nouveau/nouveau2netbsd
diff -u src/sys/external/bsd/drm2/nouveau/nouveau2netbsd:1.4 src/sys/external/bsd/drm2/nouveau/nouveau2netbsd:1.5
--- src/sys/external/bsd/drm2/nouveau/nouveau2netbsd:1.4	Mon Aug 27 00:46:10 2018
+++ src/sys/external/bsd/drm2/nouveau/nouveau2netbsd	Mon Aug 27 00:46:21 2018
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-#	$NetBSD: nouveau2netbsd,v 1.4 2018/08/27 00:46:10 riastradh Exp $
+#	$NetBSD: nouveau2netbsd,v 1.5 2018/08/27 00:46:21 riastradh Exp $
 #
 # $ /path/to/nouveau2netbsd > /path/to/files.nouveau.new
 #
@@ -82,35 +82,6 @@ while read from to; do
 	if [ "x$from" != "x$to" ]; then
 		${MV} -f -- "$from" "$to"
 	fi
-        # Probably not necessary -- Linux tends not to have RCS ids --
-        # but a precaution out of paranoia.
-        cleantags "$to"
-	case $to in
-	*.c)
-		# 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
-			}
-		' < "$to" > "$to".tmp
-		;;
-	esac
-	mv -f -- "$to".tmp "$to"
 	printf 'file\t%s\t%s\n' "$nouveau_top/$to" "$nouveau_flag"
 done < "$filemap" | sort
 

Added files:

Index: src/sys/external/bsd/drm2/prepare-import.sh
diff -u /dev/null src/sys/external/bsd/drm2/prepare-import.sh:1.1
--- /dev/null	Mon Aug 27 00:46:22 2018
+++ src/sys/external/bsd/drm2/prepare-import.sh	Mon Aug 27 00:46:21 2018
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+#	$NetBSD: prepare-import.sh,v 1.1 2018/08/27 00:46:21 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$NetBSD: prepare-import.sh,v 1.1 2018/08/27 00:46:21 riastradh Exp $\t*/\n\n' && 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

Reply via email to