mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-08 13:36:58 +02:00
fix(release_util): Fix DIGESTS regression from feb59db9f
While attempting to fix the easy to mix up DIGESTS names in feb59db9f
I
stumbled across yet another way that the DIGESTS names were a bit
unpredictable: previously a .bz2 got stuck into the file name when
upload_images automatically compressed some file types. The new code
missed this and never added the .bz2. Correct this now, both for
image_to_vm which has a pile of glue to keep the legacy names in place
for now and build_image which I never intended to change.
This commit is contained in:
parent
dc9a03c40f
commit
1177d198da
@ -114,7 +114,7 @@ upload_image() {
|
|||||||
shift 2
|
shift 2
|
||||||
else
|
else
|
||||||
[[ $# -eq 1 ]] || die "-d is required for multi-file uploads"
|
[[ $# -eq 1 ]] || die "-d is required for multi-file uploads"
|
||||||
digests="${1}.DIGESTS"
|
# digests is assigned after image is possibly compressed/renamed
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local uploads=()
|
local uploads=()
|
||||||
@ -134,6 +134,10 @@ upload_image() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [[ -z "${digests}" ]]; then
|
||||||
|
digests="${uploads[0]}.DIGESTS"
|
||||||
|
fi
|
||||||
|
|
||||||
# For consistency generate a .DIGESTS file similar to the one catalyst
|
# For consistency generate a .DIGESTS file similar to the one catalyst
|
||||||
# produces for the SDK tarballs and up upload it too.
|
# produces for the SDK tarballs and up upload it too.
|
||||||
make_digests -d "${digests}" "${uploads[@]}"
|
make_digests -d "${digests}" "${uploads[@]}"
|
||||||
|
@ -645,20 +645,26 @@ vm_upload() {
|
|||||||
# consistent and relying on ordering was breakable.
|
# consistent and relying on ordering was breakable.
|
||||||
# Now the common prefix, output by $(_dst_name) is used above.
|
# Now the common prefix, output by $(_dst_name) is used above.
|
||||||
# Some download/install scripts may still refer to the old name.
|
# Some download/install scripts may still refer to the old name.
|
||||||
local uploaded legacy_digests
|
local uploaded legacy_uploaded
|
||||||
for uploaded in "${VM_GENERATED_FILES[@]}"; do
|
for uploaded in "${VM_GENERATED_FILES[@]}"; do
|
||||||
if [[ "${uploaded}" == "${VM_DST_IMG}" ]]; then
|
if [[ "${uploaded}" == "${VM_DST_IMG}" ]]; then
|
||||||
legacy_digests="$(_dst_dir)/$(basename ${VM_DST_IMG}).DIGESTS"
|
legacy_uploaded="$(_dst_dir)/$(basename ${VM_DST_IMG})"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Since depending on the ordering of $VM_GENERATED_FILES is brittle only
|
# Since depending on the ordering of $VM_GENERATED_FILES is brittle only
|
||||||
# use it if $VM_DST_IMG isn't included in the uploaded files.
|
# use it if $VM_DST_IMG isn't included in the uploaded files.
|
||||||
if [[ -z "${legacy_digests}" ]]; then
|
if [[ -z "${legacy_uploaded}" ]]; then
|
||||||
legacy_digests="${VM_GENERATED_FILES[0]}.DIGESTS"
|
legacy_uploaded="${VM_GENERATED_FILES[0]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# If upload_images compressed $legacy_uploaded be sure to add .bz2
|
||||||
|
if [[ "${legacy_uploaded}" =~ \.(img|bin|vdi|vmdk)$ ]]; then
|
||||||
|
legacy_uploaded+="${IMAGE_ZIPEXT}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
local legacy_digests="${legacy_uploaded}.DIGESTS"
|
||||||
[[ "${legacy_digests}" != "${digests}" ]] || return 0
|
[[ "${legacy_digests}" != "${digests}" ]] || return 0
|
||||||
|
|
||||||
local legacy_uploads=( "${legacy_digests}" )
|
local legacy_uploads=( "${legacy_digests}" )
|
||||||
|
Loading…
Reference in New Issue
Block a user