[med-svn] r17879 - trunk/packages/arb/trunk/debian/patches
Elmar Pruesse
epruesse-guest at moszumanska.debian.org
Thu Aug 28 17:12:24 UTC 2014
Author: epruesse-guest
Date: 2014-08-28 17:12:23 +0000 (Thu, 28 Aug 2014)
New Revision: 17879
Added:
trunk/packages/arb/trunk/debian/patches/10_upstream_r12793__show_db_load_progress
Removed:
trunk/packages/arb/trunk/debian/patches/21_Makefiles.patch
trunk/packages/arb/trunk/debian/patches/70_hardening.patch
Modified:
trunk/packages/arb/trunk/debian/patches/series
Log:
backport "show progress while opening database" patch from upstream
Added: trunk/packages/arb/trunk/debian/patches/10_upstream_r12793__show_db_load_progress
===================================================================
--- trunk/packages/arb/trunk/debian/patches/10_upstream_r12793__show_db_load_progress (rev 0)
+++ trunk/packages/arb/trunk/debian/patches/10_upstream_r12793__show_db_load_progress 2014-08-28 17:12:23 UTC (rev 17879)
@@ -0,0 +1,119 @@
+Index: trunk/ARBDB/ad_load.cxx
+===================================================================
+--- trunk/ARBDB/ad_load.cxx (revision 12438)
++++ trunk/ARBDB/ad_load.cxx (revision 12793)
+@@ -18,4 +18,5 @@
+ #include <arb_file.h>
+ #include <arb_defs.h>
++#include <arb_progress.h>
+
+ #include "gb_key.h"
+@@ -656,9 +657,15 @@
+ // ----------------------------------------
+
+-
+-static long gb_read_bin_rek_V2(FILE *in, GBCONTAINER *gbc_dest, long nitems, long version, long reversed, long deep) {
++static long gb_read_bin_rek_V2(FILE *in, GBCONTAINER *gbc_dest, long nitems, long version,
++ long reversed, long deep, arb_progress& progress) {
+ GB_MAIN_TYPE *Main = GB_MAIN(gbc_dest);
+
+ DEBUG_DUMP_INDENTED(deep, GBS_global_string("Reading container with %li items", nitems));
++
++ progress.inc_to(ftell(in));
++ if (progress.aborted()) {
++ GB_export_error(progress.error_if_aborted());
++ return -1;
++ }
+
+ gb_create_header_array(gbc_dest, (int)nitems);
+@@ -672,4 +679,5 @@
+
+ for (long item = 0; item<nitems; item++) {
++ progress.inc();
+ long type = getc(in);
+ DEBUG_DUMP_INDENTED(deep, GBS_global_string("Item #%li/%li type=%02lx (filepos=%08lx)", item+1, nitems, type, ftell(in)-1));
+@@ -850,5 +858,5 @@
+ long size = gb_get_number(in);
+ // gbc->d.size is automatically incremented
+- if (gb_read_bin_rek_V2(in, gbc, size, version, reversed, deep+1)) {
++ if (gb_read_bin_rek_V2(in, gbc, size, version, reversed, deep+1, progress)) {
+ if (!GBCONTAINER_MAIN(gbc_dest)->allow_corrupt_file_recovery) {
+ return -1;
+@@ -923,5 +931,5 @@
+ }
+
+-static long gb_read_bin(FILE *in, GBCONTAINER *gbc, bool allowed_to_load_diff) {
++static long gb_read_bin(FILE *in, GBCONTAINER *gbc, bool allowed_to_load_diff, arb_progress& progress) {
+ int c = 1;
+ long i;
+@@ -1154,5 +1162,5 @@
+ // fall-through
+ case 1: // master arb file
+- error = gb_read_bin_rek_V2(in, gbc, nodecnt, version, reversed, 0);
++ error = gb_read_bin_rek_V2(in, gbc, nodecnt, version, reversed, 0, progress);
+ break;
+ default:
+@@ -1446,5 +1454,8 @@
+
+ if (is_binary_db_id(i)) {
+- i = gb_read_bin(input, gbc, false); // read or map whole db
++ {
++ arb_progress progress("Loading database", GB_size_of_FILE(input));
++ i = gb_read_bin(input, gbc, false, progress); // read or map whole db
++ }
+ gbc = Main->root_container;
+ fclose(input);
+@@ -1487,5 +1498,8 @@
+ i = gb_read_in_uint32(input, 0);
+ if (is_binary_db_id(i)) {
+- err = gb_read_bin(input, gbc, true);
++ {
++ arb_progress progress("Loading quicksave", GB_size_of_FILE(input) / 1024);
++ err = gb_read_bin(input, gbc, true, progress);
++ }
+ fclose (input);
+
+Index: trunk/CORE/arb_progress.cxx
+===================================================================
+--- trunk/CORE/arb_progress.cxx (revision 11401)
++++ trunk/CORE/arb_progress.cxx (revision 12792)
+@@ -23,4 +23,5 @@
+ void inc() OVERRIDE {}
+ void implicit_inc() OVERRIDE {}
++ void inc_to(int x) OVERRIDE {}
+ void done() OVERRIDE {}
+ void restart(int) OVERRIDE {}
+@@ -143,4 +144,11 @@
+ void inc() OVERRIDE { explicit_counter += 1; update_display_if_needed(); }
+ void implicit_inc() OVERRIDE { implicit_counter += 1; update_display_if_needed(); }
++ void inc_to(int x) {
++ explicit_counter = std::max(explicit_counter, x);
++ if (maxcount) {
++ explicit_counter = std::min(explicit_counter, maxcount);
++ }
++ update_display_if_needed();
++ }
+
+ void done() OVERRIDE {
+Index: trunk/CORE/arb_progress.h
+===================================================================
+--- trunk/CORE/arb_progress.h (revision 12147)
++++ trunk/CORE/arb_progress.h (revision 12792)
+@@ -45,4 +45,5 @@
+ virtual void inc() = 0;
+ virtual void implicit_inc() = 0;
++ virtual void inc_to(int x) = 0;
+ virtual void child_updates_gauge(double gauge) = 0;
+ virtual void done() = 0;
+@@ -132,4 +133,5 @@
+
+ void inc() { counter->inc(); }
++ void inc_to(int x) { counter->inc_to(x); }
+ void done() { counter->done(); }
+ void auto_subtitles(const char *prefix) { counter->auto_subtitles(prefix); }
+@@ -245,4 +247,5 @@
+
+ void inc_by(int count) { arb_assert(count>0); while (count--) inc(); }
++ void inc_to(int x) { used->inc_to(x); }
+
+ void sub_progress_skipped() { used->child_terminated(); }
Deleted: trunk/packages/arb/trunk/debian/patches/21_Makefiles.patch
===================================================================
--- trunk/packages/arb/trunk/debian/patches/21_Makefiles.patch 2014-08-28 14:00:31 UTC (rev 17878)
+++ trunk/packages/arb/trunk/debian/patches/21_Makefiles.patch 2014-08-28 17:12:23 UTC (rev 17879)
@@ -1,59 +0,0 @@
-Author: Andreas Tille <tille at debian.org>
-Last-Update: Mon, 28 Jul 2014 15:06:57 +0200
-Description: Fix various clean targets
-
---- a/NAMES_COM/Makefile
-+++ b/NAMES_COM/Makefile
-@@ -20,7 +20,7 @@ AISC_COMPILER=../AISC/aisc
- AISC_PROTOTYPER=../AISC_MKPTPS/aisc_mkpt
- AISC_DEPENDS = $(wildcard AISC/*.pa) $(AISC_COMPILER) $(AISC_PROTOTYPER)
-
--include AISC/export2sub
-+include $(ARBHOME)/AISC_COM/AISC/export2sub
-
- $(MAIN): server.a
-
-@@ -33,7 +33,7 @@ depends:
-
- clean:
- @rm -f .depends
-- @$(MAKE) -r -f AISC/Makefile clean
-+ @$(MAKE) -r -f ../AISC/Makefile clean
-
- # DO NOT DELETE
-
---- a/PROBE_COM/Makefile
-+++ b/PROBE_COM/Makefile
-@@ -20,7 +20,7 @@ AISC_COMPILER=../AISC/aisc
- AISC_PROTOTYPER=../AISC_MKPTPS/aisc_mkpt
- AISC_DEPENDS = $(wildcard AISC/*.pa) $(AISC_COMPILER) $(AISC_PROTOTYPER)
-
--include AISC/export2sub
-+include $(ARBHOME)/AISC_COM/AISC/export2sub
-
- $(MAIN): server.a
-
-@@ -33,7 +33,7 @@ depends:
-
- clean:
- @rm -f .depends
-- @$(MAKE) -r -f AISC/Makefile clean
-+ @$(MAKE) -r -f ../AISC/Makefile clean
-
- # DO NOT DELETE
-
---- a/GDEHELP/Makefile.helpfiles
-+++ b/GDEHELP/Makefile.helpfiles
-@@ -2,9 +2,9 @@
-
- .SUFFIXES: .doc .help .html
-
--# GENHELPDEST, GENDOCDEST and HELPFILELIST are passed from 'Makefile'
-+# GENHELPDEST, GENDOCDEST and HELP_NAMES are passed from 'Makefile'
-
--HELP_NAMES=$(shell cat $(HELPFILELIST))
-+# HELP_NAMES=$(shell cat $(HELPFILELIST))
- HELP_TARGETS=$(addprefix $(GENHELPDEST)/,$(HELP_NAMES))
- HELP_PLAIN=./HELP_PLAIN
- HELP_WRITTEN=./HELP_WRITTEN
-
Deleted: trunk/packages/arb/trunk/debian/patches/70_hardening.patch
===================================================================
--- trunk/packages/arb/trunk/debian/patches/70_hardening.patch 2014-08-28 14:00:31 UTC (rev 17878)
+++ trunk/packages/arb/trunk/debian/patches/70_hardening.patch 2014-08-28 17:12:23 UTC (rev 17879)
@@ -1,15 +0,0 @@
-Author: Andreas Tille <tille at debian.org>
-Last-Update: Wed, 04 Dec 2013 09:24:14 +0100
-Description: Propagate hardening options
-
---- a/Makefile
-+++ b/Makefile
-@@ -197,7 +197,7 @@ endif
-
- ifeq ($(DEBIAN),1)
- lflags += -rpath=/usr/lib/arb/lib -z relro
-- clflags += -Wl,-rpath=/usr/lib/arb/lib -Wl,-z,relro
-+ clflags += -Wl,-rpath=/usr/lib/arb/lib $(LDFLAGS)
- endif
-
- ifeq ($(DEBUG),1)
Modified: trunk/packages/arb/trunk/debian/patches/series
===================================================================
--- trunk/packages/arb/trunk/debian/patches/series 2014-08-28 14:00:31 UTC (rev 17878)
+++ trunk/packages/arb/trunk/debian/patches/series 2014-08-28 17:12:23 UTC (rev 17879)
@@ -0,0 +1 @@
+10_upstream_r12793__show_db_load_progress
More information about the debian-med-commit
mailing list