diff mbox

[kvm-unit-tests,1/2] scripts/arch-run: fix bad commit

Message ID 20180717080523.18573-2-drjones@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andrew Jones July 17, 2018, 8:05 a.m. UTC
Commit 171aa3a2 ("Make scripts/arch-run.bash compatible with Bash
4.1 and older") is a commit of the wrong version of the patch.
The correct version to commit was [*]. Fix this up, which restores
the ability to override errata in the errata.txt file with
environment variables.

The erroring out when $commit is not set was changed to just skipping
the line because the erroring out didn't halt the execution of the
test anyway.

[*] https://www.spinics.net/lists/kvm/msg167833.html

Cc: Peter Shier <pshier@google.com>
Signed-off-by: Andrew Jones <drjones@redhat.com>
---
 scripts/arch-run.bash | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Peter Shier July 23, 2018, 4:40 p.m. UTC | #1
Reviewed-by: Peter Shier <pshier@google.com>
On Tue, Jul 17, 2018 at 1:05 AM Andrew Jones <drjones@redhat.com> wrote:
>
> Commit 171aa3a2 ("Make scripts/arch-run.bash compatible with Bash
> 4.1 and older") is a commit of the wrong version of the patch.
> The correct version to commit was [*]. Fix this up, which restores
> the ability to override errata in the errata.txt file with
> environment variables.
>
> The erroring out when $commit is not set was changed to just skipping
> the line because the erroring out didn't halt the execution of the
> test anyway.
>
> [*] https://www.spinics.net/lists/kvm/msg167833.html
>
> Cc: Peter Shier <pshier@google.com>
> Signed-off-by: Andrew Jones <drjones@redhat.com>
> ---
>  scripts/arch-run.bash | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash
> index f0a9b1d7c53c..ab5671a96c6c 100644
> --- a/scripts/arch-run.bash
> +++ b/scripts/arch-run.bash
> @@ -209,7 +209,7 @@ env_add_errata ()
>         if [ -f "$ENV" ] && grep -q '^ERRATA_' <(env); then
>                 for line in $(grep '^ERRATA_' "$ENV"); do
>                         errata=${line%%=*}
> -                       test -v $errata && continue
> +                       [ -n "${!errata}" ] && continue
>                         eval export "$line"
>                 done
>         elif [ ! -f "$ENV" ]; then
> @@ -251,6 +251,7 @@ env_generate_errata ()
>
>                 test -z "$commit" && continue
>                 errata="ERRATA_$commit"
> +               [ -n "${!errata}" ] && continue
>
>                 IFS=. read -r v p rest <<<"$minver"
>                 IFS=- read -r s x <<<"$rest"
> --
> 2.17.1
>
diff mbox

Patch

diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash
index f0a9b1d7c53c..ab5671a96c6c 100644
--- a/scripts/arch-run.bash
+++ b/scripts/arch-run.bash
@@ -209,7 +209,7 @@  env_add_errata ()
 	if [ -f "$ENV" ] && grep -q '^ERRATA_' <(env); then
 		for line in $(grep '^ERRATA_' "$ENV"); do
 			errata=${line%%=*}
-			test -v $errata && continue
+			[ -n "${!errata}" ] && continue
 			eval export "$line"
 		done
 	elif [ ! -f "$ENV" ]; then
@@ -251,6 +251,7 @@  env_generate_errata ()
 
 		test -z "$commit" && continue
 		errata="ERRATA_$commit"
+		[ -n "${!errata}" ] && continue
 
 		IFS=. read -r v p rest <<<"$minver"
 		IFS=- read -r s x <<<"$rest"