summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2019-06-18 01:45:11 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2019-06-18 01:45:11 (EDT)
commit095ddffaf73046849623590d944fb3cd99318282 (patch)
tree04fecf9bf9d087ab13caca5dd3d283735d770e88
parent52e59203144ddb2864316f14695d5207d2f8de3e (diff)
ob-buildopk: Fix non-deterministic mtimes in gzip headers
-rw-r--r--NEWS2
-rw-r--r--src/ob-buildopk.sh13
2 files changed, 10 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index 790944e..b6aeaa9 100644
--- a/NEWS
+++ b/NEWS
@@ -10,7 +10,7 @@ Utilities:
* opkbuild now sets the standardized [1] "SOURCE_DATE_EPOCH"
environment variable to assist in making builds reproducible.
* ob-buildopk now strives to build reproducible opk archives.
- Specifically, archive member modification times are set to a
+ Specifically, archive and member modification times are set to a
package's changelog date, owners and groups are set to 0, and file
ordering is now deterministic. Setting modification times of
symbolic links requires a "touch" utility that accepts the non-
diff --git a/src/ob-buildopk.sh b/src/ob-buildopk.sh
index 57b3688..cea74ab 100644
--- a/src/ob-buildopk.sh
+++ b/src/ob-buildopk.sh
@@ -49,14 +49,19 @@ build_opk()
find "${binary}.control" "${binary}.data" | xargs chown -h 0:0
(cd -- "${binary}.control" && find '.' | LC_ALL=C sort | \
- ${TAR} -czf '../control.tar.gz' --no-recursion -T -)
+ ${TAR} -cf '../control.tar' --no-recursion -T -)
(cd -- "${binary}.data" && find '.' | LC_ALL=C sort | \
- ${TAR} -czf '../data.tar.gz' --no-recursion -T -)
- ${TOUCH} -d "${date}" 'control.tar.gz' 'data.tar.gz'
+ ${TAR} -cf '../data.tar' --no-recursion -T -)
+ ${TOUCH} -d "${date}" 'control.tar' 'data.tar'
+ ${GZIP} 'control.tar' 'data.tar'
- ${TAR} -czf "../../${binary}_${version}_${arch}_${plat}.opk" \
+ ${TAR} -cf "../../${binary}_${version}_${arch}_${plat}.tar" \
'debian-binary' 'control.tar.gz' 'data.tar.gz'
rm -Rf 'control.tar.gz' 'data.tar.gz'
+ ${TOUCH} -d "${date}" "../../${binary}_${version}_${arch}_${plat}.tar"
+ ${GZIP} "../../${binary}_${version}_${arch}_${plat}.tar"
+ mv "../../${binary}_${version}_${arch}_${plat}.tar.gz" \
+ "../../${binary}_${version}_${arch}_${plat}.opk"
return 0
}