diff --git a/test/merge_debian_isos b/test/merge_debian_isos index af940d80..02cdb63f 100755 --- a/test/merge_debian_isos +++ b/test/merge_debian_isos @@ -434,6 +434,7 @@ do MOUNT_LIST="$MOUNT_LIST $mount_point" done +echo "Done." >&2 echo >&2 echo "Copying dists directory and md5sum.txt from first ISO ..." >&2 @@ -473,6 +474,7 @@ else echo "--- Could not copy /md5sum.txt from first ISO." >&2 cleanup_and_end 3 fi +echo "Done." >&2 ## Helper functions @@ -516,6 +518,84 @@ extract_release_head() { done } +# Decide whether to re-compute MD5 and whether to put out the md5sum line +# Parameters: prev_path prev_md5 +check_and_put_out_md5_grep() { + + if echo "$prev_path" | grep '^\.\/pool\/' >/dev/null 2>&1 + then + echo "$prev_md5 $prev_path" + return 0 + fi + if echo "$prev_path" | grep '^\.\/firmware\/' >/dev/null 2>&1 + then + if test "$was_multiple" = 1 + then + # There is the risk that the surviving file does not match prev_md5. + # Better omit it. + dummy=dummy + else + echo "$prev_md5 $prev_path" + fi + return 0 + fi + + if echo "$prev_path" | grep '^\.\/dists\/' >/dev/null 2>&1 + then + md5_path="$(echo -n "$prev_path" | sed -e 's/^\.\//merged_/')" + prev_md5="$(md5sum <"$md5_path" | awk '{print $1}')" + elif test "$prev_path" = ./README.txt + then + prev_md5="$(md5sum &2 @@ -619,12 +699,6 @@ echo "Done." >&2 echo >&2 echo "Merging package description files ..." >&2 -# /md5sum.txt seems to be the only overall package list -for i in $MOUNT_LIST -do - cat "$i"/md5sum.txt -done | sort -k 2 >merged_md5sum.txt - # Determine the files which are mentioned with checksum in main Release files path_list=$(for i in $MOUNT_LIST do @@ -677,6 +751,7 @@ continue fi done +echo "Done." >&2 ## Update dists/"$dist"/Release @@ -720,6 +795,20 @@ mv temp_file merged_dists/"$dist"/Release echo "Done." >&2 +## Merge md5sum.txt and compute the MD5s which might have changed +echo >&2 +echo "Merging md5sum.txt files ..." >&2 + +for i in $MOUNT_LIST +do + cat "$i"/md5sum.txt +done | sort -k 2 >merged_md5sum.txt + +polish_md5sum_txt >temp_file +mv temp_file merged_md5sum.txt +echo "Done." >&2 + + ## Produce the new ISO image echo >&2 echo "Producing result ISO image ..." >&2 diff --git a/test/merge_debian_isos.sig b/test/merge_debian_isos.sig index 32148eed..956dc495 100644 Binary files a/test/merge_debian_isos.sig and b/test/merge_debian_isos.sig differ