4 # Unpack an ACPI CA drop and restructure it to fit the FreeBSD layout
7 if [ ! $# -eq 1 ]; then
8 echo "usage: $0 acpica_archive"
14 dst=./acpi_ca_destination
16 # files that should keep their full directory path
17 fulldirs="common compiler"
19 stripdirs="generate acpisrc"
20 stripfiles="16bit.h Makefile README a16find.c a16utils.asm \
21 a16utils.lst a16utils.obj adisasm.h acdos16.h acintel.h \
22 aclinux.h acmsvc.h acnetbsd.h acwin.h acwin64.h readme.txt"
24 # files to update paths in
25 src_update_files="acpi.h acpiosxf.h"
36 fetch http://developer.intel.com/technology/iapc/acpi/downloads/CHANGES.txt
37 tr -d '\r' < CHANGES.txt > CHANGES.txt.tmp
38 mv CHANGES.txt.tmp CHANGES.txt
42 tar -x -z -f ${src} -C ${wrk}
46 for i in ${stripdirs}; do
47 find ${wrk} -name ${i} -type d | xargs rm -r
49 for i in ${stripfiles}; do
50 find ${wrk} -name ${i} -type f -delete
53 echo copying full dirs
54 for i in ${fulldirs}; do
55 find ${wrk} -name ${i} -type d | xargs -J % mv % ${dst}
58 # move files to destination
59 echo copying flat dirs
60 find ${wrk} -type f | xargs -J % mv % ${dst}
63 # update src/headers for appropriate paths
65 for i in ${src_update_files}; do
67 sed -e 's/platform\///' $i > $i.new && mv $i.new $i
74 # assist the developer in generating a diff
75 echo "Directories you may want to 'cvs diff':"
76 echo " src/sys/dev/acpica src/sys/i386/acpica src/sys/ia64/acpica \\"
77 echo " src/sys/modules/acpi src/sys/boot src/sys/i386/include \\"
78 echo " src/usr.sbin/acpi src/sys/contrib/dev/acpica"