All of lore.kernel.org
 help / color / mirror / Atom feed
From: Glenn Washburn <development@efficientek.com>
To: grub-devel@gnu.org
Cc: Daniel Kiper <dkiper@net-space.pl>,
	Glenn Washburn <development@efficientek.com>
Subject: [PATCH] grub-shell: Use shell variable instead of autoconf
Date: Sat,  6 Aug 2022 01:26:31 -0500	[thread overview]
Message-ID: <20220806062631.1679392-1-development@efficientek.com> (raw)

By using shell variable that are set once by the expansion of an autoconf
variable, the resulting shell script is more easily moved and modified
from the build/install directory it was generated for. The resulting
script is more readable as well.

Signed-off-by: Glenn Washburn <development@efficientek.com>
---
 tests/util/grub-shell.in | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in
index 4828afb7c..bb7b285e9 100644
--- a/tests/util/grub-shell.in
+++ b/tests/util/grub-shell.in
@@ -384,10 +384,10 @@ if test -z "$debug"; then
 fi
 
 if [ x$boot != xnet ] && [ x$boot != xemu ]; then
-    pkgdatadir="@builddir@" "@builddir@/grub-mkrescue" "--output=${isofile}" "--override-directory=${builddir}/grub-core" \
+    pkgdatadir="${builddir}" "${builddir}/grub-mkrescue" "--output=${isofile}" "--override-directory=${builddir}/grub-core" \
 	--rom-directory="${rom_directory}" \
-	--locale-directory="@srcdir@/po" \
-	--themes-directory="@srcdir@/themes" \
+	--locale-directory="${srcdir}/po" \
+	--themes-directory="${srcdir}/themes" \
 	$mkimage_extra_arg ${mkrescue_args} \
 	"/boot/grub/grub.cfg=${cfgfile}" "/boot/grub/testcase.cfg=${source}" \
 	${files} >/dev/null 2>&1
@@ -482,7 +482,7 @@ copy_extra_files() {
 
 if [ x$boot = xnet ]; then
     netdir=`mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1
-    pkgdatadir="@builddir@" "@builddir@/grub-mknetdir" "--grub-mkimage=${builddir}/grub-mkimage" "--directory=${builddir}/grub-core" "--net-directory=$netdir" ${mkrescue_args} > /dev/null
+    pkgdatadir="${builddir}" "${builddir}/grub-mknetdir" "--grub-mkimage=${builddir}/grub-mkimage" "--directory=${builddir}/grub-core" "--net-directory=$netdir" ${mkrescue_args} > /dev/null
     cp "${cfgfile}" "$netdir/boot/grub/grub.cfg"
     cp "${source}" "$netdir/boot/grub/testcase.cfg"
     [ -z "$files" ] || copy_extra_files "$netdir" $files
@@ -493,9 +493,9 @@ elif [ x$boot = xemu ]; then
     mkdir -p "$grubdir/fonts"
     mkdir -p "$grubdir/themes"
     mkdir -p "$grubdir/locale"
-    test -f "@builddir@/"unicode.pf2 && cp "@builddir@/"unicode.pf2 "$grubdir/fonts/unicode.pf2"
-    cp -R "@srcdir@/themes/starfield" "$grubdir/themes/starfield"
-    for file in "@srcdir@/po/"*.gmo; do
+    test -f "${builddir}/"unicode.pf2 && cp "${builddir}/"unicode.pf2 "$grubdir/fonts/unicode.pf2"
+    cp -R "${srcdir}/themes/starfield" "$grubdir/themes/starfield"
+    for file in "${srcdir}/po/"*.gmo; do
 	if [ -f "$file" ]; then
 	    cp "$file" "$grubdir/locale/"
 	fi
@@ -505,7 +505,7 @@ elif [ x$boot = xemu ]; then
     [ -z "$files" ] || copy_extra_files "$rootdir" $files
     roottar="$(mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX")"
     (cd "$rootdir"; tar cf "$roottar" .)
-    @builddir@/grub-core/grub-emu -m "$device_map" --memdisk "$roottar" -r memdisk -d "/boot/grub" | tr -d "\r" | do_trim
+    "${builddir}/grub-core/grub-emu" -m "$device_map" --memdisk "$roottar" -r memdisk -d "/boot/grub" | tr -d "\r" | do_trim
     test -n "$debug" || rm -rf "$rootdir"
     test -n "$debug" || rm -f "$roottar"
 else
-- 
2.34.1



             reply	other threads:[~2022-08-06  6:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-06  6:26 Glenn Washburn [this message]
2022-08-09 13:25 ` [PATCH] grub-shell: Use shell variable instead of autoconf Daniel Kiper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220806062631.1679392-1-development@efficientek.com \
    --to=development@efficientek.com \
    --cc=dkiper@net-space.pl \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.