2002-02-08 02:16:45 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
# Unpack an ACPI CA drop and restructure it to fit the FreeBSD layout
|
|
|
|
#
|
|
|
|
|
2002-06-12 14:55:19 +00:00
|
|
|
if [ ! $# -eq 1 ]; then
|
|
|
|
echo "usage: $0 acpica_archive"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2002-02-08 02:16:45 +00:00
|
|
|
src=$1
|
|
|
|
wrk=./_acpi_ca_unpack
|
|
|
|
dst=./acpi_ca_destination
|
|
|
|
|
2003-12-09 03:13:37 +00:00
|
|
|
# files that should keep their full directory path
|
|
|
|
fulldirs="common compiler"
|
2002-02-08 02:16:45 +00:00
|
|
|
# files to remove
|
2003-12-09 03:13:37 +00:00
|
|
|
stripdirs="generate acpisrc"
|
|
|
|
stripfiles="16bit.h Makefile README a16find.c a16utils.asm \
|
2004-04-14 02:03:33 +00:00
|
|
|
a16utils.lst a16utils.obj adisasm.h acdos16.h acintel.h \
|
|
|
|
aclinux.h acmsvc.h acnetbsd.h acwin.h acwin64.h readme.txt"
|
2003-12-09 03:13:37 +00:00
|
|
|
|
2003-04-29 18:48:17 +00:00
|
|
|
# files to update paths in
|
|
|
|
src_update_files="acpi.h acpiosxf.h"
|
2002-02-08 02:16:45 +00:00
|
|
|
|
|
|
|
# pre-clean
|
|
|
|
echo pre-clean
|
|
|
|
rm -rf ${wrk}
|
|
|
|
rm -rf ${dst}
|
|
|
|
mkdir -p ${wrk}
|
|
|
|
mkdir -p ${dst}
|
|
|
|
|
2002-08-22 15:21:15 +00:00
|
|
|
# fetch document
|
|
|
|
echo fetch document
|
|
|
|
fetch http://developer.intel.com/technology/iapc/acpi/downloads/CHANGES.txt
|
|
|
|
tr -d '\r' < CHANGES.txt > CHANGES.txt.tmp
|
|
|
|
mv CHANGES.txt.tmp CHANGES.txt
|
|
|
|
|
2002-02-08 02:16:45 +00:00
|
|
|
# unpack
|
|
|
|
echo unpack
|
|
|
|
tar -x -z -f ${src} -C ${wrk}
|
|
|
|
|
|
|
|
# strip files
|
|
|
|
echo strip
|
|
|
|
for i in ${stripdirs}; do
|
|
|
|
find ${wrk} -name ${i} -type d | xargs rm -r
|
|
|
|
done
|
|
|
|
for i in ${stripfiles}; do
|
|
|
|
find ${wrk} -name ${i} -type f -delete
|
|
|
|
done
|
|
|
|
|
2003-12-09 03:13:37 +00:00
|
|
|
echo copying full dirs
|
|
|
|
for i in ${fulldirs}; do
|
|
|
|
find ${wrk} -name ${i} -type d | xargs -J % mv % ${dst}
|
|
|
|
done
|
|
|
|
|
2002-02-08 02:16:45 +00:00
|
|
|
# move files to destination
|
2003-12-09 03:13:37 +00:00
|
|
|
echo copying flat dirs
|
2002-02-08 02:16:45 +00:00
|
|
|
find ${wrk} -type f | xargs -J % mv % ${dst}
|
2002-08-22 15:21:15 +00:00
|
|
|
mv CHANGES.txt ${dst}
|
2002-02-08 02:16:45 +00:00
|
|
|
|
2003-04-29 18:48:17 +00:00
|
|
|
# update src/headers for appropriate paths
|
|
|
|
echo updating paths
|
|
|
|
for i in ${src_update_files}; do
|
|
|
|
i=${dst}/$i
|
|
|
|
sed -e 's/platform\///' $i > $i.new && mv $i.new $i
|
|
|
|
done
|
|
|
|
|
2002-02-08 02:16:45 +00:00
|
|
|
# post-clean
|
|
|
|
echo post-clean
|
2002-06-12 14:55:19 +00:00
|
|
|
rm -rf ${wrk}
|
2003-04-29 18:48:17 +00:00
|
|
|
|
|
|
|
# assist the developer in generating a diff
|
|
|
|
echo "Directories you may want to 'cvs diff':"
|
|
|
|
echo " src/sys/dev/acpica src/sys/i386/acpica src/sys/ia64/acpica \\"
|
|
|
|
echo " src/sys/modules/acpi src/sys/boot src/sys/i386/include \\"
|
|
|
|
echo " src/usr.sbin/acpi src/sys/contrib/dev/acpica"
|