diff options
| author | Danilo M. <danix@danix.xyz> | 2026-05-18 10:16:11 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-05-18 10:16:11 +0200 |
| commit | a0c34e1b949a3b167685080a6776d9e404fd7923 (patch) | |
| tree | b20c3e2fae44a26bb0acf71ebd872e91d2acee43 | |
| parent | fed5a05be7d444378a8da5055d720d94e78c15e2 (diff) | |
| download | mkhintfile-a0c34e1b949a3b167685080a6776d9e404fd7923.tar.gz mkhintfile-a0c34e1b949a3b167685080a6776d9e404fd7923.zip | |
fix: always run downloads when updating hint file with -N
-N should add NODOWNLOAD=yes but still recalculate md5sums.
Previously it skipped the download block entirely.
| -rwxr-xr-x | mkhint | 34 |
1 files changed, 16 insertions, 18 deletions
@@ -241,26 +241,26 @@ update_hint_file() { # Use sed for global replacement of OLD_VERSION in all variables sed -i "s/${old_version}/${new_version}/g" "$normalized_file" - if [[ $NO_DL -eq 1 ]]; then - add_nodownload "$normalized_file" - else - download=$(grep '^DOWNLOAD=' "$normalized_file" | sed 's/DOWNLOAD="//;s/"$//') - if [[ -n "$download" ]]; then - if [[ $download != "UNSUPPORTED" && $download != "UNTESTED" ]]; then - sum=$(download_file ${download}) - sed -i "/^MD5SUM=/s/MD5SUM=\"[^\"]*\"/MD5SUM=\"$sum\"/" "$normalized_file" - fi + download=$(grep '^DOWNLOAD=' "$normalized_file" | sed 's/DOWNLOAD="//;s/"$//') + if [[ -n "$download" ]]; then + if [[ $download != "UNSUPPORTED" && $download != "UNTESTED" ]]; then + sum=$(download_file ${download}) + sed -i "/^MD5SUM=/s/MD5SUM=\"[^\"]*\"/MD5SUM=\"$sum\"/" "$normalized_file" fi + fi - download_x64=$(grep '^DOWNLOAD_x86_64=' "$normalized_file" | sed 's/DOWNLOAD_x86_64="//;s/"$//') - if [[ -n "$download_x64" ]]; then - if [[ $download_x64 != "UNSUPPORTED" && $download_x64 != "UNTESTED" ]]; then - sum64=$(download_file ${download_x64}) - sed -i "/^MD5SUM_x86_64=/s/MD5SUM_x86_64=\"[^\"]*\"/MD5SUM_x86_64=\"$sum64\"/" "$normalized_file" - fi + download_x64=$(grep '^DOWNLOAD_x86_64=' "$normalized_file" | sed 's/DOWNLOAD_x86_64="//;s/"$//') + if [[ -n "$download_x64" ]]; then + if [[ $download_x64 != "UNSUPPORTED" && $download_x64 != "UNTESTED" ]]; then + sum64=$(download_file ${download_x64}) + sed -i "/^MD5SUM_x86_64=/s/MD5SUM_x86_64=\"[^\"]*\"/MD5SUM_x86_64=\"$sum64\"/" "$normalized_file" fi fi + if [[ $NO_DL -eq 1 ]]; then + add_nodownload "$normalized_file" + fi + hf=$(cat $normalized_file) echo "Updated hint file: $normalized_file" echo "==========================================" @@ -399,9 +399,7 @@ main() { clean_bak_files ;; update) - if [[ $NO_DL -eq 0 ]]; then - check_wget - fi + check_wget update_hint_file "$HINT_FILE" "$VERSION" ;; new) |
