| 1 | The compression utility dictzip writes the compressed file's mtime in a header
|
| 2 | of the compressed file. No command-line switch is documented to control or
|
| 3 | suppress this behavior. This makes the build of packages relying on
|
| 4 | freedict-tools such as freedict-dictionaries non-deterministic.
|
| 5 |
|
| 6 | This patch sets the mtime of the .dict file to be compressed by dictzip to the
|
| 7 | start of the epoch on the Greenwich meridian, restoring build determinism.
|
| 8 |
|
| 9 | diff --git a/mk/dicts.mk b/mk/dicts.mk
|
| 10 | index 08e8923..e671cf3 100644
|
| 11 | |
| 12 | |
| 13 | @@ -265,7 +265,8 @@ $(BUILD_DICTD)/%.dict $(BUILD_DICTD)/%.index: $(BUILD_DICTD)/%.c5 query-dictd
|
| 14 | dictfmt --without-time -t --headword-separator %%% $(DICTFMTFLAGS) $* < $(notdir $<)
|
| 15 |
|
| 16 | $(BUILD_DICTD)/%.dict.dz: $(BUILD_DICTD)/%.dict
|
| 17 | - dictzip -k $<
|
| 18 | + touch -m -d "$$(date -u -R -d @0)" $< && \
|
| 19 | + dictzip -k $<
|
| 20 |
|
| 21 | # prevent make from removing our precious file
|
| 22 | .PRECIOUS: $(BUILD_DICTD)/$(dictname).dict
|