From 414fb99725050a5d6d0a76c23d8f4c601909d849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chip=20Wolf=20=E2=80=AE?= Date: Thu, 10 Nov 2022 12:14:29 +0000 Subject: [PATCH] Add option to skip generic pack checksum --- README.md | 4 +++- scripts/start-setupModpack | 12 ++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4454734fd3c..706302d0242 100644 --- a/README.md +++ b/README.md @@ -815,7 +815,9 @@ GENERIC_PACKS_SUFFIX=.zip would expand to `https://cdn.example.org/configs-v9.0.1.zip,https://cdn.example.org/mods-v4.3.6.zip`. -If applying large generic packs, the update check can be time-consuming since a SHA1 checksum is compared. To skip the update check set `SKIP_GENERIC_PACK_UPDATE_CHECK` to "true". Conversely, the generic pack(s) can be forced to be applied without comparing the checksum by setting `FORCE_GENERIC_PACK_UPDATE` to "true". +If applying large generic packs, the update can be time-consuming. To skip the update set `SKIP_GENERIC_PACK_UPDATE_CHECK` to "true". Conversely, the generic pack(s) can be forced to be applied by setting `FORCE_GENERIC_PACK_UPDATE` to "true". + +The most time consuming portion of the generic pack update is generating and comparing the SHA1 checksum. To skip the checksum generation, set `SKIP_GENERIC_PACK_CHECKSUM` to "true. ### Mod/Plugin URL Listing File diff --git a/scripts/start-setupModpack b/scripts/start-setupModpack index 5893ffe8238..127a337a151 100755 --- a/scripts/start-setupModpack +++ b/scripts/start-setupModpack @@ -254,10 +254,14 @@ function genericPacks() { cp -R -f "${base_dir}"/* /data rm -rf $original_base_dir - log "Saving generic pack(s) checksum" - sha1sum "${packFiles[@]}" > "${sum_file}" - if isDebugging; then - cat "$sum_file" + if isTrue "${SKIP_GENERIC_PACK_CHECKSUM:-false}"; then + log "Skipping generic pack(s) checksum" + else + log "Saving generic pack(s) checksum" + sha1sum "${packFiles[@]}" > "${sum_file}" + if isDebugging; then + cat "$sum_file" + fi fi fi fi