[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#785298: jessie-pu: package osmosis/0.43.1-3



On 05/23/2015 11:07 AM, Adam D. Barratt wrote:
> On Thu, 2015-05-14 at 14:48 +0200, Bas Couwenberg wrote:
>> The osmosis version in jessie has an important bug causing the
>> --database-dump operation to fail. (#785257)
>>
>> I've included a patch for the upstream change fixing the
>> ClassCastException, which I'd like to get into jessie.
> 
> I may be missing something, but what are these parts of the diff for?
> 
> + gradle.properties                                  | 23 +++++++++++-----------

This change bumped the dependency versions, but this is irrelevant for
Debian 03-local-dependencies.patch already sets these versions to the
'debian' for the packaged versions of these dependencies.

The gradle.properties changes was never part of the patch in the debian
package (only in upstream git) despite the slightly misleading diffstat.

> + osmosis-apidb/build.gradle                         |  2 +-
> + osmosis-hstore-jdbc/build.gradle                   |  2 +-
> + osmosis-pgsimple/build.gradle                      |  2 +-
> + osmosis-pgsnapshot/build.gradle                    |  2 +-

The compile group renames in the build.gradle files are not required to
fix the bug, most likely because gradle doesn't have to download the
build dependencies for the Debian package build. I've excluded these
changes from the updated patch, see the attached debdiff.

> + .../org/postgresql/driverconfig.properties         |  1 -

This change goes hand in hand with the the .java file changes. It maps
the hstore postgres data type to Osmosis HStore class which turn it into
a Java HashMap.

> More specifically, are they required in order to fix the bug?

The updated debdiff should now only contain the fixes required for the bug.

Kind Regards,

Bas

-- 
 GPG Key ID: 4096R/6750F10AE88D4AF1
Fingerprint: 8182 DE41 7056 408D 6146  50D1 6750 F10A E88D 4AF1
diff -Nru osmosis-0.43.1/debian/changelog osmosis-0.43.1/debian/changelog
--- osmosis-0.43.1/debian/changelog	2015-03-05 09:13:45.000000000 +0100
+++ osmosis-0.43.1/debian/changelog	2015-05-23 13:16:25.000000000 +0200
@@ -1,3 +1,11 @@
+osmosis (0.43.1-3+deb8u1) stable-proposed-updates; urgency=medium
+
+  * Add patch from upstream to fix java.lang.ClassCastException for
+    java.util.HashMap to org.openstreetmap.osmosis.hstore.PGHStore.
+    (closes: #785257)
+
+ -- Bas Couwenberg <sebastic@debian.org>  Thu, 14 May 2015 14:07:55 +0200
+
 osmosis (0.43.1-3) unstable; urgency=medium
 
   * Update 02-fix_plexus.patch to also load Xerces to fix data corruption.
diff -Nru osmosis-0.43.1/debian/patches/0001-Update-build-to-newest-versions-of-dependent-librari.patch osmosis-0.43.1/debian/patches/0001-Update-build-to-newest-versions-of-dependent-librari.patch
--- osmosis-0.43.1/debian/patches/0001-Update-build-to-newest-versions-of-dependent-librari.patch	1970-01-01 01:00:00.000000000 +0100
+++ osmosis-0.43.1/debian/patches/0001-Update-build-to-newest-versions-of-dependent-librari.patch	2015-05-23 13:28:01.000000000 +0200
@@ -0,0 +1,96 @@
+From 240d95b79cdea9faed9f919a1e2024c04199c1ba Mon Sep 17 00:00:00 2001
+From: Brett Henderson <brett@bretth.com>
+Date: Tue, 30 Sep 2014 21:26:20 +1000
+Subject: Update build to newest versions of dependent libraries
+Origin: https://github.com/openstreetmap/osmosis/commit/240d95b79cdea9faed9f919a1e2024c04199c1ba
+
+---
+ gradle.properties                                  | 23 +++++++++++-----------
+ osmosis-apidb/build.gradle                         |  2 +-
+ osmosis-hstore-jdbc/build.gradle                   |  2 +-
+ .../org/postgresql/driverconfig.properties         |  1 -
+ osmosis-pgsimple/build.gradle                      |  2 +-
+ osmosis-pgsnapshot/build.gradle                    |  2 +-
+ .../osmosis/pgsnapshot/v0_6/impl/EntityMapper.java |  6 +++---
+ .../pgsnapshot/v0_6/impl/EntityRowMapper.java      |  7 ++++---
+ 8 files changed, 22 insertions(+), 23 deletions(-)
+ delete mode 100644 osmosis-hstore-jdbc/src/main/resources/org/postgresql/driverconfig.properties
+
+--- a/osmosis-hstore-jdbc/src/main/resources/org/postgresql/driverconfig.properties
++++ /dev/null
+@@ -1 +0,0 @@
+-datatype.hstore=org.openstreetmap.osmosis.hstore.PGHStore
+\ No newline at end of file
+--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/EntityMapper.java
++++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/EntityMapper.java
+@@ -3,12 +3,12 @@ package org.openstreetmap.osmosis.pgsnap
+ 
+ import java.sql.Timestamp;
+ import java.util.Arrays;
++import java.util.HashMap;
+ import java.util.Map;
+ 
+ import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
+ import org.openstreetmap.osmosis.core.domain.v0_6.Entity;
+ import org.openstreetmap.osmosis.core.domain.v0_6.Tag;
+-import org.openstreetmap.osmosis.hstore.PGHStore;
+ import org.springframework.jdbc.core.RowMapper;
+ 
+ 
+@@ -226,7 +226,7 @@ public abstract class EntityMapper<T ext
+ 	 *            The entity containing the data to be inserted.
+ 	 */
+ 	protected void populateCommonEntityParameters(Map<String, Object> args, Entity entity) {
+-		PGHStore tags;
++		Map<String, String> tags;
+ 		
+ 		// We can't write an entity with a null timestamp.
+ 		if (entity.getTimestamp() == null) {
+@@ -234,7 +234,7 @@ public abstract class EntityMapper<T ext
+ 					"Entity(" + entity.getType() + ") " + entity.getId() + " does not have a timestamp set.");
+ 		}
+ 		
+-		tags = new PGHStore();
++		tags = new HashMap<String, String>(entity.getTags().size());
+ 		for (Tag tag : entity.getTags()) {
+ 			tags.put(tag.getKey(), tag.getValue());
+ 		}
+--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/EntityRowMapper.java
++++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/EntityRowMapper.java
+@@ -5,6 +5,7 @@ import java.sql.ResultSet;
+ import java.sql.SQLException;
+ import java.util.Collection;
+ import java.util.Date;
++import java.util.Map;
+ import java.util.Map.Entry;
+ 
+ import org.openstreetmap.osmosis.core.OsmosisRuntimeException;
+@@ -12,7 +13,6 @@ import org.openstreetmap.osmosis.core.do
+ import org.openstreetmap.osmosis.core.domain.v0_6.Entity;
+ import org.openstreetmap.osmosis.core.domain.v0_6.OsmUser;
+ import org.openstreetmap.osmosis.core.domain.v0_6.Tag;
+-import org.openstreetmap.osmosis.hstore.PGHStore;
+ import org.springframework.jdbc.core.RowMapper;
+ 
+ 
+@@ -64,9 +64,10 @@ public abstract class EntityRowMapper<T
+ 	 *             if a database error is encountered.
+ 	 * @return The common entity data.
+ 	 */
++	@SuppressWarnings("unchecked")
+ 	protected CommonEntityData mapCommonEntityData(ResultSet rs) throws SQLException {
+ 		CommonEntityData entityData;
+-		PGHStore dbTags;
++		Map<String, String> dbTags;
+ 		Collection<Tag> tags;
+ 		
+ 		entityData = new CommonEntityData(
+@@ -77,7 +78,7 @@ public abstract class EntityRowMapper<T
+ 			rs.getLong("changeset_id")
+ 		);
+ 		
+-		dbTags = (PGHStore) rs.getObject("tags");
++		dbTags = (Map<String, String>) rs.getObject("tags");
+ 		if (dbTags != null) {
+ 			tags = entityData.getTags();
+ 			for (Entry<String, String> tagEntry : dbTags.entrySet()) {
diff -Nru osmosis-0.43.1/debian/patches/series osmosis-0.43.1/debian/patches/series
--- osmosis-0.43.1/debian/patches/series	2015-03-05 09:13:45.000000000 +0100
+++ osmosis-0.43.1/debian/patches/series	2015-05-23 13:16:25.000000000 +0200
@@ -15,3 +15,4 @@
 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
+0001-Update-build-to-newest-versions-of-dependent-librari.patch

Reply to: