[osmosis] 06/07: Add patches from upstream master branch.

Bas Couwenberg sebastic at xs4all.nl
Sat Sep 27 19:47:35 UTC 2014


This is an automated email from the git hooks/post-receive script.

sebastic-guest pushed a commit to branch master
in repository osmosis.

commit eefcbf907ad1d8c842cc49acf355c495298f39ed
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Sat Sep 27 21:25:56 2014 +0200

    Add patches from upstream master branch.
---
 debian/changelog                                   |  1 +
 ...Set-User-Agent-header-on-HTTP-connections.patch | 93 ++++++++++++++++++++
 ...ne-off-error-in-current-way-relation-load.patch | 30 +++++++
 ...0001-apidb-Support-importing-negative-ids.patch | 98 ++++++++++++++++++++++
 debian/patches/series                              |  3 +
 5 files changed, 225 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 8c9c693..12f3f99 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ osmosis (0.43.1-2) UNRELEASED; urgency=medium
 
   * Add patch to update generated source for protobuf 2.6.0.
   * Add patch to increase source compatibility from 1.6 to 1.7.
+  * Add patches from upstream master branch.
 
  -- Bas Couwenberg <sebastic at xs4all.nl>  Sat, 27 Sep 2014 20:35:14 +0200
 
diff --git a/debian/patches/0001-Set-User-Agent-header-on-HTTP-connections.patch b/debian/patches/0001-Set-User-Agent-header-on-HTTP-connections.patch
new file mode 100644
index 0000000..ce2ad7a
--- /dev/null
+++ b/debian/patches/0001-Set-User-Agent-header-on-HTTP-connections.patch
@@ -0,0 +1,93 @@
+From d18a254783158234d3fd2471ff23d427215f34dd Mon Sep 17 00:00:00 2001
+From: Matt Amos <zerebubuth at gmail.com>
+Date: Thu, 30 Jan 2014 18:17:41 +0000
+Subject: Set 'User-Agent' header on HTTP connections.
+Origin: https://github.com/openstreetmap/osmosis/commit/d18a254783158234d3fd2471ff23d427215f34dd
+
+Setting the 'User-Agent' header helps server administrators
+identify which traffic is coming from Osmosis, and helps avoid
+some disadvantages of using the plain Java identifier such as
+setting off poorly configured IDS warnings.
+
+--- a/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/common/ServerStateReader.java
++++ b/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/common/ServerStateReader.java
+@@ -16,6 +16,7 @@ import java.util.logging.Level;
+ import java.util.logging.Logger;
+ 
+ import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
++import org.openstreetmap.osmosis.core.OsmosisConstants;
+ 
+ 
+ /**
+@@ -92,6 +93,7 @@ public class ServerStateReader {
+ 			URLConnection connection = stateUrl.openConnection();
+ 			connection.setReadTimeout(15 * 60 * 1000); // timeout 15 minutes
+ 			connection.setConnectTimeout(15 * 60 * 1000); // timeout 15 minutes
++			connection.setRequestProperty("User-Agent", "Osmosis/" + OsmosisConstants.VERSION);
+ 			stateStream = connection.getInputStream();
+ 			
+ 			reader = new BufferedReader(new InputStreamReader(stateStream));
+--- a/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/BaseReplicationDownloader.java
++++ b/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/BaseReplicationDownloader.java
+@@ -18,6 +18,7 @@ import java.util.logging.Level;
+ import java.util.logging.Logger;
+ 
+ import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
++import org.openstreetmap.osmosis.core.OsmosisConstants;
+ import org.openstreetmap.osmosis.core.task.common.RunnableTask;
+ import org.openstreetmap.osmosis.core.util.FileBasedLock;
+ import org.openstreetmap.osmosis.core.util.PropertiesPersister;
+@@ -104,6 +105,7 @@ public abstract class BaseReplicationDow
+ 			URLConnection connection = changesetUrl.openConnection();
+ 			connection.setReadTimeout(15 * 60 * 1000); // timeout 15 minutes
+ 			connection.setConnectTimeout(15 * 60 * 1000); // timeout 15 minutes
++			connection.setRequestProperty("User-Agent", "Osmosis/" + OsmosisConstants.VERSION);
+ 			inputStream = connection.getInputStream();
+ 			source = new BufferedInputStream(inputStream, 65536);
+ 			
+--- a/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/IntervalDownloader.java
++++ b/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/IntervalDownloader.java
+@@ -20,6 +20,7 @@ import java.util.logging.Level;
+ import java.util.logging.Logger;
+ 
+ import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
++import org.openstreetmap.osmosis.core.OsmosisConstants;
+ import org.openstreetmap.osmosis.core.merge.common.ConflictResolutionMethod;
+ import org.openstreetmap.osmosis.core.pipeline.common.TaskRunner;
+ import org.openstreetmap.osmosis.core.task.v0_6.ChangeSink;
+@@ -111,6 +112,7 @@ public class IntervalDownloader implemen
+ 			URLConnection connection = timestampUrl.openConnection();
+ 			connection.setReadTimeout(15 * 60 * 1000); // timeout 15 minutes
+ 			connection.setConnectTimeout(15 * 60 * 1000); // timeout 15 minutes
++			connection.setRequestProperty("User-Agent", "Osmosis/" + OsmosisConstants.VERSION);
+ 			timestampStream = connection.getInputStream();
+ 			
+ 			reader = new BufferedReader(new InputStreamReader(timestampStream));
+--- a/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/XmlChangeUploader.java
++++ b/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/XmlChangeUploader.java
+@@ -122,6 +122,7 @@ public class XmlChangeUploader implement
+             System.err.println("DEBUG: URL= " + url.toString());
+             HttpURLConnection httpCon = (HttpURLConnection)
+                                       url.openConnection();
++            httpCon.setRequestProperty("User-Agent", "Osmosis/" + OsmosisConstants.VERSION);
+ 
+             // we do not use Authenticator.setDefault()
+             // here to stay thread-safe.
+--- a/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/XmlDownloader.java
++++ b/osmosis-xml/src/main/java/org/openstreetmap/osmosis/xml/v0_6/XmlDownloader.java
+@@ -19,6 +19,7 @@ import org.xml.sax.SAXException;
+ import org.xml.sax.SAXParseException;
+ 
+ import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
++import org.openstreetmap.osmosis.core.OsmosisConstants;
+ import org.openstreetmap.osmosis.core.container.v0_6.BoundContainer;
+ import org.openstreetmap.osmosis.core.domain.v0_6.Bound;
+ import org.openstreetmap.osmosis.core.task.v0_6.RunnableSource;
+@@ -235,6 +236,7 @@ public class XmlDownloader implements Ru
+         url = new URL(pUrlStr);
+         myActiveConnection = (HttpURLConnection) url.openConnection();
+ 
++        myActiveConnection.setRequestProperty("User-Agent", "Osmosis/" + OsmosisConstants.VERSION);
+         myActiveConnection.setRequestProperty("Accept-Encoding", "gzip, deflate");
+ 
+         responseCode = myActiveConnection.getResponseCode();
diff --git a/debian/patches/0001-apidb-Fix-one-off-error-in-current-way-relation-load.patch b/debian/patches/0001-apidb-Fix-one-off-error-in-current-way-relation-load.patch
new file mode 100644
index 0000000..b4fb53e
--- /dev/null
+++ b/debian/patches/0001-apidb-Fix-one-off-error-in-current-way-relation-load.patch
@@ -0,0 +1,30 @@
+From 53880f0e0dfa330bc74c767a39726061fc71143a Mon Sep 17 00:00:00 2001
+From: Brett Henderson <brett at bretth.com>
+Date: Tue, 23 Sep 2014 21:17:26 +1000
+Subject: apidb: Fix one-off error in current way/relation loading
+Origin: https://github.com/openstreetmap/osmosis/commit/53880f0e0dfa330bc74c767a39726061fc71143a
+
+The previous patch had a minor bug where the minimum way and relation
+ids being loaded into the current tables were one-off and therefore
+missing the first id to be loaded.
+
+--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbWriter.java
++++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbWriter.java
+@@ -1160,7 +1160,7 @@ public class ApidbWriter implements Sink
+             maxWayId = wayId + 1;
+         }
+         if (wayId < minWayId) {
+-          minWayId = wayId + 1;
++          minWayId = wayId;
+         }
+         wayBuffer.add(way);
+ 
+@@ -1215,7 +1215,7 @@ public class ApidbWriter implements Sink
+             maxRelationId = relationId + 1;
+         }
+         if (relationId < minRelationId) {
+-          minRelationId = relationId + 1;
++          minRelationId = relationId;
+         }
+         relationBuffer.add(relation);
+ 
diff --git a/debian/patches/0001-apidb-Support-importing-negative-ids.patch b/debian/patches/0001-apidb-Support-importing-negative-ids.patch
new file mode 100644
index 0000000..55fe999
--- /dev/null
+++ b/debian/patches/0001-apidb-Support-importing-negative-ids.patch
@@ -0,0 +1,98 @@
+From 1b49b7e04aeca0a3c0c7752ba0be3eedf1b22e40 Mon Sep 17 00:00:00 2001
+From: Greg Schmidt <gschmidtee at gmail.com>
+Date: Tue, 23 Sep 2014 21:02:38 +1000
+Subject: apidb: Support importing negative ids
+Origin: https://github.com/openstreetmap/osmosis/commit/1b49b7e04aeca0a3c0c7752ba0be3eedf1b22e40
+
+The existing codebase was assuming that all entity ids were positive.
+This patch allows ids to be positive or negative (or zero).
+
+--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbWriter.java
++++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/ApidbWriter.java
+@@ -216,8 +216,11 @@ public class ApidbWriter implements Sink
+     private final List<DbFeatureHistory<DbFeature<Tag>>> relationTagBuffer;
+     private final List<DbFeatureHistory<DbOrderedFeature<RelationMember>>> relationMemberBuffer;
+     private long maxNodeId;
++    private long minNodeId;
+     private long maxWayId;
++    private long minWayId;
+     private long maxRelationId;
++    private long minRelationId;
+     private final TileCalculator tileCalculator;
+     private final MemberTypeRenderer memberTypeRenderer;
+     private boolean initialized;
+@@ -276,9 +279,12 @@ public class ApidbWriter implements Sink
+         relationTagBuffer = new ArrayList<DbFeatureHistory<DbFeature<Tag>>>();
+         relationMemberBuffer = new ArrayList<DbFeatureHistory<DbOrderedFeature<RelationMember>>>();
+ 
+-        maxNodeId = 0;
+-        maxWayId = 0;
+-        maxRelationId = 0;
++        maxNodeId = Long.MIN_VALUE;
++        minNodeId = Long.MAX_VALUE;
++        maxWayId = Long.MIN_VALUE;
++        minWayId = Long.MAX_VALUE;
++        maxRelationId = Long.MIN_VALUE;
++        minRelationId = Long.MAX_VALUE;
+ 
+         tileCalculator = new TileCalculator();
+         memberTypeRenderer = new MemberTypeRenderer();
+@@ -917,7 +923,7 @@ public class ApidbWriter implements Sink
+     
+     private void populateCurrentNodes() {
+         // Copy data into the current node tables.
+-        for (long i = 0; i < maxNodeId; i += LOAD_CURRENT_NODE_ROW_COUNT) {
++        for (long i = minNodeId; i < maxNodeId; i += LOAD_CURRENT_NODE_ROW_COUNT) {
+             // Node
+             try {
+                 loadCurrentNodesStatement.setLong(1, i);
+@@ -946,7 +952,7 @@ public class ApidbWriter implements Sink
+     
+     
+     private void populateCurrentWays() {
+-        for (long i = 0; i < maxWayId; i += LOAD_CURRENT_WAY_ROW_COUNT) {
++        for (long i = minWayId; i < maxWayId; i += LOAD_CURRENT_WAY_ROW_COUNT) {
+             // Way
+             try {
+                 loadCurrentWaysStatement.setLong(1, i);
+@@ -986,7 +992,7 @@ public class ApidbWriter implements Sink
+     
+     
+     private void populateCurrentRelations() {
+-        for (long i = 0; i < maxRelationId; i += LOAD_CURRENT_RELATION_ROW_COUNT) {
++        for (long i = minRelationId; i < maxRelationId; i += LOAD_CURRENT_RELATION_ROW_COUNT) {
+             // Way
+             try {
+                 loadCurrentRelationsStatement.setLong(1, i);
+@@ -1115,6 +1121,9 @@ public class ApidbWriter implements Sink
+         if (nodeId >= maxNodeId) {
+             maxNodeId = nodeId + 1;
+         }
++        if (nodeId < minNodeId) {
++          minNodeId = nodeId;
++        }
+ 
+         nodeBuffer.add(node);
+ 
+@@ -1150,7 +1159,9 @@ public class ApidbWriter implements Sink
+         if (wayId >= maxWayId) {
+             maxWayId = wayId + 1;
+         }
+-
++        if (wayId < minWayId) {
++          minWayId = wayId + 1;
++        }
+         wayBuffer.add(way);
+ 
+         flushWays(false);
+@@ -1203,7 +1214,9 @@ public class ApidbWriter implements Sink
+         if (relationId >= maxRelationId) {
+             maxRelationId = relationId + 1;
+         }
+-
++        if (relationId < minRelationId) {
++          minRelationId = relationId + 1;
++        }
+         relationBuffer.add(relation);
+ 
+         flushRelations(false);
diff --git a/debian/patches/series b/debian/patches/series
index d38015f..ac571d9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -12,3 +12,6 @@
 0001-Fix-remaining-64-bit-id-tracking-problems.patch
 0001-Increase-maximum-way-node-count-from-16-bit-to-32-bi.patch
 0001-replication-Fix-null-pointer-exception-in-merge-repl.patch
+0001-Set-User-Agent-header-on-HTTP-connections.patch
+0001-apidb-Support-importing-negative-ids.patch
+0001-apidb-Fix-one-off-error-in-current-way-relation-load.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/osmosis.git



More information about the Pkg-grass-devel mailing list