@@ -500,68 +500,74 @@ if [[ $USE_CHECK_BUILD_ARTEFACTS_SCRIPT -eq 0 ]]; then
500500 repo_version=$( cfg_get_value " repository" " repo_version" )
501501 os_type=$( cfg_get_value " architecture" " os_type" )
502502 software_subdir=$( cfg_get_value " architecture" " software_subdir" )
503- accelerator=$( cfg_get_value " architecture" " accelerator" )
504- prefix=" ${repo_version} /software/${os_type} /${software_subdir} "
503+ accelerators=$( cfg_get_value " architecture" " accelerator" )
504+ cpu_prefix=" ${repo_version} /software/${os_type} /${software_subdir} "
505+ prefixes=(" ${cpu_prefix} " )
505506
506507 # if we build for an accelerator, the prefix is different
507- if [[ ! -z ${accelerator} ]]; then
508- prefix=" ${prefix} /accel/${accelerator} "
508+ if [[ ! -z ${accelerators} ]]; then
509+ IFS=' +' read -ra accelerators <<< " $accelerators"
510+ # prepend the cpu prefix and "accel" to the accelerator names
511+ prefixes=(" ${accelerators[@]/#/ ${cpu_prefix} / accel/ } " )
509512 fi
510513
511- # extract directories/entries from tarball content
512- modules_entries=$( grep " ${prefix} /modules" ${tmpfile} )
513- software_entries=$( grep " ${prefix} /software" ${tmpfile} )
514- reprod_entries=$( grep " ${prefix} /reprod" ${tmpfile} )
515- reprod_shortened=$( echo " ${reprod_entries} " | sed -e " s@${prefix} /reprod/@@" | awk -F/ ' {if (NF >= 4) {print $1 "/" $2 "/" $3}}' | sort -u)
516- other_entries=$( cat ${tmpfile} | grep -v " ${prefix} /modules" | grep -v " ${prefix} /software" | grep -v " ${prefix} /reprod" )
517- other_shortened=$( echo " ${other_entries} " | sed -e " s@^.*${prefix} /@@" | sort -u)
518- modules=$( echo " ${modules_entries} " | grep " /all/.*/.*lua$" | sed -e ' s@^.*/\([^/]*/[^/]*.lua\)$@\1@' | sort -u)
519- software_pkgs=$( echo " ${software_entries} " | sed -e " s@${prefix} /software/@@" | awk -F/ ' {if (NR >= 2) {print $1 "/" $2}}' | sort -u)
520-
521514 artefact_summary=" <summary>$( print_code_item ' __ITEM__' ${TARBALL} ) </summary>"
522515 comment_artifacts_list=" "
523516 comment_artifacts_list=" ${comment_artifacts_list} $( print_br_item2 ' size: __ITEM__ MiB (__ITEM2__ bytes)' ${size_mib} ${size} ) "
524517 comment_artifacts_list=" ${comment_artifacts_list} $( print_br_item ' entries: __ITEM__' ${entries} ) "
525- comment_artifacts_list=" ${comment_artifacts_list} $( print_br_item ' modules under ___ITEM___' ${prefix} /modules/all) "
526- comment_artifacts_list=" ${comment_artifacts_list} <pre>"
527- if [[ ! -z ${modules} ]]; then
528- while IFS= read -r mod ; do
529- comment_artifacts_list=" ${comment_artifacts_list} $( print_br_item ' <code>__ITEM__</code>' ${mod} ) "
530- done <<< " ${modules}"
531- else
532- comment_artifacts_list=" ${comment_artifacts_list} $( print_br_item ' __ITEM__' ' no module files in tarball' ) "
533- fi
534- comment_artifacts_list=" ${comment_artifacts_list} </pre>"
535- comment_artifacts_list=" ${comment_artifacts_list} $( print_br_item ' software under ___ITEM___' ${prefix} /software) "
536- comment_artifacts_list=" ${comment_artifacts_list} <pre>"
537- if [[ ! -z ${software_pkgs} ]]; then
538- while IFS= read -r sw_pkg ; do
539- comment_artifacts_list=" ${comment_artifacts_list} $( print_br_item ' <code>__ITEM__</code>' ${sw_pkg} ) "
540- done <<< " ${software_pkgs}"
541- else
542- comment_artifacts_list=" ${comment_artifacts_list} $( print_br_item ' __ITEM__' ' no software packages in tarball' ) "
543- fi
544- comment_artifacts_list=" ${comment_artifacts_list} </pre>"
545- comment_artifacts_list=" ${comment_artifacts_list} $( print_br_item ' reprod directories under ___ITEM___' ${prefix} /reprod) "
546- comment_artifacts_list=" ${comment_artifacts_list} <pre>"
547- if [[ ! -z ${reprod_shortened} ]]; then
548- while IFS= read -r reprod ; do
549- comment_artifacts_list=" ${comment_artifacts_list} $( print_br_item ' <code>__ITEM__</code>' ${reprod} ) "
550- done <<< " ${reprod_shortened}"
551- else
552- comment_artifacts_list=" ${comment_artifacts_list} $( print_br_item ' __ITEM__' ' no reprod directories in tarball' ) "
553- fi
554- comment_artifacts_list=" ${comment_artifacts_list} </pre>"
555- comment_artifacts_list=" ${comment_artifacts_list} $( print_br_item ' other under ___ITEM___' ${prefix} ) "
556- comment_artifacts_list=" ${comment_artifacts_list} <pre>"
557- if [[ ! -z ${other_shortened} ]]; then
558- while IFS= read -r other ; do
559- comment_artifacts_list=" ${comment_artifacts_list} $( print_br_item ' <code>__ITEM__</code>' ${other} ) "
560- done <<< " ${other_shortened}"
561- else
562- comment_artifacts_list=" ${comment_artifacts_list} $( print_br_item ' __ITEM__' ' no other files in tarball' ) "
563- fi
564- comment_artifacts_list=" ${comment_artifacts_list} </pre>"
518+
519+ for prefix in " ${prefixes[@]} " ; do
520+ # extract directories/entries from tarball content
521+ modules_entries=$( grep " ${prefix} /modules" ${tmpfile} )
522+ software_entries=$( grep " ${prefix} /software" ${tmpfile} )
523+ reprod_entries=$( grep " ${prefix} /reprod" ${tmpfile} )
524+ reprod_shortened=$( echo " ${reprod_entries} " | sed -e " s@${prefix} /reprod/@@" | awk -F/ ' {if (NF >= 4) {print $1 "/" $2 "/" $3}}' | sort -u)
525+ other_entries=$( cat ${tmpfile} | grep " ${prefix} " | grep -v " ${prefix} /modules" | grep -v " ${prefix} /software" | grep -v " ${prefix} /reprod" )
526+ other_shortened=$( echo " ${other_entries} " | sed -e " s@^.*${prefix} /@@" | sort -u)
527+ modules=$( echo " ${modules_entries} " | grep " /all/.*/.*lua$" | sed -e ' s@^.*/\([^/]*/[^/]*.lua\)$@\1@' | sort -u)
528+ software_pkgs=$( echo " ${software_entries} " | sed -e " s@${prefix} /software/@@" | awk -F/ ' {if (NR >= 2) {print $1 "/" $2}}' | sort -u)
529+
530+ comment_artifacts_list=" ${comment_artifacts_list} $( print_br_item ' modules under ___ITEM___' ${prefix} /modules/all) "
531+ comment_artifacts_list=" ${comment_artifacts_list} <pre>"
532+ if [[ ! -z ${modules} ]]; then
533+ while IFS= read -r mod ; do
534+ comment_artifacts_list=" ${comment_artifacts_list} $( print_br_item ' <code>__ITEM__</code>' ${mod} ) "
535+ done <<< " ${modules}"
536+ else
537+ comment_artifacts_list=" ${comment_artifacts_list} $( print_br_item ' __ITEM__' ' no module files in tarball' ) "
538+ fi
539+ comment_artifacts_list=" ${comment_artifacts_list} </pre>"
540+ comment_artifacts_list=" ${comment_artifacts_list} $( print_br_item ' software under ___ITEM___' ${prefix} /software) "
541+ comment_artifacts_list=" ${comment_artifacts_list} <pre>"
542+ if [[ ! -z ${software_pkgs} ]]; then
543+ while IFS= read -r sw_pkg ; do
544+ comment_artifacts_list=" ${comment_artifacts_list} $( print_br_item ' <code>__ITEM__</code>' ${sw_pkg} ) "
545+ done <<< " ${software_pkgs}"
546+ else
547+ comment_artifacts_list=" ${comment_artifacts_list} $( print_br_item ' __ITEM__' ' no software packages in tarball' ) "
548+ fi
549+ comment_artifacts_list=" ${comment_artifacts_list} </pre>"
550+ comment_artifacts_list=" ${comment_artifacts_list} $( print_br_item ' reprod directories under ___ITEM___' ${prefix} /reprod) "
551+ comment_artifacts_list=" ${comment_artifacts_list} <pre>"
552+ if [[ ! -z ${reprod_shortened} ]]; then
553+ while IFS= read -r reprod ; do
554+ comment_artifacts_list=" ${comment_artifacts_list} $( print_br_item ' <code>__ITEM__</code>' ${reprod} ) "
555+ done <<< " ${reprod_shortened}"
556+ else
557+ comment_artifacts_list=" ${comment_artifacts_list} $( print_br_item ' __ITEM__' ' no reprod directories in tarball' ) "
558+ fi
559+ comment_artifacts_list=" ${comment_artifacts_list} </pre>"
560+ comment_artifacts_list=" ${comment_artifacts_list} $( print_br_item ' other under ___ITEM___' ${prefix} ) "
561+ comment_artifacts_list=" ${comment_artifacts_list} <pre>"
562+ if [[ ! -z ${other_shortened} ]]; then
563+ while IFS= read -r other ; do
564+ comment_artifacts_list=" ${comment_artifacts_list} $( print_br_item ' <code>__ITEM__</code>' ${other} ) "
565+ done <<< " ${other_shortened}"
566+ else
567+ comment_artifacts_list=" ${comment_artifacts_list} $( print_br_item ' __ITEM__' ' no other files in tarball' ) "
568+ fi
569+ comment_artifacts_list=" ${comment_artifacts_list} </pre>"
570+ done
565571 else
566572 comment_artifacts_list=" ${comment_artifacts_list} $( print_dd_item ' No artefacts were created or found.' ' ' ) "
567573 fi
0 commit comments