Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/rump/librump Make it possible to manually specify the to...



details:   https://anonhg.NetBSD.org/src/rev/3fb5737aab64
branches:  trunk
changeset: 784935:3fb5737aab64
user:      pooka <pooka%NetBSD.org@localhost>
date:      Thu Feb 14 10:54:54 2013 +0000

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

diffstat:

 sys/rump/librump/makerumpif.sh |  37 ++++++++++++++++++++++++-------------
 1 files changed, 24 insertions(+), 13 deletions(-)

diffs (72 lines):

diff -r d63ccf85316e -r 3fb5737aab64 sys/rump/librump/makerumpif.sh
--- a/sys/rump/librump/makerumpif.sh    Thu Feb 14 09:34:46 2013 +0000
+++ b/sys/rump/librump/makerumpif.sh    Thu Feb 14 10:54:54 2013 +0000
@@ -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 @@
        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 @@
                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 @@
 }
 
 $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}



Home | Main Index | Thread Index | Old Index