The hash algorithm used for the APKINDEX name in the cache was changed from sha1 to sha256 in [8c7100a61804]. Switching back to sha1 allows the cache to be shared without invalidating the cache. [8c7100a61804] db, blob: remove direct usage of openssl and use the abstraction Ref https://gitlab.alpinelinux.org/alpine/apk-tools/-/merge_requests/328 --- a/src/app_upgrade.c +++ b/src/app_upgrade.c @@ -19,7 +19,7 @@ // APK_PREUPGRADE_TOKEN is used to determine if APK version changed // so much after self-upgrade that a repository autoupdate should be // enabled. Mainly needed if the index cache name changes. -#define APK_PREUPGRADE_TOKEN "laiNgeiThu6ip1Te" +#define APK_PREUPGRADE_TOKEN "laiNgeiThu6ip1Tf" struct upgrade_ctx { unsigned short solver_flags; --- a/src/database.c +++ b/src/database.c @@ -1588,7 +1588,7 @@ static int add_repository_component(struct apk_repoparser *rp, apk_blob_t url, c .tag_mask = BIT(tag_id), .v2_allowed = !apk_blob_ends_with(url_index, APK_BLOB_STRLIT(".adb")), }; - apk_digest_calc(&repo->hash, APK_DIGEST_SHA256, url_index.ptr, url_index.len); + apk_digest_calc(&repo->hash, APK_DIGEST_SHA1, url_index.ptr, url_index.len); if (is_index_stale(db, repo)) repo->stale = 1; return 0; }