1#!/bin/sh
| 1#!/bin/sh
|
2# $FreeBSD: head/sys/contrib/dev/acpica/acpica_prep.sh 213806 2010-10-13 21:37:02Z jkim $
| 2# $FreeBSD: head/sys/contrib/dev/acpica/acpica_prep.sh 217365 2011-01-13 17:32:32Z jkim $
|
3# 4# Unpack an ACPI CA drop and restructure it to fit the FreeBSD layout 5# 6 7if [ ! $# -eq 1 ]; then 8 echo "usage: $0 acpica_archive" 9 exit 10fi 11 12src=$1 13wrk=`realpath ./_acpi_ca_unpack` 14dst=`realpath ./acpi_ca_destination` 15 16# files that should keep their full directory path 17fulldirs="common compiler debugger disassembler dispatcher events \ 18 executer hardware include namespace parser resources tables \ 19 tools utilities" 20 21# files to remove
| 3# 4# Unpack an ACPI CA drop and restructure it to fit the FreeBSD layout 5# 6 7if [ ! $# -eq 1 ]; then 8 echo "usage: $0 acpica_archive" 9 exit 10fi 11 12src=$1 13wrk=`realpath ./_acpi_ca_unpack` 14dst=`realpath ./acpi_ca_destination` 15 16# files that should keep their full directory path 17fulldirs="common compiler debugger disassembler dispatcher events \ 18 executer hardware include namespace parser resources tables \ 19 tools utilities" 20 21# files to remove
|
22stripdirs="acpisrc acpixtract examples generate os_specific tests"
| 22stripdirs="acpinames acpisrc acpixtract examples generate os_specific \ 23 tests"
|
23stripfiles="Makefile README acintel.h aclinux.h acmsvc.h acnetbsd.h \ 24 acos2.h accygwin.h acefi.h acwin.h acwin64.h aeexec.c \ 25 aehandlers.c aemain.c aetables.c aetables.h osunixdir.c \ 26 readme.txt utclib.c" 27 28# include files to canonify 29src_headers="acapps.h accommon.h acconfig.h acdebug.h acdisasm.h \ 30 acdispat.h acevents.h acexcep.h acglobal.h achware.h acinterp.h \ 31 aclocal.h acmacros.h acnames.h acnamesp.h acobject.h acopcode.h \ 32 acoutput.h acparser.h acpi.h acpiosxf.h acpixf.h acpredef.h \ 33 acresrc.h acrestyp.h acstruct.h actables.h actbl.h actbl1.h \ 34 actbl2.h actypes.h acutils.h amlcode.h amlresrc.h \ 35 platform/acenv.h platform/acfreebsd.h platform/acgcc.h" 36comp_headers="aslcompiler.h asldefine.h aslglobal.h aslmessages.h \ 37 asltypes.h dtcompiler.h dttemplate.h" 38platform_headers="acfreebsd.h acgcc.h" 39 40# pre-clean 41echo pre-clean 42rm -rf ${wrk} ${dst} 43mkdir -p ${wrk} 44mkdir -p ${dst} 45 46# unpack 47echo unpack 48tar -x -z -f ${src} -C ${wrk} 49 50# strip files 51echo strip 52for i in ${stripdirs}; do 53 find ${wrk} -name ${i} -type d -print | xargs rm -r 54done 55for i in ${stripfiles}; do 56 find ${wrk} -name ${i} -type f -delete 57done 58 59# copy files 60echo copying full dirs 61for i in ${fulldirs}; do 62 find ${wrk} -name ${i} -type d -print | xargs -J % mv % ${dst} 63done 64echo copying remaining files 65find ${wrk} -type f -print | xargs -J % mv % ${dst} 66 67# canonify include paths 68for H in ${src_headers}; do 69 find ${dst} -name "*.[chy]" -type f -print | \ 70 xargs sed -i "" -e "s|[\"<]$H[\">]|\<contrib/dev/acpica/include/$H\>|g" 71done 72for H in ${comp_headers}; do 73 find ${dst}/common ${dst}/compiler -name "*.[chly]" -type f | \ 74 xargs sed -i "" -e "s|[\"<]$H[\">]|\<contrib/dev/acpica/compiler/$H\>|g" 75done 76for H in ${platform_headers}; do 77 find ${dst}/include/platform -name "*.h" -type f -print | \ 78 xargs sed -i "" -e "s|[\"<]$H[\">]|\<contrib/dev/acpica/include/platform/$H\>|g" 79done 80 81# post-clean 82echo post-clean 83rm -rf ${wrk} 84 85# assist the developer in generating a diff 86echo "Directories you may want to 'cvs diff':" 87echo " src/sys/contrib/dev/acpica src/sys/dev/acpica \\" 88echo " src/sys/amd64/acpica src/sys/i386/acpica src/sys/ia64/acpica \\" 89echo " src/sys/amd64/include src/sys/i386/include src/sys/ia64/include \\" 90echo " src/sys/boot src/sys/conf src/sys/modules/acpi src/usr.sbin/acpi"
| 24stripfiles="Makefile README acintel.h aclinux.h acmsvc.h acnetbsd.h \ 25 acos2.h accygwin.h acefi.h acwin.h acwin64.h aeexec.c \ 26 aehandlers.c aemain.c aetables.c aetables.h osunixdir.c \ 27 readme.txt utclib.c" 28 29# include files to canonify 30src_headers="acapps.h accommon.h acconfig.h acdebug.h acdisasm.h \ 31 acdispat.h acevents.h acexcep.h acglobal.h achware.h acinterp.h \ 32 aclocal.h acmacros.h acnames.h acnamesp.h acobject.h acopcode.h \ 33 acoutput.h acparser.h acpi.h acpiosxf.h acpixf.h acpredef.h \ 34 acresrc.h acrestyp.h acstruct.h actables.h actbl.h actbl1.h \ 35 actbl2.h actypes.h acutils.h amlcode.h amlresrc.h \ 36 platform/acenv.h platform/acfreebsd.h platform/acgcc.h" 37comp_headers="aslcompiler.h asldefine.h aslglobal.h aslmessages.h \ 38 asltypes.h dtcompiler.h dttemplate.h" 39platform_headers="acfreebsd.h acgcc.h" 40 41# pre-clean 42echo pre-clean 43rm -rf ${wrk} ${dst} 44mkdir -p ${wrk} 45mkdir -p ${dst} 46 47# unpack 48echo unpack 49tar -x -z -f ${src} -C ${wrk} 50 51# strip files 52echo strip 53for i in ${stripdirs}; do 54 find ${wrk} -name ${i} -type d -print | xargs rm -r 55done 56for i in ${stripfiles}; do 57 find ${wrk} -name ${i} -type f -delete 58done 59 60# copy files 61echo copying full dirs 62for i in ${fulldirs}; do 63 find ${wrk} -name ${i} -type d -print | xargs -J % mv % ${dst} 64done 65echo copying remaining files 66find ${wrk} -type f -print | xargs -J % mv % ${dst} 67 68# canonify include paths 69for H in ${src_headers}; do 70 find ${dst} -name "*.[chy]" -type f -print | \ 71 xargs sed -i "" -e "s|[\"<]$H[\">]|\<contrib/dev/acpica/include/$H\>|g" 72done 73for H in ${comp_headers}; do 74 find ${dst}/common ${dst}/compiler -name "*.[chly]" -type f | \ 75 xargs sed -i "" -e "s|[\"<]$H[\">]|\<contrib/dev/acpica/compiler/$H\>|g" 76done 77for H in ${platform_headers}; do 78 find ${dst}/include/platform -name "*.h" -type f -print | \ 79 xargs sed -i "" -e "s|[\"<]$H[\">]|\<contrib/dev/acpica/include/platform/$H\>|g" 80done 81 82# post-clean 83echo post-clean 84rm -rf ${wrk} 85 86# assist the developer in generating a diff 87echo "Directories you may want to 'cvs diff':" 88echo " src/sys/contrib/dev/acpica src/sys/dev/acpica \\" 89echo " src/sys/amd64/acpica src/sys/i386/acpica src/sys/ia64/acpica \\" 90echo " src/sys/amd64/include src/sys/i386/include src/sys/ia64/include \\" 91echo " src/sys/boot src/sys/conf src/sys/modules/acpi src/usr.sbin/acpi"
|