Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master grimoire by Ismael Luceno (29ae6f57f85e2a3347dcda6735539614f46d2971)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Ismael Luceno <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master grimoire by Ismael Luceno (29ae6f57f85e2a3347dcda6735539614f46d2971)
  • Date: Thu, 9 Sep 2021 20:24:59 +0000

GIT changes to master grimoire by Ismael Luceno <ismael AT sourcemage.org>:

utils/qemu/CONFIGURE | 19 ++++++++++++++-----
utils/qemu/HISTORY | 1 +
2 files changed, 15 insertions(+), 5 deletions(-)

New commits:
commit 29ae6f57f85e2a3347dcda6735539614f46d2971
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

qemu: Sanitize QEMU_ARCHS

diff --git a/utils/qemu/CONFIGURE b/utils/qemu/CONFIGURE
index 1c00310..67f7022 100755
--- a/utils/qemu/CONFIGURE
+++ b/utils/qemu/CONFIGURE
@@ -1,8 +1,6 @@
. "$GRIMOIRE/FUNCTIONS" &&

-local QEMU_ARCH_FILE=archs
-
-local QEMU_ARCH_LIST=`cat $SPELL_DIRECTORY/$QEMU_ARCH_FILE` &&
+local QEMU_ARCH_FILE="$SPELL_DIRECTORY/archs"
persistent_add QEMU_ARCHS &&

# deliberately uses query, see locale CONFIGURE note
@@ -16,11 +14,22 @@ if query "Handpick architectures to emulate (y/n)?" n;
then
--stdout \
--checklist "$HELP" \
0 0 0 \
- $QEMU_ARCH_LIST`
+ $(<"$QEMU_ARCH_FILE")`
fi &&

if [[ -z $QEMU_ARCHS ]]; then
- QEMU_ARCHS=$(cut -f 1 $SPELL_DIRECTORY/$QEMU_ARCH_FILE | sed -e 's/^/"/'
-e 's/\s*$/"/' | tr '\n' ' ')
+ QEMU_ARCHS=$(awk -vORS=' ' '{print $1}' "$QEMU_ARCH_FILE")
+else
+ # sanitize QEMU_ARCHS
+ QEMU_ARCHS=$(awk -F'[ "]+' -vORS=' ' -vtmp="$QEMU_ARCHS" '
+ BEGIN {
+ $0 = tmp
+ for (i = 1; i <= NF; i++) selected[$i]
+ FS = " "
+ }
+ $1 in selected {print $1; next}
+ {printf "WARN: %s architecture removed\n", $1 >"/dev/stderr"}
+ ' "$QEMU_ARCH_FILE")
fi

. $GRIMOIRE/config_query_multi.function &&
diff --git a/utils/qemu/HISTORY b/utils/qemu/HISTORY
index b280831..14246dd 100644
--- a/utils/qemu/HISTORY
+++ b/utils/qemu/HISTORY
@@ -1,5 +1,6 @@
2021-09-09 Ismael Luceno <ismael AT sourcemage.org>
* patches/musl-fix-duplicated-sysinfo.patch: fixed for glibc
+ * CONFIGURE: added sanitization of QEMU_ARCHS

2020-09-07 Ismael Luceno <ismael AT sourcemage.org>
* DETAILS: updated spell to 5.1.0



  • [SM-Commit] GIT changes to master grimoire by Ismael Luceno (29ae6f57f85e2a3347dcda6735539614f46d2971), Ismael Luceno, 09/09/2021

Archive powered by MHonArc 2.6.24.

Top of Page