From 40bbabbc185bda425dd18308a229ed5bffa80908 Mon Sep 17 00:00:00 2001 From: Robert Moore Date: Tue, 17 Dec 2013 13:30:25 -0800 Subject: [PATCH] Linuxize: Cleanup format conversions. As AcpiSrc supports the case that the input/output files are the same file, ACPICA_TMP is not useful for divergence.sh any more. This patch cleans up ACPICA_TMP by invoking new linuxize_format() function provided by libacpica.sh. A similar cleanup is also done in gen-repo.sh in this patch. Lv Zheng. --- generate/linux/divergence.sh | 18 +++--------------- generate/linux/gen-repo.sh | 12 +++--------- generate/linux/libacpica.sh | 12 ++++++++++++ 3 files changed, 18 insertions(+), 24 deletions(-) diff --git a/generate/linux/divergence.sh b/generate/linux/divergence.sh index abddd0b80..b713c542d 100755 --- a/generate/linux/divergence.sh +++ b/generate/linux/divergence.sh @@ -41,7 +41,6 @@ shift $(($OPTIND - 1)) SCRIPT=`(cd \`dirname $0\`; pwd)` . $SCRIPT/libacpica.sh -ACPICA_TMP=$CURDIR/acpica-tmp LINUX_ACPICA=$CURDIR/linux-acpica ACPICA_LINUXIZED=$CURDIR/acpica-linuxized LINUX=`fulldir $1` @@ -72,25 +71,15 @@ make_acpisrc $SRCDIR force > /dev/null # # Copy the actual Linux ACPICA files locally (from the Linux tree) # -echo "[divergence.sh] Converting format (hierarchy)..." +echo "[divergence.sh] Converting hierarchy..." copy_linux_hierarchy $LINUX $LINUX_ACPICA -linuxize_hierarchy_ref $LINUX_ACPICA $SRCDIR $ACPICA_TMP - -# -# Linuxize the ACPICA source -# -echo "[divergence.sh] Converting format (acpisrc -l)..." -rm -rf $ACPICA_LINUXIZED -$ACPISRC -ldqy $ACPICA_TMP $ACPICA_LINUXIZED > /dev/null +linuxize_hierarchy_ref $LINUX_ACPICA $SRCDIR $ACPICA_LINUXIZED # # Lindent both sets of files # echo "[divergence.sh] Converting format (lindent-acpica)..." -lindent $ACPICA_LINUXIZED - -echo "[divergence.sh] Converting format (acpisrc -i)..." -$ACPISRC -idqy $ACPICA_LINUXIZED $ACPICA_LINUXIZED > /dev/null +linuxize_format $ACPICA_LINUXIZED if [ "x$LINDENT_DIR" = "xmultiple" ] ; then echo "[divergence.sh] Converting format (lindent-linux)..." @@ -111,5 +100,4 @@ echo "==========" # Cleanup # rm -rf $LINUX_ACPICA -rm -rf $ACPICA_TMP rm -rf $ACPICA_LINUXIZED diff --git a/generate/linux/gen-repo.sh b/generate/linux/gen-repo.sh index 6796939c9..e723fca9f 100755 --- a/generate/linux/gen-repo.sh +++ b/generate/linux/gen-repo.sh @@ -53,17 +53,11 @@ linuxize() mkdir -p $repo_linux/source cp -rf $repo_acpica/source $repo_linux/ - echo "[gen-repo.sh] Converting format (hierarchy)..." + echo "[gen-repo.sh] Converting hierarchy..." linuxize_hierarchy_noref $repo_linux - echo "[gen-repo.sh] Converting format (acpisrc -l)..." - $ACPISRC -ldqy $repo_linux $repo_linux > /dev/null - - echo "[gen-repo.sh] Converting format (lindent)..." - lindent $repo_linux - - echo "[gen-repo.sh] Fixing indentation (acpisrc -i)..." - $ACPISRC -idqy $repo_linux $repo_linux > /dev/null + echo "[gen-repo.sh] Converting format..." + linuxize_format $repo_linux } echo "[gen-repo.sh] Extracting GIT ($SRCDIR)..." diff --git a/generate/linux/libacpica.sh b/generate/linux/libacpica.sh index cc6feb76f..b2ad2649a 100755 --- a/generate/linux/libacpica.sh +++ b/generate/linux/libacpica.sh @@ -225,6 +225,18 @@ lindent() ) } +linuxize_format() +{ + echo " Converting (acpisrc -l)..." + $ACPISRC -ldqy $1 $1 > /dev/null + + echo " Converting (indent)..." + lindent $1 + + echo " Converting (acpisrc -i)..." + $ACPISRC -idqy $1 $1 > /dev/null +} + copy_linux_hierarchy() { local from to dirs dir