From 7bc53375753b7e348ec956e8eb33886a92aab4a6 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sun, 16 Jun 2019 01:04:35 -0400 Subject: ob-buildopk: Make archive member mtimes deterministic --- diff --git a/src/ob-buildopk.sh b/src/ob-buildopk.sh index b67ee3b..a9dab2c 100644 --- a/src/ob-buildopk.sh +++ b/src/ob-buildopk.sh @@ -25,13 +25,16 @@ build_opk() local version="${2}" local arch="${3}" local plat="${4}" - shift 4 + local date="${5}" + shift 5 ob_info "$(ob_get_msg 'build_opk')" \ "${binary}_${version}_${arch}_${plat}.opk" + find "${binary}.control" "${binary}.data" | xargs touch -d "${date}" (cd -- "${binary}.data" && tar -czf '../data.tar.gz' '.') (cd -- "${binary}.control" && tar -czf '../control.tar.gz' '.') + touch -d "${date}" 'control.tar.gz' 'data.tar.gz' tar -czf "../../${binary}_${version}_${arch}_${plat}.opk" \ 'debian-binary' 'data.tar.gz' 'control.tar.gz' @@ -42,6 +45,7 @@ build_opk() main() { + local date= local pkg= local arch= local plat= @@ -53,11 +57,13 @@ main() fi ob_init_package '..' || return 1 + date="$(ob_iso8601_gmtime "${SOURCE_DATE_EPOCH}")" printf '2.0\n' >'debian-binary' + touch -d "${date}" 'debian-binary' if [ x"${OB_DO_SOURCE:+set}" = x'set' ]; then build_opk "src-${OPK_SOURCE}" "${OPK_SOURCE_VERSION}" \ - 'src' 'all' + 'src' 'all' "${date}" else for pkg in ${OPK_PACKAGES_REDUCED}; do arch="$(ob_get_binary_parameter "${pkg}" \ @@ -66,7 +72,7 @@ main() plat="$(ob_get_binary_parameter "${pkg}" 'Platform')" [ x"${plat}" != x'all' ] && plat="${OPK_HOST_PLAT}" build_opk "${pkg}" "${OPK_BINARY_VERSION}" \ - "${arch}" "${plat}" + "${arch}" "${plat}" "${date}" done fi rm 'debian-binary' -- cgit v0.9.1