[imview] 03/03: Add missing patch.
Anton Gladky
gladk at moszumanska.debian.org
Sun Apr 10 12:02:57 UTC 2016
This is an automated email from the git hooks/post-receive script.
gladk pushed a commit to branch master
in repository imview.
commit 256187d9d871a5da567dc1b87bc1c419aab9dd06
Author: Anton Gladky <gladk at debian.org>
Date: Sun Apr 10 14:02:46 2016 +0200
Add missing patch.
---
debian/patches/09_fixdatetime.patch | 78 +++++++++++++++++++++++++++++++++++++
1 file changed, 78 insertions(+)
diff --git a/debian/patches/09_fixdatetime.patch b/debian/patches/09_fixdatetime.patch
new file mode 100644
index 0000000..0a03beb
--- /dev/null
+++ b/debian/patches/09_fixdatetime.patch
@@ -0,0 +1,78 @@
+Description: Use SOURCE_DATE_EPOCH for the build date
+Author: Anton Gladky <gladk at debian.org>
+Last-Update: 2016-04-10
+
+Index: imview-1.1.9c/menucb.cxx
+===================================================================
+--- imview-1.1.9c.orig/menucb.cxx
++++ imview-1.1.9c/menucb.cxx
+@@ -87,6 +87,9 @@
+ #include "sliceSlider.hxx"
+ #include "view3d.hxx"
+
++#include <errno.h>
++#include <limits.h>
++
+ using std::map;
+
+ typedef map<string,image_psfile>::iterator mi; // Map iterator (can't be const)
+@@ -944,6 +947,40 @@ void threshold_cb(Fl_Object *, void *)
+ // who is responsible for this heap of crap?
+ void whodunit_cb(Fl_Object *, void *)
+ {
++ struct tm *build_time;
++ time_t now;
++ char *source_date_epoch;
++ unsigned long long epoch;
++ char *endptr;
++
++ source_date_epoch = getenv("SOURCE_DATE_EPOCH");
++ if (source_date_epoch) {
++ errno = 0;
++ epoch = strtoull(source_date_epoch, &endptr, 10);
++ if ((errno == ERANGE && (epoch == ULLONG_MAX || epoch == 0))
++ || (errno != 0 && epoch == 0)) {
++ fprintf(stderr, "Environment variable $SOURCE_DATE_EPOCH: strtoull: %s\n", strerror(errno));
++ exit(EXIT_FAILURE);
++ }
++ if (endptr == source_date_epoch) {
++ fprintf(stderr, "Environment variable $SOURCE_DATE_EPOCH: No digits were found: %s\n", endptr);
++ exit(EXIT_FAILURE);
++ }
++ if (*endptr != '\0') {
++ fprintf(stderr, "Environment variable $SOURCE_DATE_EPOCH: Trailing garbage: %s\n", endptr);
++ exit(EXIT_FAILURE);
++ }
++ if (epoch > ULONG_MAX) {
++ fprintf(stderr, "Environment variable $SOURCE_DATE_EPOCH: value must be smaller than or equal to: %lu but was found to be: %llu \n", ULONG_MAX, epoch);
++ exit(EXIT_FAILURE);
++ }
++ now = epoch;
++ } else {
++ now = time(NULL);
++ }
++ build_time = gmtime(&now);
++
++
+ static char buff[300], currentpath[DFLTSTRLEN];
+
+ getcwd(currentpath, DFLTSTRLEN);
+@@ -951,14 +988,16 @@ void whodunit_cb(Fl_Object *, void *)
+
+ sprintf(buff,
+ "Imview version %s build #%d for %s\n"
+- "Made on %s by %s\n"
++ "Made on %d-%d-%d by %s\n"
+ "Copyright Hugues Talbot, CMIS Image Analysis 1997-2005\n"
+ "Currentpath=%s\n"
+ "Runningpath=%s",
+ patchlevel,
+ totalbnb,
+ systemName(),
+- __DATE__,
++ build_time->tm_year + 1900,
++ build_time->tm_mon + 1,
++ build_time->tm_mday,
+ builder,
+ currentpath,
+ runningpath
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/imview.git
More information about the debian-science-commits
mailing list