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
|
2012-05-24 23:12:30 +00:00
|
|
|
wrk="$(realpath .)/_acpi_ca_unpack"
|
|
|
|
dst="$(realpath .)/acpi_ca_destination"
|
2002-02-08 02:16:45 +00:00
|
|
|
|
2003-12-09 03:13:37 +00:00
|
|
|
# files that should keep their full directory path
|
2012-02-16 22:59:29 +00:00
|
|
|
fulldirs="common compiler components include os_specific"
|
2009-06-02 18:53:21 +00:00
|
|
|
|
2002-02-08 02:16:45 +00:00
|
|
|
# files to remove
|
2012-02-16 22:59:29 +00:00
|
|
|
stripdirs="generate libraries tests tools"
|
2012-08-16 20:54:52 +00:00
|
|
|
stripfiles="Makefile README accygwin.h acefi.h achaiku.h acintel.h \
|
|
|
|
aclinux.h acmsvc.h acnetbsd.h acos2.h acwin.h acwin64.h \
|
|
|
|
new_table.txt osunixdir.c oswindir.c oswintbl.c oswinxf.c \
|
|
|
|
readme.txt utclib.c"
|
2009-06-02 18:53:21 +00:00
|
|
|
|
2005-11-01 22:38:50 +00:00
|
|
|
# include files to canonify
|
2012-08-16 20:54:52 +00:00
|
|
|
src_headers="acapps.h acbuffer.h accommon.h acconfig.h acdebug.h \
|
|
|
|
acdisasm.h acdispat.h acevents.h acexcep.h acglobal.h achware.h \
|
|
|
|
acinterp.h aclocal.h acmacros.h acnames.h acnamesp.h acobject.h \
|
|
|
|
acopcode.h acoutput.h acparser.h acpi.h acpiosxf.h acpixf.h \
|
|
|
|
acpredef.h acresrc.h acrestyp.h acstruct.h actables.h actbl.h \
|
|
|
|
actbl1.h actbl2.h actbl3.h actypes.h acutils.h amlcode.h \
|
|
|
|
amlresrc.h platform/acenv.h platform/acfreebsd.h \
|
|
|
|
platform/acgcc.h"
|
2010-10-13 21:37:02 +00:00
|
|
|
comp_headers="aslcompiler.h asldefine.h aslglobal.h aslmessages.h \
|
2012-04-23 23:05:14 +00:00
|
|
|
aslsupport.l asltypes.h dtcompiler.h dttemplate.h preprocess.h"
|
2009-06-02 20:00:32 +00:00
|
|
|
platform_headers="acfreebsd.h acgcc.h"
|
2002-02-08 02:16:45 +00:00
|
|
|
|
|
|
|
# pre-clean
|
|
|
|
echo pre-clean
|
2009-06-02 18:53:21 +00:00
|
|
|
rm -rf ${wrk} ${dst}
|
2002-02-08 02:16:45 +00:00
|
|
|
mkdir -p ${wrk}
|
|
|
|
mkdir -p ${dst}
|
|
|
|
|
|
|
|
# unpack
|
|
|
|
echo unpack
|
|
|
|
tar -x -z -f ${src} -C ${wrk}
|
|
|
|
|
|
|
|
# strip files
|
|
|
|
echo strip
|
|
|
|
for i in ${stripdirs}; do
|
2010-07-06 20:57:28 +00:00
|
|
|
find ${wrk} -name ${i} -type d -print | xargs rm -r
|
2002-02-08 02:16:45 +00:00
|
|
|
done
|
|
|
|
for i in ${stripfiles}; do
|
2005-11-01 22:38:50 +00:00
|
|
|
find ${wrk} -name ${i} -type f -delete
|
2002-02-08 02:16:45 +00:00
|
|
|
done
|
|
|
|
|
2009-06-02 18:53:21 +00:00
|
|
|
# copy files
|
2003-12-09 03:13:37 +00:00
|
|
|
echo copying full dirs
|
|
|
|
for i in ${fulldirs}; do
|
2010-07-06 20:57:28 +00:00
|
|
|
find ${wrk} -name ${i} -type d -print | xargs -J % mv % ${dst}
|
2003-12-09 03:13:37 +00:00
|
|
|
done
|
2009-06-02 18:53:21 +00:00
|
|
|
echo copying remaining files
|
2010-07-06 20:57:28 +00:00
|
|
|
find ${wrk} -type f -print | xargs -J % mv % ${dst}
|
2003-04-29 18:48:17 +00:00
|
|
|
|
2005-10-24 04:36:14 +00:00
|
|
|
# canonify include paths
|
2005-11-01 22:38:50 +00:00
|
|
|
for H in ${src_headers}; do
|
2011-04-15 18:34:27 +00:00
|
|
|
find ${dst} -name "*.[chly]" -type f -print | \
|
2009-06-02 18:53:21 +00:00
|
|
|
xargs sed -i "" -e "s|[\"<]$H[\">]|\<contrib/dev/acpica/include/$H\>|g"
|
2005-11-01 22:38:50 +00:00
|
|
|
done
|
|
|
|
for H in ${comp_headers}; do
|
2012-05-24 23:12:30 +00:00
|
|
|
find ${dst}/common ${dst}/compiler ${dst}/components \
|
|
|
|
-name "*.[chly]" -type f | \
|
2005-11-01 22:38:50 +00:00
|
|
|
xargs sed -i "" -e "s|[\"<]$H[\">]|\<contrib/dev/acpica/compiler/$H\>|g"
|
|
|
|
done
|
2009-06-02 20:00:32 +00:00
|
|
|
for H in ${platform_headers}; do
|
2010-07-06 20:57:28 +00:00
|
|
|
find ${dst}/include/platform -name "*.h" -type f -print | \
|
2009-06-02 20:00:32 +00:00
|
|
|
xargs sed -i "" -e "s|[\"<]$H[\">]|\<contrib/dev/acpica/include/platform/$H\>|g"
|
|
|
|
done
|
2005-10-24 04:36:14 +00:00
|
|
|
|
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
|
2011-11-28 23:36:48 +00:00
|
|
|
echo "Directories you may want to 'svn diff':"
|
|
|
|
echo " sys/contrib/dev/acpica sys/dev/acpica \\"
|
|
|
|
echo " sys/amd64/acpica sys/i386/acpica sys/ia64/acpica sys/x86/acpica \\"
|
|
|
|
echo " sys/amd64/include sys/i386/include sys/ia64/include \\"
|
|
|
|
echo " sys/boot sys/conf sys/modules/acpi usr.sbin/acpi"
|