head	1.1;
access;
symbols;
locks; strict;
comment	@# @;


1.1
date	2012.07.24.16.29.33;	author imp;	state Exp;
branches;
next	;


desc
@@


1.1
log
@SVN rev 238742 on 2012-07-24 16:29:33Z by imp

Update to latest git version of dtc to get new dtsv2 support,
including the include directive.

Fix minor build issue corrected by converting yypush_buffer_state and
yypop_buffer_state to yy_set_buffer_state and a hard-coded 100-deep
stack.  It was easier to fix it here than to import that support into
our flex.

The new tools and test hardness remain unsupported at the moment.
@
text
@#! /bin/bash

# This script uses the bash <(...) extension.
# If you want to change this to work with a generic /bin/sh, make sure
# you fix that.


DTC=dtc

source_and_sort () {
    DT="$1"
    if [ -d "$DT" ]; then
	IFORMAT=fs
    elif [ -f "$DT" ]; then
	case "$DT" in
	    *.dts)
		IFORMAT=dts
		;;
	    *.dtb)
		IFORMAT=dtb
		;;
	esac
    fi

    if [ -z "$IFORMAT" ]; then
	echo "Unrecognized format for $DT" >&2
	exit 2
    fi

    $DTC -I $IFORMAT -O dts -qq -f -s -o - "$DT"
}

if [ $# != 2 ]; then
    echo "Usage: dtdiff <device tree> <device tree>" >&2
    exit 1
fi

diff -u <(source_and_sort "$1") <(source_and_sort "$2")
@
