Merge "Extend the checksum files generation procedure"
This commit is contained in:
commit
8f56f7e83f
@ -65,7 +65,7 @@ function finish_image () {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
mv $OUT_IMAGE_PATH $1
|
mv $OUT_IMAGE_PATH $1
|
||||||
if [ "$DIB_CHECKSUM" == "1" ]; then
|
if [[ -n "$DIB_CHECKSUM" && "$DIB_CHECKSUM" != "0" ]]; then
|
||||||
|
|
||||||
# NOTE(pabelanger): Read image into memory once and generate
|
# NOTE(pabelanger): Read image into memory once and generate
|
||||||
# both checksum files.
|
# both checksum files.
|
||||||
@ -74,8 +74,9 @@ function finish_image () {
|
|||||||
# no tty). Waiting for just these processes is a bit of hacky
|
# no tty). Waiting for just these processes is a bit of hacky
|
||||||
# workaround ...
|
# workaround ...
|
||||||
declare -a wait_for
|
declare -a wait_for
|
||||||
md5sum $1 > $1.md5 & wait_for+=($!)
|
[[ "$DIB_CHECKSUM" == "1" ]] && DIB_CHECKSUM="md5,sha256"
|
||||||
sha256sum $1 > $1.sha256 & wait_for+=($!)
|
[[ "$DIB_CHECKSUM" == *md5* ]] && md5sum $1 > $1.md5 & wait_for+=($!)
|
||||||
|
[[ "$DIB_CHECKSUM" == *sha256* ]] && sha256sum $1 > $1.sha256 & wait_for+=($!)
|
||||||
wait "${wait_for[@]}"
|
wait "${wait_for[@]}"
|
||||||
fi
|
fi
|
||||||
echo "Image file $1 created..."
|
echo "Image file $1 created..."
|
||||||
|
10
releasenotes/notes/dib-checksum-3d0d9af8778176be.yaml
Normal file
10
releasenotes/notes/dib-checksum-3d0d9af8778176be.yaml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
The usage of the ``DIB_CHECKSUM`` variable is extended. Now to be more
|
||||||
|
specific the variable can be set to the ``sha256`` or ``md5`` value to
|
||||||
|
generate only one checksum file. There also can be provided a
|
||||||
|
comma-separated list of the values, but only ``sha256`` and ``md5``
|
||||||
|
supported. For backward compatibility using ``DIB_CHECKSUM=1`` or option
|
||||||
|
``--checksum`` in the command line still can be used to generate all
|
||||||
|
supported checksums.
|
Loading…
Reference in New Issue
Block a user