Added options --md5 and --sha256 to Jigdo releng test
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Copyright 2011 Thomas Schmitt <scdbackup@gmx.net>
|
||||
# Copyright 2011, 2019 Thomas Schmitt <scdbackup@gmx.net>
|
||||
# Copyright 2011 George Danchev <danchev@spnet.net>
|
||||
# Licensed under GNU GPL version 2 or later
|
||||
|
||||
@ -16,7 +16,8 @@ not_in_releng_exit() {
|
||||
print_specific_help() {
|
||||
cat << HLP
|
||||
Specific options:
|
||||
none yet.
|
||||
--md5 use MD5 checksums (default)
|
||||
--sha256 use SHA256 checksums
|
||||
Overview:
|
||||
Match the resulting ISO image representation
|
||||
against the jigdo representation.
|
||||
@ -28,6 +29,33 @@ if test "$SPECIFIC_HELP" = 1; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Set default values for specific option variables.
|
||||
checksum_type=md5
|
||||
# Interpret specific options, they begin after the first --.
|
||||
next_is=ignore
|
||||
for i in "$@"
|
||||
do
|
||||
if test "$next_is" = "ignore"
|
||||
then
|
||||
if test "$i" = "--"
|
||||
then
|
||||
next_is=""
|
||||
fi
|
||||
elif test "$i" = "--md5"
|
||||
then
|
||||
checksum_type=md5
|
||||
elif test "$i" = "--sha256"
|
||||
then
|
||||
checksum_type=sha256
|
||||
else
|
||||
echo >&2
|
||||
echo "Unknown test specific option: $i" >&2
|
||||
print_help
|
||||
print_specific_help
|
||||
exit 31
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -x $RELENG_XORRISO ]; then
|
||||
print_help
|
||||
printf "\n${SELF}: -x absolute or relative path to binary to be run.\n\n"
|
||||
@ -87,7 +115,10 @@ case ${RETCODE_VER_JTE} in
|
||||
esac
|
||||
|
||||
# grab remote ISO image, to decompose
|
||||
if [ ! -f "${TMP_DATA_DIR}"/"${REMOTE_IMG}" ]; then
|
||||
if [ -L "${TMP_DATA_DIR}"/"${REMOTE_IMG}" ]; then
|
||||
printf "\n${SELF}: Found symbolic link ${TMP_DATA_DIR}"/"${REMOTE_IMG}\n"
|
||||
ls -ld ${TMP_DATA_DIR}"/"${REMOTE_IMG}
|
||||
elif [ ! -f "${TMP_DATA_DIR}"/"${REMOTE_IMG}" ]; then
|
||||
printf "\n${SELF}: Downloading ${REMOTE_URL}/${REMOTE_IMG}\n"
|
||||
if wget -V >/dev/null 2>&1
|
||||
then
|
||||
@ -206,9 +237,9 @@ JIGDO_MAP="Debian=${JIGDO_MAP_RHV}/"
|
||||
# create jigdo MD5 list in base64 format
|
||||
JIGDO_GEN_MD5=${GEN_DATA_DIR}/${RELENG_IMG}.md5
|
||||
|
||||
printf "${SELF}: Creating MD5 list in hex format in ${JIGDO_GEN_MD5}..."
|
||||
printf "${SELF}: Creating $checksum_type list in hex format in ${JIGDO_GEN_MD5}..."
|
||||
set +e
|
||||
./jigdo-gen-md5-list ${RELENG_DIR} > ${JIGDO_GEN_MD5}
|
||||
./jigdo-gen-md5-list "--""$checksum_type" ${RELENG_DIR} > ${JIGDO_GEN_MD5}
|
||||
ret=$?
|
||||
set -e
|
||||
|
||||
@ -224,12 +255,13 @@ fi
|
||||
|
||||
CMD="$CMD \
|
||||
-jigdo-template-compress gzip \
|
||||
-jigdo-checksum-algorithm "$checksum_type" \
|
||||
-checksum_algorithm_iso md5,sha1,sha256,sha512 \
|
||||
-checksum_algorithm_template md5,sha1,sha256,sha512 \
|
||||
-jigdo-jigdo ${JIGDO_JIGDO} \
|
||||
-jigdo-template ${JIGDO_TEMPLATE} \
|
||||
-jigdo-map ${JIGDO_MAP} \
|
||||
-md5-list ${JIGDO_GEN_MD5} \
|
||||
-checksum-list ${JIGDO_GEN_MD5} \
|
||||
-jigdo-min-file-size 1024 \
|
||||
"
|
||||
|
||||
|
Reference in New Issue
Block a user