xref: /titanic_52/usr/src/uts/intel/io/acpica/cmp_ca.sh (revision 96a62ada8aa6cb19b04270da282e7e21ba74b808)
1#!/bin/ksh -p
2#
3# CDDL HEADER START
4#
5# The contents of this file are subject to the terms of the
6# Common Development and Distribution License (the "License").
7# You may not use this file except in compliance with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26#
27
28#
29# Set this to the fully-qualified path to the ACPI CA GIT directory
30#
31ACDIR=/tmp/acpica-unix-20091112
32
33ACSRC=$ACDIR
34ACINC=$ACDIR/include
35
36DIFF="diff -w"
37
38#
39# Use which_scm to get the current WS path
40#
41which_scm | read WS_SCM WSDIR
42
43WSSRC=usr/src/uts/intel/io/acpica
44WSHDR=usr/src/uts/intel/sys/acpi
45ACFILES=/tmp/$$.acfiles
46SRCDIRS="debugger \
47	disassembler \
48	dispatcher \
49	events \
50	executer \
51	hardware \
52	namespace \
53	parser \
54	resources \
55	tables \
56	utilities"
57
58#
59#
60#
61cd $ACSRC ; find  $SRCDIRS -type f  > $ACFILES ; cd -
62for i in `<$ACFILES`
63do
64    if [[ ! -a $WSDIR/$WSSRC/$i ]]
65    then
66	SRCNEW=$SRCNEW\ $i
67    else
68	if (! $DIFF $WSDIR/$WSSRC/$i $ACSRC/$i > /dev/null )
69	then
70	    SRCCHG=$SRCCHG\ $i
71	fi
72    fi
73done
74
75#
76#
77#
78cd $ACINC ; find . -type f  > $ACFILES ; cd -
79for i in `<$ACFILES`
80do
81    if [[ ! -a $WSDIR/$WSHDR/$i ]]
82    then
83	HDRNEW=$HDRNEW\ $i
84    else
85	if (! $DIFF $WSDIR/$WSHDR/$i $ACINC/$i > /dev/null )
86	then
87		HDRCHG=$HDRCHG\ $i
88	fi
89    fi
90done
91
92cd $WSDIR
93for i in $SRCCHG
94do
95    targ=$WSSRC/$i
96    cp $ACSRC/$i $targ
97done
98
99for i in $SRCNEW
100do
101    targ=$WSSRC/$i
102    cp $ACSRC/$i $targ
103    chmod +w $targ
104    hg add $targ
105done
106
107for i in $HDRCHG
108do
109    targ=$WSHDR/$i
110    cp $ACINC/$i $targ
111done
112
113for i in $HDRNEW
114do
115    targ=$WSHDR/$i
116    cp $ACINC/$i $targ
117    chmod +w $targ
118    hg add $targ
119done
120
121if (! $DIFF $WSDIR/$WSSRC/changes.txt $ACDIR/changes.txt > /dev/null )
122then
123    targ=$WSSRC/changes.txt
124    cp $ACDIR/changes.txt $targ
125fi
126cd -
127
128echo New source files:
129echo $SRCNEW
130echo New header files:
131echo $HDRNEW
132