xref: /titanic_52/usr/src/uts/intel/io/acpica/cmp_ca.sh (revision b6c3f7863936abeae522e48a13887dddeb691a45)
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 2007 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# ident	"%Z%%M%	%I%	%E% SMI"
27#
28
29#
30# Set this to the fully-qualified path to the ACPI CA source directory
31#
32ACDIR=/export/home/myers/acpica/acpica-unix-20060721
33
34DIFF="diff -w"
35WSDIR=`workspace name`
36WSSRC=usr/src/uts/intel/io/acpica
37WSHDR=usr/src/uts/intel/sys/acpi
38ACFILES=/tmp/$$.acfiles
39SRCDIRS="debugger disassembler events hardware interpreter namespace \
40	resources tables utilities"
41
42#
43#
44#
45cd $ACDIR ; find  $SRCDIRS -type f  > $ACFILES ; cd -
46for i in `<$ACFILES`
47do
48    if [[ ! -a $WSDIR/$WSSRC/$i ]]
49    then
50	SRCNEW=$SRCNEW\ $i
51    else
52	if (! $DIFF $WSDIR/$WSSRC/$i $ACDIR/$i > /dev/null )
53	then
54	    SRCCHG=$SRCCHG\ $i
55	fi
56    fi
57done
58
59#
60#
61#
62cd $ACDIR/include ; find . -type f  > $ACFILES ; cd -
63for i in `<$ACFILES`
64do
65    if [[ ! -a $WSDIR/$WSHDR/$i ]]
66    then
67	HDRNEW=$HDRNEW\ $i
68    else
69	if (! $DIFF $WSDIR/$WSHDR/$i $ACDIR/include/$i > /dev/null )
70	then
71		HDRCHG=$HDRCHG\ $i
72	fi
73    fi
74done
75
76cd $WSDIR
77for i in $SRCCHG
78do
79    targ=$WSSRC/$i
80    wx edit $targ
81    cp $ACDIR/$i $targ
82done
83
84for i in $SRCNEW
85do
86    targ=$WSSRC/$i
87    cp $ACDIR/$i $targ
88    chmod +w $targ
89    wx create -f $targ
90done
91
92for i in $HDRCHG
93do
94    targ=$WSHDR/$i
95    wx edit $targ
96    cp $ACDIR/include/$i $targ
97done
98
99for i in $HDRNEW
100do
101    targ=$WSHDR/$i
102    cp $ACDIR/include/$i $targ
103    chmod +w $targ
104    wx create -f $targ
105done
106cd -
107
108if (! $DIFF $WSDIR/$WSSRC/changes.txt $ACDIR/changes.txt > /dev/null )
109then
110    targ=$WSSRC/changes.txt
111    wx edit $targ
112    cp $ACDIR/changes.txt $targ
113fi
114
115echo New source files:
116echo $SRCNEW
117echo New header files:
118echo $HDRNEW
119