FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

use empty list if there are no additions in an easystack file · EESSI/software-layer-scripts@a69e383 · GitHub

Commit a69e383

Browse files
authored
use empty list if there are no additions in an easystack file
Enhance awk script to handle empty additions case.
1 parent 10abf84 commit a69e383

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

‎EESSI-install-software.sh‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,10 +444,19 @@ else
444444
# use the PR diff file to find which items have been added to this particular easystack file
445445
# and dump that to a temporary easystack file that we can use to fetch the sources for only these added items
446446
awk -v file="${easystack_file}" '
447-
BEGIN { print "easyconfigs:" }
448447
/^diff --git / { found=0 }
449448
$0 == "+++ b/" file { found=1; next }
450-
found && /^\+/ && !/^\+\+\+/ { sub(/^\+/, ""); print }
449+
found && /^\+/ && !/^\+\+\+/ {
450+
sub(/^\+/, "")
451+
additions = additions $0 "\n"
452+
count++
453+
}
454+
END {
455+
if (count)
456+
printf "easyconfigs:\n%s", additions
457+
else
458+
print "easyconfigs: []"
459+
}
451460
' "${diff_file}" >> ${easystack_additions}
452461
echo_green "Downloading sources for added items in easystack file ${easystack_file} using eb ${fetch_option}..."
453462
echo '(note: this step can be skipped by setting $EESSI_SKIP_FETCH_EASYSTACK_SOURCES to a non-empty value)'

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL