[imview] 01/02: Do not set build time in menu.

Anton Gladky gladk at moszumanska.debian.org
Tue Apr 12 18:32:16 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 a20577a4e71926402617b3456014fcd2bcf3890c
Author: Anton Gladky <gladk at debian.org>
Date:   Tue Apr 12 20:30:23 2016 +0200

    Do not set build time in menu.
---
 debian/patches/09_fixdatetime.patch | 70 +++++--------------------------------
 1 file changed, 8 insertions(+), 62 deletions(-)

diff --git a/debian/patches/09_fixdatetime.patch b/debian/patches/09_fixdatetime.patch
index 0a03beb..54b26e1 100644
--- a/debian/patches/09_fixdatetime.patch
+++ b/debian/patches/09_fixdatetime.patch
@@ -1,68 +1,16 @@
-Description: Use SOURCE_DATE_EPOCH for the build date
+Description: Do not set build time in menu
 Author: Anton Gladky <gladk at debian.org>
-Last-Update: 2016-04-10
+Last-Update: 2016-04-12
 
-Index: imview-1.1.9c/menucb.cxx
+Index: imview/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 *)
+--- imview.orig/menucb.cxx
++++ imview/menucb.cxx
+@@ -951,15 +951,12 @@ 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",
@@ -70,9 +18,7 @@ Index: imview-1.1.9c/menucb.cxx
  	    totalbnb,
  	    systemName(),
 -	    __DATE__,
-+	    build_time->tm_year + 1900,
-+	    build_time->tm_mon + 1,
-+	    build_time->tm_mday,
- 	    builder,
+-	    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