head	1.2;
access;
symbols
	netbsd-10-2-RELEASE:1.2
	netbsd-9-5-RELEASE:1.2
	netbsd-11-0-RELEASE:1.2
	netbsd-11-0-RC7:1.2
	netbsd-11-0-RC6:1.2
	netbsd-11-0-RC5:1.2
	netbsd-11-0-RC4:1.2
	netbsd-11-0-RC3:1.2
	netbsd-11-0-RC2:1.2
	netbsd-11-0-RC1:1.2
	perseant-exfatfs-base-20250801:1.2
	netbsd-11:1.2.0.22
	netbsd-11-base:1.2
	netbsd-10-1-RELEASE:1.2
	perseant-exfatfs-base-20240630:1.2
	perseant-exfatfs:1.2.0.20
	perseant-exfatfs-base:1.2
	netbsd-8-3-RELEASE:1.2.4.2
	netbsd-9-4-RELEASE:1.2
	netbsd-10-0-RELEASE:1.2
	netbsd-10-0-RC6:1.2
	netbsd-10-0-RC5:1.2
	netbsd-10-0-RC4:1.2
	netbsd-10-0-RC3:1.2
	netbsd-10-0-RC2:1.2
	netbsd-10-0-RC1:1.2
	netbsd-10:1.2.0.18
	netbsd-10-base:1.2
	netbsd-9-3-RELEASE:1.2
	cjep_sun2x-base1:1.2
	cjep_sun2x:1.2.0.16
	cjep_sun2x-base:1.2
	cjep_staticlib_x-base1:1.2
	netbsd-9-2-RELEASE:1.2
	cjep_staticlib_x:1.2.0.14
	cjep_staticlib_x-base:1.2
	netbsd-9-1-RELEASE:1.2
	phil-wifi-20200421:1.2
	phil-wifi-20200411:1.2
	is-mlppp:1.2.0.12
	is-mlppp-base:1.2
	phil-wifi-20200406:1.2
	netbsd-8-2-RELEASE:1.2.4.2
	netbsd-9-0-RELEASE:1.2
	netbsd-9-0-RC2:1.2
	netbsd-9-0-RC1:1.2
	phil-wifi-20191119:1.2
	netbsd-9:1.2.0.10
	netbsd-9-base:1.2
	phil-wifi-20190609:1.2
	netbsd-8-1-RELEASE:1.2.4.2
	netbsd-8-1-RC1:1.2.4.2
	pgoyette-compat-merge-20190127:1.2
	pgoyette-compat-20190127:1.2
	pgoyette-compat-20190118:1.2
	pgoyette-compat-1226:1.2
	pgoyette-compat-1126:1.2
	pgoyette-compat-1020:1.2
	pgoyette-compat-0930:1.2
	pgoyette-compat-0906:1.2
	pgoyette-compat-0728:1.2
	netbsd-8-0-RELEASE:1.2.4.2
	phil-wifi:1.2.0.8
	phil-wifi-base:1.2
	pgoyette-compat-0625:1.2
	netbsd-8-0-RC2:1.2.4.2
	pgoyette-compat-0521:1.2
	pgoyette-compat-0502:1.2
	pgoyette-compat-0422:1.2
	netbsd-8-0-RC1:1.2.4.2
	pgoyette-compat-0415:1.2
	pgoyette-compat-0407:1.2
	pgoyette-compat-0330:1.2
	pgoyette-compat-0322:1.2
	pgoyette-compat-0315:1.2
	pgoyette-compat:1.2.0.6
	pgoyette-compat-base:1.2
	matt-nb8-mediatek:1.2.4.2.0.2
	matt-nb8-mediatek-base:1.2.4.2
	netbsd-8:1.2.0.4
	perseant-stdc-iso10646:1.2.0.2
	perseant-stdc-iso10646-base:1.2;
locks; strict;
comment	@# @;


1.2
date	2017.06.16.22.47.22;	author jmcneill;	state Exp;
branches
	1.2.4.1;
next	1.1;
commitid	LDslgQS7WA1ZpEVz;

1.1
date	2017.06.08.15.51.12;	author skrll;	state Exp;
branches;
next	;
commitid	92CH0qzWDnchnAUz;

1.2.4.1
date	2017.06.16.22.47.22;	author snj;	state dead;
branches;
next	1.2.4.2;
commitid	ODe5xU9ximHZyJZz;

1.2.4.2
date	2017.07.18.17.17.52;	author snj;	state Exp;
branches;
next	;
commitid	ODe5xU9ximHZyJZz;


desc
@@


1.2
log
@Update the dtc version string to match the imported version and note that
version_gen.h should be updated when importing a new version.
@
text
@#! /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
#
# Update the version string in the version_gen.h header to match the imported version:
#	$ echo '#define DTC_VERSION "DTC 1.4.4"' > src/external/gpl2/dtc/usr.bin/dtc/version_gen.h

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
@


