Andreas Tille pushed to branch master at Debian Med / tree-puzzle


Commits:
ce33255d by Andreas Tille at 2020-05-15T13:12:32+02:00
Make the build reproducible

- - - - -
a7dc83f7 by Andreas Tille at 2020-05-15T13:14:49+02:00
Upload to unstable

- - - - -


3 changed files:

- debian/changelog
- + debian/patches/reproducible-build.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+tree-puzzle (5.3~rc16+dfsg-2) unstable; urgency=medium
+
+  [ Chris Lamb ]
+  * Make the build reproducible
+    Closes: #960667
+
+ -- Andreas Tille <[email protected]>  Fri, 15 May 2020 13:12:41 +0200
+
 tree-puzzle (5.3~rc16+dfsg-1) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/patches/reproducible-build.patch
=====================================
@@ -0,0 +1,89 @@
+Description: Make the build reproducible
+Author: Chris Lamb <[email protected]>
+Last-Update: 2020-05-15
+Bug-Debian: https://bugs.debian.org/960667
+
+--- tree-puzzle-5.3~rc16+dfsg.orig/src/puzzle1.c
++++ tree-puzzle-5.3~rc16+dfsg/src/puzzle1.c
+@@ -3204,7 +3204,9 @@ void initeps(FILE *ofp)
+               fprintf(ofp, "%%%%Creator: %s (version %s%s)\n", PACKAGE, 
VERSION, ALPHA);
+ #     endif
+       fprintf(ofp, "%%%%Title: Likelihood Mapping Analysis\n");
+-      fprintf(ofp, "%%%%CreationDate: %s", asctime(localtime(&Starttime)) );
++      if (getenv("SOURCE_DATE_EPOCH") == NULL) {
++              fprintf(ofp, "%%%%CreationDate: %s", 
asctime(localtime(&Starttime)) );
++      }
+       fprintf(ofp, "%%%%DocumentFonts: Helvetica\n");
+       fprintf(ofp, "%%%%DocumentNeededFonts: Helvetica\n");
+       fprintf(ofp, "%%%%EndComments\n");
+@@ -3826,6 +3828,10 @@ void timestamp(FILE* ofp)
+       timespan = difftime(Stoptime, Starttime);
+       cpuspan  = ((double) (Stopcpu - Startcpu) / CLOCKS_PER_SEC);
+       fprintf(ofp, "\n\nTIME STAMP\n\n");
++      if (getenv("SOURCE_DATE_EPOCH") != NULL) {
++              fprintf(ofp, "Date and time: (reproducible build)");
++              return;
++      }
+       fprintf(ofp, "Date and time: %s", asctime(localtime(&Starttime)) );
+       fprintf(ofp, "Runtime (excl. input) : %.0f seconds (= %.1f minutes = 
%.1f hours)\n",
+               timespan, timespan/60., timespan/3600.);
+@@ -8924,33 +8930,35 @@ fprintf(stderr, "PPP1: %d (%s:%d)\n", PP
+               fprintftimespan(stdout, PStepStoptime, Stoptime, Starttime, 
"Pstep -> end");
+ #     endif /* DEBUG_PRINTTIMES */
+ 
+-      /* runtime message */
+-      fprintf(STDOUT,
+-              "The parameter estimation took %.2f seconds (= %.2f minutes = 
%.2f hours)\n",
+-                      difftime(PEstStoptime, PEstStarttime), 
difftime(PEstStoptime, PEstStarttime)/60.,
+-                      difftime(PEstStoptime, PEstStarttime)/3600.);
+-      if (puzzlemode == QUARTPUZ && typ_optn == TREERECON_OPTN) {
++      if (getenv("SOURCE_DATE_EPOCH") == NULL) {
++              /* runtime message */
+               fprintf(STDOUT,
+-                      "The ML step took              %.2f seconds (= %.2f 
minutes = %.2f hours)\n",
+-                              difftime(MLstepStoptime, MLstepStarttime), 
difftime(MLstepStoptime, MLstepStarttime)/60.,
+-                              difftime(MLstepStoptime, 
MLstepStarttime)/3600.);
+-              fprintf(STDOUT,
+-                      "The puzzling step took        %.2f seconds (= %.2f 
minutes = %.2f hours)\n",
+-                              difftime(PStepStoptime, PStepStarttime), 
difftime(PStepStoptime, PStepStarttime)/60.,
+-                              difftime(PStepStoptime, PStepStarttime)/3600.);
+-      }
+-      fprintf(STDOUT, 
+-              "The computation took %.2f seconds (= %.2f minutes = %.2f 
hours)\n",
+-                      difftime(Stoptime, Starttime), difftime(Stoptime, 
Starttime)/60.,
+-                      difftime(Stoptime, Starttime)/3600.);
+-      fprintf(STDOUT, 
+-              "     including input %.2f seconds (= %.2f minutes = %.2f 
hours)\n",
+-                      fulltime, fulltime/60., fulltime/3600.);
++                      "The parameter estimation took %.2f seconds (= %.2f 
minutes = %.2f hours)\n",
++                              difftime(PEstStoptime, PEstStarttime), 
difftime(PEstStoptime, PEstStarttime)/60.,
++                              difftime(PEstStoptime, PEstStarttime)/3600.);
++              if (puzzlemode == QUARTPUZ && typ_optn == TREERECON_OPTN) {
++                      fprintf(STDOUT,
++                              "The ML step took              %.2f seconds (= 
%.2f minutes = %.2f hours)\n",
++                                      difftime(MLstepStoptime, 
MLstepStarttime), difftime(MLstepStoptime, MLstepStarttime)/60.,
++                                      difftime(MLstepStoptime, 
MLstepStarttime)/3600.);
++                      fprintf(STDOUT,
++                              "The puzzling step took        %.2f seconds (= 
%.2f minutes = %.2f hours)\n",
++                                      difftime(PStepStoptime, 
PStepStarttime), difftime(PStepStoptime, PStepStarttime)/60.,
++                                      difftime(PStepStoptime, 
PStepStarttime)/3600.);
++              }
++              fprintf(STDOUT, 
++                      "The computation took %.2f seconds (= %.2f minutes = 
%.2f hours)\n",
++                              difftime(Stoptime, Starttime), 
difftime(Stoptime, Starttime)/60.,
++                              difftime(Stoptime, Starttime)/3600.);
++              fprintf(STDOUT, 
++                      "     including input %.2f seconds (= %.2f minutes = 
%.2f hours)\n",
++                              fulltime, fulltime/60., fulltime/3600.);
+ #ifdef TIMEDEBUG
+-      fprintf(STDOUT, 
+-              "and %.0f seconds CPU time (= %.2f minutes = %.2f hours)\n\n",
+-                      fullcpu, fullcpu/60., fullcpu/3600.);
++              fprintf(STDOUT, 
++                      "and %.0f seconds CPU time (= %.2f minutes = %.2f 
hours)\n\n",
++                              fullcpu, fullcpu/60., fullcpu/3600.);
+ #endif /* TIMEDEBUG */
++      }
+ 
+       /* free memory */
+       memcleanup();


=====================================
debian/patches/series
=====================================
@@ -3,3 +3,4 @@ tests-need-bash.patch
 spelling.patch
 fix-mpi3-build.patch
 update_test_results.patch
+reproducible-build.patch



View it on GitLab: 
https://salsa.debian.org/med-team/tree-puzzle/-/compare/266d74687a5137ee1501a02ca8bfaea2a68b7505...a7dc83f7de9aa10927fd79347f4350f05d90b19a

-- 
View it on GitLab: 
https://salsa.debian.org/med-team/tree-puzzle/-/compare/266d74687a5137ee1501a02ca8bfaea2a68b7505...a7dc83f7de9aa10927fd79347f4350f05d90b19a
You're receiving this email because of your account on salsa.debian.org.


_______________________________________________
debian-med-commit mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/debian-med-commit

Reply via email to