On 02/10/2024 1:42 pm, Marek Marczykowski-Górecki wrote:
> It will be useful for further tests.
>
> Signed-off-by: Marek Marczykowski-Górecki <marma...@invisiblethingslab.com>
> ---
>  automation/scripts/build | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/automation/scripts/build b/automation/scripts/build
> index b3c71fb6fb60..4cd41cb2c471 100755
> --- a/automation/scripts/build
> +++ b/automation/scripts/build
> @@ -47,6 +47,7 @@ if [[ "${CPPCHECK}" == "y" ]] && [[ "${HYPERVISOR_ONLY}" == 
> "y" ]]; then
>  
>      # Preserve artefacts
>      cp xen/xen binaries/xen
> +    if [[ -f xen/xen.efi ]]; then cp xen/xen.efi binaries/xen.efi; fi

Wouldn't

    # Preserve xen and optionally xen.efi
    cp -f xen/xen xen/xen.efi binaries/

do this in a more concise way?

Alternatively, what about this:

diff --git a/automation/scripts/build b/automation/scripts/build
index b3c71fb6fb60..14815ea7ad9c 100755
--- a/automation/scripts/build
+++ b/automation/scripts/build
@@ -41,6 +41,15 @@ cp xen/.config xen-config
 # Directory for the artefacts to be dumped into
 mkdir -p binaries
 
+collect_xen_artefacts ()
+{
+    for A in xen/xen xen/xen.efi; do
+        if [[ -f $A ]]; then
+            cp $A binaries/
+        fi
+    done
+}
+
 if [[ "${CPPCHECK}" == "y" ]] && [[ "${HYPERVISOR_ONLY}" == "y" ]]; then
     # Cppcheck analysis invokes Xen-only build
     xen/scripts/xen-analysis.py --run-cppcheck --cppcheck-misra --
-j$(nproc)
@@ -53,7 +62,7 @@ elif [[ "${HYPERVISOR_ONLY}" == "y" ]]; then
     make -j$(nproc) xen
 
     # Preserve artefacts
-    cp xen/xen binaries/xen
+    collect_xen_artefacts
 else
     # Full build.  Figure out our ./configure options
     cfgargs=()

so we don't triplicate the handling?

~Andrew

Reply via email to