mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-10 06:26:57 +02:00
fix(bootstrap_sdk): Rename final output tarball
The name "coreos-sdk-amd64-..." makes much more sense for general distribution than "stage4..." so after catalyst is done rename the final tarball and fixup the DIGESTS file to refer to the new name.
This commit is contained in:
parent
96186e3c47
commit
76ecff8169
@ -52,3 +52,26 @@ catalyst_stage_default
|
||||
|
||||
catalyst_init "$@"
|
||||
catalyst_build
|
||||
|
||||
info "Build complete! Changing output name to something more sensible."
|
||||
build_name="stage4-${ARCH}-${FLAGS_version}.tar.bz2"
|
||||
release_name="${TYPE}-${ARCH}-${FLAGS_version}.tar.bz2"
|
||||
ln -f "$BUILDS/${build_name}" "$BUILDS/${release_name}"
|
||||
ln -f "$BUILDS/${build_name}.CONTENTS" "$BUILDS/${release_name}.CONTENTS"
|
||||
sed -e "s/${build_name}/${release_name}/" \
|
||||
"$BUILDS/${build_name}.DIGESTS" > "$BUILDS/${release_name}.DIGESTS"
|
||||
|
||||
# Validate we didn't break the DIGESTS with sed
|
||||
for hash_type in md5 sha1 sha512; do
|
||||
info "Validating ${hash_type} DIGESTS"
|
||||
# shash is what's used to generate these multi-hash digests but it
|
||||
# doesn't exit with non-zero on failure. I mean seriously...
|
||||
#shash -c "$BUILDS/${release_name}.DIGESTS" -a "${hash_type}"
|
||||
# So we do it the hard way...
|
||||
grep -qi "^# ${hash_type} HASH$" "$BUILDS/${release_name}.DIGESTS"
|
||||
(cd "$BUILDS" && grep -A1 -i "^# ${hash_type} HASH$" \
|
||||
"${release_name}.DIGESTS" | grep -v '^--$' | \
|
||||
${hash_type}sum -c - --strict)
|
||||
done
|
||||
|
||||
info "SDK ready: $BUILDS/${release_name}"
|
||||
|
Loading…
Reference in New Issue
Block a user