Move XEN_TARGET_ARCH export into the architecture selection
branches instead of exporting the variable before assignment.
This ensures the selected architecture value is correctly
propagated.
No functional changes.
Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
---
automation/eclair_analysis/prepare.sh | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/automation/eclair_analysis/prepare.sh b/automation/eclair_analysis/prepare.sh
index e941e6edc4..fde83c2d2d 100755
--- a/automation/eclair_analysis/prepare.sh
+++ b/automation/eclair_analysis/prepare.sh
@@ -22,12 +22,10 @@ if [ $# -ne 1 ]; then
exit 1
fi
-export XEN_TARGET_ARCH
-
if [ "$1" = "X86_64" ]; then
- XEN_TARGET_ARCH=x86_64
+ export XEN_TARGET_ARCH=x86_64
elif [ "$1" = "ARM64" ]; then
- XEN_TARGET_ARCH=arm64
+ export XEN_TARGET_ARCH=arm64
else
fatal "Unknown configuration: $1"
fi
--
2.43.0
On 2026-05-19 12:27, Dmytro Prokopchuk1 wrote: > Move XEN_TARGET_ARCH export into the architecture selection > branches instead of exporting the variable before assignment. > This ensures the selected architecture value is correctly > propagated. > Did you see a case where this is not correctly propagated? As far as I understand, the value of XEN_TARGET_ARCH seen by subprocesses is the last value set for the variable, regardless of where the export command is placed. > No functional changes. > > Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com> > --- > automation/eclair_analysis/prepare.sh | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/automation/eclair_analysis/prepare.sh > b/automation/eclair_analysis/prepare.sh > index e941e6edc4..fde83c2d2d 100755 > --- a/automation/eclair_analysis/prepare.sh > +++ b/automation/eclair_analysis/prepare.sh > @@ -22,12 +22,10 @@ if [ $# -ne 1 ]; then > exit 1 > fi > > -export XEN_TARGET_ARCH > - > if [ "$1" = "X86_64" ]; then > - XEN_TARGET_ARCH=x86_64 > + export XEN_TARGET_ARCH=x86_64 > elif [ "$1" = "ARM64" ]; then > - XEN_TARGET_ARCH=arm64 > + export XEN_TARGET_ARCH=arm64 > else > fatal "Unknown configuration: $1" > fi -- Nicola Vetrini, B.Sc. Software Engineer BUGSENG (https://bugseng.com) LinkedIn: https://www.linkedin.com/in/nicola-vetrini-a42471253
Hello Nicola, On 5/19/26 13:45, Nicola Vetrini wrote: > On 2026-05-19 12:27, Dmytro Prokopchuk1 wrote: >> Move XEN_TARGET_ARCH export into the architecture selection >> branches instead of exporting the variable before assignment. >> This ensures the selected architecture value is correctly >> propagated. >> > > Did you see a case where this is not correctly propagated? As far as I I didn't see a case. > understand, the value of XEN_TARGET_ARCH seen by subprocesses is the > last value set for the variable, regardless of where the export command > is placed. Yes, you are right. It works in that way. IMO, exporting empty variable looks strange... Anyway up to you to judge if this patch is needed or not. BR, Dmytro. >> No functional changes. >> >> Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com> >> --- >> automation/eclair_analysis/prepare.sh | 6 ++---- >> 1 file changed, 2 insertions(+), 4 deletions(-) >> >> diff --git a/automation/eclair_analysis/prepare.sh b/automation/ >> eclair_analysis/prepare.sh >> index e941e6edc4..fde83c2d2d 100755 >> --- a/automation/eclair_analysis/prepare.sh >> +++ b/automation/eclair_analysis/prepare.sh >> @@ -22,12 +22,10 @@ if [ $# -ne 1 ]; then >> exit 1 >> fi >> >> -export XEN_TARGET_ARCH >> - >> if [ "$1" = "X86_64" ]; then >> - XEN_TARGET_ARCH=x86_64 >> + export XEN_TARGET_ARCH=x86_64 >> elif [ "$1" = "ARM64" ]; then >> - XEN_TARGET_ARCH=arm64 >> + export XEN_TARGET_ARCH=arm64 >> else >> fatal "Unknown configuration: $1" >> fi >
On 2026-05-19 13:03, Dmytro Prokopchuk1 wrote: > Hello Nicola, > > On 5/19/26 13:45, Nicola Vetrini wrote: >> On 2026-05-19 12:27, Dmytro Prokopchuk1 wrote: >>> Move XEN_TARGET_ARCH export into the architecture selection >>> branches instead of exporting the variable before assignment. >>> This ensures the selected architecture value is correctly >>> propagated. >>> >> >> Did you see a case where this is not correctly propagated? As far as I > I didn't see a case. >> understand, the value of XEN_TARGET_ARCH seen by subprocesses is the >> last value set for the variable, regardless of where the export >> command >> is placed. > Yes, you are right. It works in that way. > IMO, exporting empty variable looks strange... > > Anyway up to you to judge if this patch is needed or not. > Indeed it is a bit strange. To avoid this we should perhaps move the export after the if, so that it is obvious that it contains the correct value > BR, Dmytro. >>> No functional changes. >>> >>> Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com> >>> --- >>> automation/eclair_analysis/prepare.sh | 6 ++---- >>> 1 file changed, 2 insertions(+), 4 deletions(-) >>> >>> diff --git a/automation/eclair_analysis/prepare.sh b/automation/ >>> eclair_analysis/prepare.sh >>> index e941e6edc4..fde83c2d2d 100755 >>> --- a/automation/eclair_analysis/prepare.sh >>> +++ b/automation/eclair_analysis/prepare.sh >>> @@ -22,12 +22,10 @@ if [ $# -ne 1 ]; then >>> exit 1 >>> fi >>> >>> -export XEN_TARGET_ARCH >>> - >>> if [ "$1" = "X86_64" ]; then >>> - XEN_TARGET_ARCH=x86_64 >>> + export XEN_TARGET_ARCH=x86_64 >>> elif [ "$1" = "ARM64" ]; then >>> - XEN_TARGET_ARCH=arm64 >>> + export XEN_TARGET_ARCH=arm64 >>> else >>> fatal "Unknown configuration: $1" >>> fi >> -- Nicola Vetrini, B.Sc. Software Engineer BUGSENG (https://bugseng.com) LinkedIn: https://www.linkedin.com/in/nicola-vetrini-a42471253
On 19.05.2026 12:27, Dmytro Prokopchuk1 wrote: > Move XEN_TARGET_ARCH export into the architecture selection > branches instead of exporting the variable before assignment. > This ensures the selected architecture value is correctly > propagated. This reads as if something is being corrected, while ... > No functional changes. ... this says the opposite. Is the whole purpose ... > --- a/automation/eclair_analysis/prepare.sh > +++ b/automation/eclair_analysis/prepare.sh > @@ -22,12 +22,10 @@ if [ $# -ne 1 ]; then > exit 1 > fi > > -export XEN_TARGET_ARCH > - > if [ "$1" = "X86_64" ]; then > - XEN_TARGET_ARCH=x86_64 > + export XEN_TARGET_ARCH=x86_64 > elif [ "$1" = "ARM64" ]; then > - XEN_TARGET_ARCH=arm64 > + export XEN_TARGET_ARCH=arm64 > else > fatal "Unknown configuration: $1" > fi ... the reduction in line count then (at the expense of some redundancy, which would increase when further arches get put here)? Jan
© 2016 - 2026 Red Hat, Inc.