Module Name:    src
Committed By:   pooka
Date:           Thu Feb 14 10:54:55 UTC 2013

Modified Files:
        src/sys/rump/librump: makerumpif.sh

Log Message:
Make it possible to manually specify the top level directory; for cases
where the target hierarchy is outside of the main tree.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/rump/librump/makerumpif.sh

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

Modified files:

Index: src/sys/rump/librump/makerumpif.sh
diff -u src/sys/rump/librump/makerumpif.sh:1.5 src/sys/rump/librump/makerumpif.sh:1.6
--- src/sys/rump/librump/makerumpif.sh:1.5	Wed Sep  1 19:32:11 2010
+++ src/sys/rump/librump/makerumpif.sh	Thu Feb 14 10:54:54 2013
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#	$NetBSD: makerumpif.sh,v 1.5 2010/09/01 19:32:11 pooka Exp $
+#	$NetBSD: makerumpif.sh,v 1.6 2013/02/14 10:54:54 pooka Exp $
 #
 # Copyright (c) 2009 Antti Kantee.  All rights reserved.
 #
@@ -47,14 +47,25 @@ boom ()
 	exit 1
 }
 
-[ $# != 1 ] && usage
+unset TOPDIR
+if [ $# -eq 3 ]; then
+	if [ $1 = '-R' ]; then
+		TOPDIR=$2
+	else
+		usage
+	fi
+	shift; shift
+fi
+[ $# -ne 1 ] && usage
 
 MYDIR=`pwd`
-while [ ! -f Makefile.rump  ]; do
-	[ `pwd` = '/' ] && boom Could not find rump topdir.
-	cd ..
-done
-RUMPTOP="`pwd`"
+if [ -z "${TOPDIR}" ]; then
+	while [ ! -f Makefile.rump  ]; do
+		[ `pwd` = '/' ] && boom Could not find rump topdir.
+		cd ..
+	done
+	TOPDIR="`pwd`"
+fi
 cd ${MYDIR}
 
 sed -e '
@@ -64,12 +75,12 @@ sed -e '
 		s/[ 	]*\\\n[ 	]*/ /
 		b again
 	}
-' ${1} | awk -F\| -v rumptop=${RUMPTOP} '
+' ${1} | awk -F\| -v topdir=${TOPDIR} '
 function fileheaders(file, srcstr)
 {
-	printf("/*\t$NetBSD: makerumpif.sh,v 1.5 2010/09/01 19:32:11 pooka Exp $\t*/\n\n") > file
+	printf("/*\t$NetBSD: makerumpif.sh,v 1.6 2013/02/14 10:54:54 pooka Exp $\t*/\n\n") > file
 	printf("/*\n * Automatically generated.  DO NOT EDIT.\n") > file
-	genstr = "$NetBSD: makerumpif.sh,v 1.5 2010/09/01 19:32:11 pooka Exp $"
+	genstr = "$NetBSD: makerumpif.sh,v 1.6 2013/02/14 10:54:54 pooka Exp $"
 	gsub("\\$", "", genstr)
 	printf(" * from: %s\n", srcstr) > file
 	printf(" * by:   %s\n", genstr) > file
@@ -91,9 +102,9 @@ NR == 1 {
 }
 
 $1 == "NAME"{myname = $2;next}
-$1 == "PUBHDR"{pubhdr = rumptop "/" $2;print pubhdr;next}
-$1 == "PRIVHDR"{privhdr = rumptop "/" $2;print privhdr;next}
-$1 == "WRAPPERS"{gencalls = rumptop "/" $2;print gencalls;next}
+$1 == "PUBHDR"{pubhdr = topdir "/" $2;print pubhdr;next}
+$1 == "PRIVHDR"{privhdr = topdir "/" $2;print privhdr;next}
+$1 == "WRAPPERS"{gencalls = topdir "/" $2;print gencalls;next}
 
 /^;/{next}
 /\\$/{sub("\\\n", "");getline nextline;$0 = $0 nextline}

Reply via email to