Skip to content

Commit

Permalink
document part of builder make util scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
nkraetzschmar committed Sep 16, 2024
1 parent 2b3aaff commit 7fddcb8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions builder/make_get_artifact_rules
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ extensions=(release manifest raw)

for feature in "features/"*; do
for i in "$feature/"{image,convert}.*; do
# get target artifact file extensions, usually this is the image/convert script extension
# except if the script extension is of the form filename.extA~extB in which case the artifact extension is .extA only
extension="$(grep -E -o '(\.[a-z][a-zA-Z0-9\-_~]*)*$' <<< "$i")"
real_extension="${extension%~*}"
extensions+=("${real_extension:1}")
Expand Down
6 changes: 6 additions & 0 deletions builder/make_get_image_dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ for feature in "${features[@]}"; do
advanced_convert_scripts=("features/$feature/convert${extension:-.raw}~"*)
set -f

# Advanced convert scripts are scripts of the form convert.extA~extB.
# Unlike regular convert scripts these don't always get the image.raw as input,
# instead they recieve image.extB as their input.
# This allows for convert scripts to operate on image scripts producing non .raw output
# or for covert scripts to operate on outputs of prior convert scripts.

for i in "${advanced_convert_scripts[@]}"; do
if [ "$is_feature_script" = 1 ]; then
printf "error: %s conflicts with %s\n" "$script" "$i"
Expand Down
2 changes: 2 additions & 0 deletions builder/make_list_build_artifacts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ artifacts=(".build/$cname-$COMMIT.tar" ".build/$cname-$COMMIT.release" ".build/$

for feature in "${features[@]}"; do
for i in "features/$feature/"{image,convert}.*; do
# get target artifact file extension, usually this is the image/convert script extension
# except if the script extension is of the form filename.extA~extB in which case the artifact extension is .extA only
extension="$(grep -E -o '(\.[a-z][a-zA-Z0-9\-_~]*)*$' <<< "$i")"
artifacts+=(".build/$cname-$COMMIT${extension%~*}")
done
Expand Down

0 comments on commit 7fddcb8

Please sign in to comment.