1.2.4.1
log
@file dtc2netbsd was added on branch netbsd-8 on 2017-07-18 17:17:52 +0000
@
text
@d1 127
@


1.2.4.2
log
@Pull up following revision(s) (requested by jmcneill in ticket #114):
	external/gpl2/dtc/Makefile: up to 1.1
	external/gpl2/dtc/Makefile.inc: up to 1.2
	external/gpl2/dtc/dist/.gitignore delete
	external/gpl2/dtc/dist/.travis.yml delete
	external/gpl2/dtc/dist/Documentation/dt-object-internal.txt: up to 1.1.1.1
	external/gpl2/dtc/dist/Documentation/manual.txt: up to 1.1.1.2
	external/gpl2/dtc/dist/Makefile: up to 1.1.1.2
	external/gpl2/dtc/dist/README: up to 1.1.1.2
	external/gpl2/dtc/dist/checks.c: up to 1.1.1.2
	external/gpl2/dtc/dist/convert-dtsv0-lexer.l: up to 1.1.1.2
	external/gpl2/dtc/dist/data.c: up to 1.3
	external/gpl2/dtc/dist/dtc-lexer.l: up to 1.3
	external/gpl2/dtc/dist/dtc-parser.y: up to 1.3
	external/gpl2/dtc/dist/dtc.c: up to 1.1.1.2
	external/gpl2/dtc/dist/dtc.h: up to 1.3
	external/gpl2/dtc/dist/fdtdump.c: up to 1.3
	external/gpl2/dtc/dist/fdtget.c: up to 1.1.1.2
	external/gpl2/dtc/dist/fdtput.c: up to 1.3
	external/gpl2/dtc/dist/flattree.c: up to 1.4
	external/gpl2/dtc/dist/fstree.c: up to 1.1.1.2
	external/gpl2/dtc/dist/libfdt/Makefile.libfdt delete
	external/gpl2/dtc/dist/libfdt/TODO delete
	external/gpl2/dtc/dist/libfdt/fdt.c delete
	external/gpl2/dtc/dist/libfdt/fdt.h delete
	external/gpl2/dtc/dist/libfdt/fdt_addresses.c delete
	external/gpl2/dtc/dist/libfdt/fdt_empty_tree.c delete
	external/gpl2/dtc/dist/libfdt/fdt_ro.c delete
	external/gpl2/dtc/dist/libfdt/fdt_rw.c delete
	external/gpl2/dtc/dist/libfdt/fdt_strerror.c delete
	external/gpl2/dtc/dist/libfdt/fdt_sw.c delete
	external/gpl2/dtc/dist/libfdt/fdt_wip.c delete
	external/gpl2/dtc/dist/libfdt/libfdt.h delete
	external/gpl2/dtc/dist/libfdt/libfdt_env.h delete
	external/gpl2/dtc/dist/libfdt/libfdt_internal.h delete
	external/gpl2/dtc/dist/libfdt/version.lds delete
	external/gpl2/dtc/dist/livetree.c: up to 1.1.1.2
	external/gpl2/dtc/dist/srcpos.c: up to 1.3
	external/gpl2/dtc/dist/srcpos.h: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/.gitignore: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/Makefile.tests: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/add_subnode_with_nops.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/addr_size_cells.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/appendprop1.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/appendprop2.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/asm_tree_dump.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/bad-octal-literal.dts: up to 1.1.1.1
	external/gpl2/dtc/dist/tests/boot-cpuid.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/char_literal.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/check_path.c: up to 1.1.1.1
	external/gpl2/dtc/dist/tests/del_node.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/del_property.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/division-by-zero.dts: up to 1.1.1.1
	external/gpl2/dtc/dist/tests/dtb_reverse.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/dtbs_equal_ordered.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/dtbs_equal_unordered.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/dumptrees.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/extra-terminating-null.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/find_property.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/get_alias.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/get_mem_rsv.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/get_name.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/get_path.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/get_phandle.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/getprop.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/incbin.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/integer-expressions.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/line_directives.dts: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/mangle-layout.c: up to 1.3
	external/gpl2/dtc/dist/tests/move_and_save.c: up to 1.3
	external/gpl2/dtc/dist/tests/node_check_compatible.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/node_offset_by_compatible.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/node_offset_by_phandle.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/node_offset_by_prop_value.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/nop_node.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/nop_property.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/nopulate.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/notfound.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/nul-in-escape.dts: up to 1.1.1.1
	external/gpl2/dtc/dist/tests/nul-in-line-info1.dts: up to 1.1.1.1
	external/gpl2/dtc/dist/tests/nul-in-line-info2.dts: up to 1.1.1.1
	external/gpl2/dtc/dist/tests/open_pack.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/overlay.c: up to 1.1.1.1
	external/gpl2/dtc/dist/tests/overlay_bad_fixup.c: up to 1.1.1.1
	external/gpl2/dtc/dist/tests/overlay_bad_fixup_bad_index.dts: up to 1.1.1.1
	external/gpl2/dtc/dist/tests/overlay_bad_fixup_base.dtsi: up to 1.1.1.1
	external/gpl2/dtc/dist/tests/overlay_bad_fixup_empty.dts: up to 1.1.1.1
	external/gpl2/dtc/dist/tests/overlay_bad_fixup_empty_index.dts: up to 1.1.1.1
	external/gpl2/dtc/dist/tests/overlay_bad_fixup_index_trailing.dts: up to 1.1.1.1
	external/gpl2/dtc/dist/tests/overlay_bad_fixup_path_empty_prop.dts: up to 1.1.1.1
	external/gpl2/dtc/dist/tests/overlay_bad_fixup_path_only.dts: up to 1.1.1.1
	external/gpl2/dtc/dist/tests/overlay_bad_fixup_path_only_sep.dts: up to 1.1.1.1
	external/gpl2/dtc/dist/tests/overlay_bad_fixup_path_prop.dts: up to 1.1.1.1
	external/gpl2/dtc/dist/tests/overlay_base.dts: up to 1.1.1.1
	external/gpl2/dtc/dist/tests/overlay_base_manual_symbols.dts: up to 1.1.1.1
	external/gpl2/dtc/dist/tests/overlay_overlay.dts: up to 1.1.1.1
	external/gpl2/dtc/dist/tests/overlay_overlay_manual_fixups.dts: up to 1.1.1.1
	external/gpl2/dtc/dist/tests/overlay_overlay_no_fixups.dts: up to 1.1.1.1
	external/gpl2/dtc/dist/tests/overlay_overlay_simple.dts: up to 1.1.1.1
	external/gpl2/dtc/dist/tests/parent_offset.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/path-references.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/path_offset.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/path_offset_aliases.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/phandle_format.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/property_iterate.c: up to 1.1.1.1
	external/gpl2/dtc/dist/tests/property_iterate.dts: up to 1.1.1.1
	external/gpl2/dtc/dist/tests/propname_escapes.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/references.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/reg-without-unit-addr.dts: up to 1.1.1.1
	external/gpl2/dtc/dist/tests/root_node.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/run_tests.sh: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/rw_tree1.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/set_name.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/setprop.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/setprop_inplace.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/sized_cells.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/string_escapes.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/stringlist.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/subnode_iterate.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/subnode_offset.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/supernode_atdepth_offset.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/sw_tree1.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/test_label_ref.dts: up to 1.1.1.1
	external/gpl2/dtc/dist/tests/test_tree1.dts: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/test_tree1_body.dtsi delete
	external/gpl2/dtc/dist/tests/test_tree1_delete.dts: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/testdata.h: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/tests.h: up to 1.3
	external/gpl2/dtc/dist/tests/testutils.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/trees.S: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/truncated_property.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/unit-addr-without-reg.dts: up to 1.1.1.1
	external/gpl2/dtc/dist/tests/utilfdt_test.c: up to 1.1.1.2
	external/gpl2/dtc/dist/tests/value-labels.c: up to 1.1.1.2
	external/gpl2/dtc/dist/treesource.c: up to 1.1.1.2
	external/gpl2/dtc/dist/util.c: up to 1.1.1.2
	external/gpl2/dtc/dist/util.h: up to 1.3
	external/gpl2/dtc/dtc2netbsd: up to 1.2
	external/gpl2/dtc/lib/Makefile: up to 1.1
	external/gpl2/dtc/lib/libfdt/Makefile: up to 1.3
	external/gpl2/dtc/usr.bin/Makefile: up to 1.1
	external/gpl2/dtc/usr.bin/Makefile.inc: up to 1.1
	external/gpl2/dtc/usr.bin/dtc/Makefile: up to 1.2
	external/gpl2/dtc/usr.bin/dtc/version_gen.h: up to 1.2
Import DTC 1.4.4.
@
text
@a0 127
#! /bin/sh
#
#	$NetBSD: dtc2netbsd,v 1.2 2017/06/16 22:47:22 jmcneill 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
#
# Update the version string in the version_gen.h header to match the imported version:
#	$ echo '#define DTC_VERSION "DTC 1.4.4"' > src/external/gpl2/dtc/usr.bin/dtc/version_gen.h

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
@


1.1
log
@Add a dtc2netbsd script
@
text
@d3 1
a3 1
#	$NetBSD$
d55 3
@

