Skip to content

Commit

Permalink
Make builds of Debian '.orig' tarballs idempotent. #42
Browse files Browse the repository at this point in the history
  • Loading branch information
mfeit-internet2 committed Apr 15, 2024
1 parent 5e403a7 commit 42c64da
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion unibuild-package/unibuild-package/unibuild-deb.make
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,18 @@ else
-# diff between the sources and "orig" tarball, which is compensated
-# for in the "build" target.
find '$(BUILD_ORIG_PACKAGE_DIR)' -name 'unibuild-packaging' -type d | xargs rm -rf
(cd $(BUILD_ORIG_DIR) && tar cf - $(SOURCE_VERSION) | gzip -n ) > $(PRODUCTS_DIR)/$(ORIG_TARBALL)
-# The extra tar arguments make the produced file idempotent.
-# See https://reproducible-builds.org/docs/archives
-# PORT: This requires GNU tar (should not be an issue since this is
-# PORT: a Debian-only operation.
(cd $(BUILD_ORIG_DIR) && tar \
--sort=name \
--mtime='GMT 1970-01-01' \
--owner=0 \
--group=0 \
--numeric-owner \
--pax-option='exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime' \
-cf - $(SOURCE_VERSION) | gzip -n ) > $(PRODUCTS_DIR)/$(ORIG_TARBALL)
endif
cp $(PRODUCTS_DIR)/$(ORIG_TARBALL) $(BUILD_UNPACK_DIR)/..
@printf "\nInstalling Debian build into $(BUILD_DEBIAN_DIR)..\n\n"
Expand Down

0 comments on commit 42c64da

Please sign in to comment.