From 38c8a079f2fc4875c95fb907e57d521396939c82 Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Wed, 7 Apr 2010 14:11:10 +0200 Subject: [PATCH] Bugfix: MAX_PARALLEL_SECTIONS should not be None, even if not given on command line. --- Makefile | 16 +++++++++++++--- debian/changelog | 2 +- pgloader.py | 5 ++++- pgloader/options.py | 2 +- 4 files changed, 19 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 65e3da6..18e25a7 100644 --- a/Makefile +++ b/Makefile @@ -58,7 +58,7 @@ doc: man html todo bugs clean: rm -f *.xml *.html *.1 *~ -deb: +prepare-deb: # working copy from where to make the .orig archive rm -rf $(DEBDIR) mkdir -p $(DEBDIR)/pgloader-$(VERSION) @@ -72,14 +72,24 @@ deb: done # prepare the .orig without the debian/ packaging stuff - cp -a $(EXPORT) $(DEBDIR) + rsync -Ca $(EXPORT) $(DEBDIR) rm -rf $(DEBDIR)/pgloader-$(VERSION)/debian (cd $(DEBDIR) && tar czf $(ORIG) pgloader-$(VERSION)) # have a copy of the $ORIG file named $ARCHIVE for non-debian packagers cp $(ORIG) $(ARCHIVE) - # build the debian package and copy them to .. +debuild: (cd $(EXPORT) && debuild) + +debuild-unsign: + (cd $(EXPORT) && debuild -us -uc) + +copy-package: cp -a $(DEBDIR)/export/pgloader[_-]$(VERSION)* .. cp -a $(ARCHIVE) .. + +deb: prepare-deb debuild copy-package + +deb-unsign: prepare-deb debuild-unsign copy-package + diff --git a/debian/changelog b/debian/changelog index 370d57f..2de05e1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -pgloader (2.3.3~dev1-1) unstable; urgency=low +pgloader (2.3.3~dev2-1) unstable; urgency=low * Implement -f --field-sep to overwrite the default from command line * Add support for filename arguments, which use defaults diff --git a/pgloader.py b/pgloader.py index 8edadb6..85d2bcc 100755 --- a/pgloader.py +++ b/pgloader.py @@ -214,6 +214,10 @@ def parse_options(): pgloader.options.SECTION_THREADS = opts.section_threads pgloader.options.MAX_PARALLEL_SECTIONS = opts.parallel + if pgloader.options.MAX_PARALLEL_SECTIONS is None: + from pgloader.options import DEFAULT_MAX_PARALLEL_SECTIONS + pgloader.options.MAX_PARALLEL_SECTIONS = DEFAULT_MAX_PARALLEL_SECTIONS + pgloader.options.INPUT_ENCODING = opts.encoding if opts.reformat_path: @@ -701,7 +705,6 @@ if __name__ == "__main__": ret = load_data() except Exception, e: from pgloader.options import DEBUG - print DEBUG if DEBUG: raise sys.stderr.write(str(e) + '\n') diff --git a/pgloader/options.py b/pgloader/options.py index 5db0956..3373cfc 100644 --- a/pgloader/options.py +++ b/pgloader/options.py @@ -2,7 +2,7 @@ # # Some common options, for each module to get them -PGLOADER_VERSION = '2.3.3~dev1' +PGLOADER_VERSION = '2.3.3~dev2' PSYCOPG_VERSION = None