[GRASS-SVN] r69215 - in grass/branches/releasebranch_7_2: gui/wxpython/tools include/Make lib/db/dbmi_base lib/proj

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Aug 22 14:36:16 PDT 2016


Author: martinl
Date: 2016-08-22 14:36:16 -0700 (Mon, 22 Aug 2016)
New Revision: 69215

Modified:
   grass/branches/releasebranch_7_2/gui/wxpython/tools/build_modules_xml.py
   grass/branches/releasebranch_7_2/include/Make/Vars.make
   grass/branches/releasebranch_7_2/lib/db/dbmi_base/dbmscap.c
   grass/branches/releasebranch_7_2/lib/proj/Makefile
Log:
Patches to make the build reproducible (fileordering, randomness)
Patches applied: 01-sort-build-modules-list.patch, 02-sort-dbmscap.patch, 03-sort-obj-files.patch, 05-binary-nad-install.patch
To be solved: 04-srand48_auto-from-SOURCE_DATE_EPOCH.patch
(see #3042)


Modified: grass/branches/releasebranch_7_2/gui/wxpython/tools/build_modules_xml.py
===================================================================
--- grass/branches/releasebranch_7_2/gui/wxpython/tools/build_modules_xml.py	2016-08-22 21:34:34 UTC (rev 69214)
+++ grass/branches/releasebranch_7_2/gui/wxpython/tools/build_modules_xml.py	2016-08-22 21:36:16 UTC (rev 69215)
@@ -51,7 +51,7 @@
     # TODO: what about ms windows? does gtask handle this?
     mlist = list(gcore.get_commands()[0])
     indent = 4
-    for m in mlist:
+    for m in sorted(mlist):
         # TODO: get rid of g.mapsets_picker.py
         if m == 'g.mapsets_picker.py' or m == 'g.parser':
             continue

Modified: grass/branches/releasebranch_7_2/include/Make/Vars.make
===================================================================
--- grass/branches/releasebranch_7_2/include/Make/Vars.make	2016-08-22 21:34:34 UTC (rev 69214)
+++ grass/branches/releasebranch_7_2/include/Make/Vars.make	2016-08-22 21:36:16 UTC (rev 69215)
@@ -13,10 +13,10 @@
 YACC_SOURCES := $(wildcard *.y)
 
 AUTO_OBJS := \
-	$(subst .c,.o,$(C_SOURCES)) \
-	$(subst .cpp,.o,$(CPP_SOURCES)) \
-	$(subst .l,.yy.o,$(LEX_SOURCES)) \
-	$(subst .y,.tab.o,$(YACC_SOURCES))
+	$(sort $(subst .c,.o,$(C_SOURCES))) \
+	$(sort $(subst .cpp,.o,$(CPP_SOURCES))) \
+	$(sort $(subst .l,.yy.o,$(LEX_SOURCES))) \
+	$(sort $(subst .y,.tab.o,$(YACC_SOURCES)))
 
 ifndef MOD_OBJS
 MOD_OBJS = $(AUTO_OBJS)

Modified: grass/branches/releasebranch_7_2/lib/db/dbmi_base/dbmscap.c
===================================================================
--- grass/branches/releasebranch_7_2/lib/db/dbmi_base/dbmscap.c	2016-08-22 21:34:34 UTC (rev 69214)
+++ grass/branches/releasebranch_7_2/lib/db/dbmi_base/dbmscap.c	2016-08-22 21:36:16 UTC (rev 69215)
@@ -209,19 +209,22 @@
     return list;
 }
 
+static int cmp_entry(dbDbmscap *a, dbDbmscap *b) {
+  return( a->driverName && b->driverName ? strcmp(a->driverName,b->driverName) : 0 );
+}
+
 static void add_entry(dbDbmscap ** list, char *name, char *startup, char *comment)
 {
+    /* add an entry to the list, so that the list remains ordered (by driverName) */
+
     dbDbmscap *head, *cur, *tail;
 
-    /* add this entry to the head of a linked list */
-    tail = head = *list;
-    while (tail && tail->next)
-	tail = tail->next;
-    *list = NULL;
-
     cur = (dbDbmscap *) db_malloc(sizeof(dbDbmscap));
-    if (cur == NULL)
-	return;			/* out of memory */
+    if (cur == NULL) {
+        *list = NULL;
+	return;
+        /* out of memory */
+    }
     cur->next = NULL;
 
     /* copy each item to the dbmscap structure */
@@ -229,11 +232,21 @@
     strcpy(cur->startup, startup);
     strcpy(cur->comment, comment);
 
+    /* find the last entry that is less than cur */
+    tail = head = *list;
+    while (tail && tail->next && cmp_entry(tail->next,cur)<0)
+	tail = tail->next;
+
     /* handle the first call (head == NULL) */
-    if (tail)
-	tail->next = cur;
-    else
-	head = cur;
+    if (tail && cmp_entry(tail,cur)<0) {
+        /* insert right after tail */
+        cur->next = tail->next;
+        tail->next = cur;
+    } else {
+        /* insert at first position */
+        cur->next = head;
+        head = cur;
+    }
 
     *list = head;
 }

Modified: grass/branches/releasebranch_7_2/lib/proj/Makefile
===================================================================
--- grass/branches/releasebranch_7_2/lib/proj/Makefile	2016-08-22 21:34:34 UTC (rev 69214)
+++ grass/branches/releasebranch_7_2/lib/proj/Makefile	2016-08-22 21:36:16 UTC (rev 69215)
@@ -37,7 +37,7 @@
 	$(INSTALL) $< $@
 endif
 
-$(NAD_DSTFILES): $(NAD_DIR)/%: $(NAD_BINFILES) | $(NAD_DIR)
+$(NAD_DSTFILES): $(NAD_DIR)/%: $(OBJDIR)/% | $(NAD_DIR)
 	$(INSTALL_DATA) $< $@
 
 $(NAD_BINFILES): $(OBJDIR)/%: %.lla



More information about the grass-commit mailing list