Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/gpl2/dtc Add a dtc2netbsd script
details: https://anonhg.NetBSD.org/src/rev/20b0dec30dfe
branches: trunk
changeset: 354237:20b0dec30dfe
user: skrll <skrll%NetBSD.org@localhost>
date: Thu Jun 08 15:51:12 2017 +0000
description:
Add a dtc2netbsd script
diffstat:
external/gpl2/dtc/dtc2netbsd | 124 +++++++++++++++++++++++++++++++++++++++++++
1 files changed, 124 insertions(+), 0 deletions(-)
diffs (128 lines):
diff -r 902e09a7724b -r 20b0dec30dfe external/gpl2/dtc/dtc2netbsd
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/gpl2/dtc/dtc2netbsd Thu Jun 08 15:51:12 2017 +0000
@@ -0,0 +1,124 @@
+#! /bin/sh
+#
+# $NetBSD: dtc2netbsd,v 1.1 2017/06/08 15:51:12 skrll Exp $
+#
+#
+# Copyright (c) 2017 The NetBSD Foundation, Inc.
+# All rights reserved.
+#
+# This code is derived from software contributed to The NetBSD Foundation
+# by Nick Hudson
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+# dtc2netbsd: convert a dtc source tree into netbsd dtc/libfdt source trees
+#
+# Rough instructions for importing new dtc release:
+#
+# $ cd /some/where/temporary
+# $ tar xpfz /dtc/release/tar/file
+# $ DTCSRCS=$(pwd)
+# $ WRKDIR=/an/other/temporary
+# $ sh /usr/src/external/gpl2/dtc/dtc2netbsd $DTCSRCS $WRKDIR
+#
+# Import libfdt using
+# $ cd $WRKDIR/libfdt
+# $ cvs import -m "Import libfdt <version>" src/sys/external/bsd/libfdt/dist DTC dtc-<version>
+#
+# merge libfdt sources using, e.g.
+# $ cvs -d cvs.netbsd.org:/cvsroot checkout -jdtc-1-4-1 -jdtc-1-4-4 src/sys/external/bsd/libfdt/dist
+#
+# Import dtc using
+# $ cd $WRKDIR/dtc
+# $ cvs import -m "Import dtc YYYY-MM-DD" src/external/gpl2/dtc/dist DTC dtc-<version>
+# merge dtc sources using, e.g.
+# $ cvs -d cvs.netbsd.org:/cvsroot checkout -jdtc-1-4-1 -jdtc-1-4-4 src/external/gpl2/dtc/dist
+
+if [ $# -ne 2 ]; then echo "dtc2netbsd dtcsrc tmpdir"; exit 1; fi
+
+r=$1
+d=$2
+
+case "$d" in
+ /*)
+ ;;
+ *)
+ d=`/bin/pwd`/$d
+ ;;
+esac
+
+case "$r" in
+ /*)
+ ;;
+ *)
+ r=`/bin/pwd`/$r
+ ;;
+esac
+
+echo preparing directory $d
+rm -rf $d
+mkdir -p $d/dtc
+
+### Copy the files and directories
+echo copying $r to $d
+cd $r
+pax -rw * $d/dtc
+mv $d/dtc/libfdt $d/libfdt
+
+# cd to import directory
+cd $d
+
+#
+
+### Remove the $'s around RCS tags
+cleantags $d
+
+### Add our NetBSD RCS Id
+find $d -type f -name '*.[chly]' -print | while read c; do
+ sed 1q < $c | grep -q '\$NetBSD' || (
+echo "/* \$NetBSD\$ */" >/tmp/dtc$$
+echo "" >>/tmp/dtc$$
+cat $c >> /tmp/dtc$$
+mv /tmp/dtc$$ $c && echo added NetBSD RCS tag to $c
+ )
+done
+
+echo done
+
+### Clean up any CVS directories that might be around.
+echo "cleaning up CVS residue."
+(
+ cd $d
+ find . -type d -name "CVS" -print | xargs rm -r
+)
+echo done
+
+### Fixing file and directory permissions.
+echo "Fixing file/directory permissions."
+(
+ cd $d
+ find . -type f -print | xargs chmod u+rw,go+r
+ find . -type d -print | xargs chmod u+rwx,go+rx
+)
+echo done
+
+exit 0
Home |
Main Index |
Thread Index |
Old Index