summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2014-09-30 15:32:08 +0200
committerJulian Andres Klode <jak@debian.org>2014-09-30 15:33:55 +0200
commit515204913c9168e8db77c96fdd7c29feba5bb6f4 (patch)
tree41b02f720856aad7346d4db0f71f3159977a3d59 /python
parent43f539bd0cd3d8fc00c865d1b7e818e0b77119be (diff)
downloadpython-apt-515204913c9168e8db77c96fdd7c29feba5bb6f4.tar.gz
Embed changelog entry date and time instead of build date and time
This makes reproducible builds possible. For non-package builds, simply use the start of the Unix time. Also make sure that all time values are in the UTC timezone. Closes: #762674
Diffstat (limited to 'python')
-rw-r--r--python/apt_pkgmodule.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/python/apt_pkgmodule.cc b/python/apt_pkgmodule.cc
index 5f211b3e..ca20ef18 100644
--- a/python/apt_pkgmodule.cc
+++ b/python/apt_pkgmodule.cc
@@ -880,8 +880,13 @@ extern "C" void initapt_pkg()
// Version..
PyModule_AddStringConstant(Module,"VERSION",(char *)pkgVersion);
PyModule_AddStringConstant(Module,"LIB_VERSION",(char *)pkgLibVersion);
- PyModule_AddStringConstant(Module,"DATE",__DATE__);
- PyModule_AddStringConstant(Module,"TIME",__TIME__);
+#ifdef DATE
+ PyModule_AddStringConstant(Module,"DATE",DATE);
+ PyModule_AddStringConstant(Module,"TIME",TIME);
+#else
+ PyModule_AddStringConstant(Module,"DATE", "Jan 1 1970");
+ PyModule_AddStringConstant(Module,"TIME", "00:00:00");
+#endif
// My constants
PyModule_AddIntConstant(Module,"PRI_IMPORTANT",pkgCache::State::Important);