This is an automated email from the git hooks/post-receive script. sebastic pushed a commit to branch master in repository osmosis.
commit c7bbb81486dcd2243024a51f78b330082aa41ded Author: Bas Couwenberg <sebas...@xs4all.nl> Date: Thu May 14 15:47:43 2015 +0200 Add patches from upstream master branch. Changes include: - db-server - way-nodes fixes - replication URL updates to match current planet.osm.org layout --- debian/changelog | 4 + debian/patches/0001-Fix-checkstyle-errors.patch | 36 +++++ ...tion-warnings-resulting-from-dependency-u.patch | 147 +++++++++++++++++++++ ...or-retrieving-way-nodes-in-pgsnapshot-mod.patch | 33 +++++ ...sageFormat-needs-an-array-not-a-bare-long.patch | 27 ++++ ...ication-urls-to-match-current-planet.osm..patch | 39 ++++++ ...build-Exclude-db-server-as-a-java-project.patch | 23 ++++ ...dd-a-readme-explaining-basic-docker-usage.patch | 25 ++++ ...dd-docker-workaround-to-allow-use-of-syml.patch | 26 ++++ ...dd-initial-db-server-docker-image-for-tes.patch | 94 +++++++++++++ ...er-Allow-remote-connections-to-the-server.patch | 20 +++ ...reate-and-configure-the-api06_test-databa.patch | 39 ++++++ ...-db-server-Eclipse-enable-the-new-project.patch | 41 ++++++ ...inor-tweaks-to-readme-to-explain-docker-d.patch | 19 +++ ...erform-full-configuration-of-the-pgosmsna.patch | 47 +++++++ ...Fix-checkstyle-errors-introduced-by-previ.patch | 23 ++++ ...Fix-query-for-retrieving-relation-members.patch | 21 +++ ...Handle-case-where-WayNodes-might-already-.patch | 28 ++++ ...t-Remove-redundant-way-node-loading-logic.patch | 45 +++++++ debian/patches/series | 18 +++ 20 files changed, 755 insertions(+) diff --git a/debian/changelog b/debian/changelog index aabdc98..b99897b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,10 @@ osmosis (0.43.1-5) UNRELEASED; urgency=medium * Add patch from upstream to fix java.lang.ClassCastException for java.util.HashMap to org.openstreetmap.osmosis.hstore.PGHStore. (closes: #785257) + * Add patches from upstream master branch, changes include: + - db-server + - way-nodes fixes + - replication URL updates to match current planet.osm.org layout -- Bas Couwenberg <sebas...@debian.org> Thu, 14 May 2015 00:10:22 +0200 diff --git a/debian/patches/0001-Fix-checkstyle-errors.patch b/debian/patches/0001-Fix-checkstyle-errors.patch new file mode 100644 index 0000000..648ecdf --- /dev/null +++ b/debian/patches/0001-Fix-checkstyle-errors.patch @@ -0,0 +1,36 @@ +From acc7f55aff11893c0521787ad3206331b1cae8ec Mon Sep 17 00:00:00 2001 +From: Jeffrey Erikson <jeffrey.erik...@digitalglobe.com> +Date: Thu, 9 Apr 2015 14:59:37 -0400 +Subject: Fix checkstyle errors +Origin: https://github.com/openstreetmap/osmosis/commit/acc7f55aff11893c0521787ad3206331b1cae8ec + +--- + .../openstreetmap/osmosis/pgsnapshot/v0_6/impl/EntityFeatureDao.java | 3 ++- + .../java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/WayDao.java | 3 +-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/EntityFeatureDao.java ++++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/EntityFeatureDao.java +@@ -51,8 +51,8 @@ public class EntityFeatureDao<Tef extend + * @return All instances of this feature type for the entity. + */ + public Collection<Tdb> getAll(long entityId) { +- return jdbcTemplate.query(entityFeatureMapper.getSqlSelect("", true, true), new Object[] {entityId}, +- entityFeatureMapper.getRowMapper()); ++ return jdbcTemplate.query(entityFeatureMapper.getSqlSelect("", true, true), ++ new Object[] {entityId}, entityFeatureMapper.getRowMapper()); + } + + +--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/WayDao.java ++++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/WayDao.java +@@ -61,8 +61,7 @@ public class WayDao extends EntityDao<Wa + + + private void loadFeatures(long entityId, Way entity) { +- if ( entity.getWayNodes().size() == 0 ) +- { ++ if (entity.getWayNodes().size() == 0) { + entity.getWayNodes().addAll(wayNodeDao.getAllRaw(entityId)); + } + } diff --git a/debian/patches/0001-Fix-deprecation-warnings-resulting-from-dependency-u.patch b/debian/patches/0001-Fix-deprecation-warnings-resulting-from-dependency-u.patch new file mode 100644 index 0000000..da05f75 --- /dev/null +++ b/debian/patches/0001-Fix-deprecation-warnings-resulting-from-dependency-u.patch @@ -0,0 +1,147 @@ +From c9782fe68b249a05530eee43e0ae75481f732832 Mon Sep 17 00:00:00 2001 +From: Brett Henderson <br...@bretth.com> +Date: Tue, 30 Sep 2014 21:44:01 +1000 +Subject: Fix deprecation warnings resulting from dependency upgrades +Origin: https://github.com/openstreetmap/osmosis/commit/c9782fe68b249a05530eee43e0ae75481f732832 + +--- + .../openstreetmap/osmosis/apidb/common/MysqlIdentityValueLoader2.java | 2 +- + .../osmosis/apidb/common/PostgresqlIdentityValueLoader2.java | 4 ++-- + .../java/org/openstreetmap/osmosis/apidb/v0_6/impl/EntityDao.java | 4 ++-- + .../org/openstreetmap/osmosis/core/bound/v0_6/BoundComputerTest.java | 3 +-- + .../org/openstreetmap/osmosis/core/bound/v0_6/BoundSetterTest.java | 3 +-- + .../osmosis/pgsnapshot/common/SchemaVersionValidator.java | 2 +- + .../org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/EntityDao.java | 2 +- + .../java/org/openstreetmap/osmosis/set/v0_6/ChangeSimplifierTest.java | 3 +-- + .../java/org/openstreetmap/osmosis/set/v0_6/EntityMergerTest.java | 3 +-- + .../java/org/openstreetmap/osmosis/xml/common/ElementWriterTest.java | 3 +-- + 10 files changed, 12 insertions(+), 17 deletions(-) + +--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/MysqlIdentityValueLoader2.java ++++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/MysqlIdentityValueLoader2.java +@@ -32,7 +32,7 @@ public class MysqlIdentityValueLoader2 i + * @return The newly inserted id. + */ + public long getLastInsertId() { +- return dbCtx.getJdbcTemplate().queryForLong(SQL_SELECT_LAST_INSERT_ID); ++ return dbCtx.getJdbcTemplate().queryForObject(SQL_SELECT_LAST_INSERT_ID, Long.class); + } + + +--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/PostgresqlIdentityValueLoader2.java ++++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/common/PostgresqlIdentityValueLoader2.java +@@ -34,7 +34,7 @@ public class PostgresqlIdentityValueLoad + * @return The newly inserted id. + */ + public long getLastInsertId() { +- return dbCtx.getJdbcTemplate().queryForLong(SQL_SELECT_LAST_INSERT_ID); ++ return dbCtx.getJdbcTemplate().queryForObject(SQL_SELECT_LAST_INSERT_ID, Long.class); + } + + +@@ -43,7 +43,7 @@ public class PostgresqlIdentityValueLoad + */ + @Override + public long getLastSequenceId(String sequenceName) { +- return dbCtx.getJdbcTemplate().queryForLong(SQL_SELECT_LAST_SEQUENCE_ID, sequenceName); ++ return dbCtx.getJdbcTemplate().queryForObject(SQL_SELECT_LAST_SEQUENCE_ID, Long.class, sequenceName); + } + + +--- a/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/EntityDao.java ++++ b/osmosis-apidb/src/main/java/org/openstreetmap/osmosis/apidb/v0_6/impl/EntityDao.java +@@ -460,8 +460,8 @@ public abstract class EntityDao<T extend + + if (LOG.isLoggable(Level.FINER)) { + LOG.log(Level.FINER, +- jdbcTemplate.queryForInt("SELECT Count(" + entityName + "_id) FROM " + selectedEntityTableName) +- + " " + entityName + " records located."); ++ jdbcTemplate.queryForObject("SELECT Count(" + entityName + "_id) FROM " + selectedEntityTableName, ++ Integer.class) + " " + entityName + " records located."); + } + + // Extract the data and obtain an iterator for the results. +--- a/osmosis-core/src/test/java/org/openstreetmap/osmosis/core/bound/v0_6/BoundComputerTest.java ++++ b/osmosis-core/src/test/java/org/openstreetmap/osmosis/core/bound/v0_6/BoundComputerTest.java +@@ -4,8 +4,7 @@ package org.openstreetmap.osmosis.core.b + import java.util.Date; + import java.util.Iterator; + +-import junit.framework.Assert; +- ++import org.junit.Assert; + import org.junit.Test; + import org.openstreetmap.osmosis.core.container.v0_6.BoundContainer; + import org.openstreetmap.osmosis.core.container.v0_6.EntityContainer; +--- a/osmosis-core/src/test/java/org/openstreetmap/osmosis/core/bound/v0_6/BoundSetterTest.java ++++ b/osmosis-core/src/test/java/org/openstreetmap/osmosis/core/bound/v0_6/BoundSetterTest.java +@@ -4,8 +4,7 @@ package org.openstreetmap.osmosis.core.b + import java.util.Date; + import java.util.Iterator; + +-import junit.framework.Assert; +- ++import org.junit.Assert; + import org.junit.Test; + import org.openstreetmap.osmosis.core.container.v0_6.BoundContainer; + import org.openstreetmap.osmosis.core.container.v0_6.EntityContainer; +--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/common/SchemaVersionValidator.java ++++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/common/SchemaVersionValidator.java +@@ -61,7 +61,7 @@ public class SchemaVersionValidator { + if (preferences.getValidateSchemaVersion()) { + int dbVersion; + +- dbVersion = jdbcTemplate.queryForInt(SELECT_SQL); ++ dbVersion = jdbcTemplate.queryForObject(SELECT_SQL, Integer.class); + + if (dbVersion != expectedVersion) { + throw new OsmosisRuntimeException( +--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/EntityDao.java ++++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/EntityDao.java +@@ -73,7 +73,7 @@ public abstract class EntityDao<T extend + * @return True if the entity exists in the database. + */ + public boolean exists(long entityId) { +- return jdbcTemplate.queryForInt(entityMapper.getSqlSelectCount(true), entityId) > 0; ++ return jdbcTemplate.queryForObject(entityMapper.getSqlSelectCount(true), Integer.class, entityId) > 0; + } + + +--- a/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/ChangeSimplifierTest.java ++++ b/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/ChangeSimplifierTest.java +@@ -6,8 +6,7 @@ import java.io.IOException; + import java.util.Date; + import java.util.HashMap; + +-import junit.framework.Assert; +- ++import org.junit.Assert; + import org.junit.Test; + import org.openstreetmap.osmosis.core.Osmosis; + import org.openstreetmap.osmosis.core.OsmosisRuntimeException; +--- a/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/EntityMergerTest.java ++++ b/osmosis-set/src/test/java/org/openstreetmap/osmosis/set/v0_6/EntityMergerTest.java +@@ -6,8 +6,7 @@ import java.util.ArrayList; + import java.util.Collections; + import java.util.List; + +-import junit.framework.Assert; +- ++import org.junit.Assert; + import org.junit.Test; + import org.openstreetmap.osmosis.core.Osmosis; + import org.openstreetmap.osmosis.core.OsmosisRuntimeException; +--- a/osmosis-xml/src/test/java/org/openstreetmap/osmosis/xml/common/ElementWriterTest.java ++++ b/osmosis-xml/src/test/java/org/openstreetmap/osmosis/xml/common/ElementWriterTest.java +@@ -5,10 +5,9 @@ import java.io.BufferedWriter; + import java.io.IOException; + import java.io.StringWriter; + ++import org.junit.Assert; + import org.junit.Test; + +-import junit.framework.Assert; +- + + /** + * Tests the element writer. diff --git a/debian/patches/0001-Fix-query-for-retrieving-way-nodes-in-pgsnapshot-mod.patch b/debian/patches/0001-Fix-query-for-retrieving-way-nodes-in-pgsnapshot-mod.patch new file mode 100644 index 0000000..7ced1ec --- /dev/null +++ b/debian/patches/0001-Fix-query-for-retrieving-way-nodes-in-pgsnapshot-mod.patch @@ -0,0 +1,33 @@ +From 749487e585de103c41e93c9819a798ec916c641a Mon Sep 17 00:00:00 2001 +From: Jeffrey Erikson <jeffrey.erik...@digitalglobe.com> +Date: Thu, 19 Mar 2015 10:33:46 -0400 +Subject: Fix query for retrieving way-nodes in pgsnapshot module +Origin: https://github.com/openstreetmap/osmosis/commit/749487e585de103c41e93c9819a798ec916c641a + +--- + .../openstreetmap/osmosis/pgsnapshot/v0_6/impl/EntityFeatureDao.java | 2 +- + .../org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/WayNodeMapper.java | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/EntityFeatureDao.java ++++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/EntityFeatureDao.java +@@ -51,7 +51,7 @@ public class EntityFeatureDao<Tef extend + * @return All instances of this feature type for the entity. + */ + public Collection<Tdb> getAll(long entityId) { +- return jdbcTemplate.query(entityFeatureMapper.getSqlSelect("", true, true), entityFeatureMapper.getRowMapper()); ++ return jdbcTemplate.query(entityFeatureMapper.getSqlSelect("", true, true), new Object[] { entityId }, entityFeatureMapper.getRowMapper()); + } + + +--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/WayNodeMapper.java ++++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/WayNodeMapper.java +@@ -48,7 +48,7 @@ public class WayNodeMapper extends Entit + .append("s e ON f.").append(getParentEntityName()).append("_id = e.id"); + } + if (filterByEntityId) { +- resultSql.append(" WHERE entity_id = ?"); ++ resultSql.append(" WHERE way_id = ?"); + } + if (orderBy) { + resultSql.append(getSqlDefaultOrderBy()); diff --git a/debian/patches/0001-MessageFormat-needs-an-array-not-a-bare-long.patch b/debian/patches/0001-MessageFormat-needs-an-array-not-a-bare-long.patch new file mode 100644 index 0000000..056c265 --- /dev/null +++ b/debian/patches/0001-MessageFormat-needs-an-array-not-a-bare-long.patch @@ -0,0 +1,27 @@ +From 39b350537d0c1f404ad7e8dfbf86658796141700 Mon Sep 17 00:00:00 2001 +From: Rory McCann <r...@geofabrik.de> +Date: Tue, 21 Apr 2015 10:43:52 +0200 +Subject: MessageFormat needs an array, not a bare long. +Origin: https://github.com/openstreetmap/osmosis/commit/39b350537d0c1f404ad7e8dfbf86658796141700 + +--- + .../openstreetmap/osmosis/replication/v0_6/ReplicationLagReader.java | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationLagReader.java ++++ b/osmosis-replication/src/main/java/org/openstreetmap/osmosis/replication/v0_6/ReplicationLagReader.java +@@ -119,10 +119,13 @@ public class ReplicationLagReader implem + ); + + } else { ++ Object[] args = { ++ new Long(lag) ++ }; + + // just some seconds + System.out.println( +- new MessageFormat("{0} second(s)").format(lag) ++ new MessageFormat("{0} second(s)").format(args) + ); + + } diff --git a/debian/patches/0001-Update-replication-urls-to-match-current-planet.osm..patch b/debian/patches/0001-Update-replication-urls-to-match-current-planet.osm..patch new file mode 100644 index 0000000..b2ee80d --- /dev/null +++ b/debian/patches/0001-Update-replication-urls-to-match-current-planet.osm..patch @@ -0,0 +1,39 @@ +From 8c7a71d8606ec70607cf6aafa7a029f040ea4486 Mon Sep 17 00:00:00 2001 +From: Rory McCann <r...@geofabrik.de> +Date: Tue, 21 Apr 2015 11:15:39 +0200 +Subject: Update replication urls to match current planet.osm.org layout +Origin: https://github.com/openstreetmap/osmosis/commit/8c7a71d8606ec70607cf6aafa7a029f040ea4486 + +--- + .../osmosis/replication/v0_6/impl/intervalConfiguration.txt | 2 +- + .../replication/v0_6/impl/replicationDownloaderConfiguration.txt | 2 +- + .../replication/v0_6/impl/replicationFileMergerConfiguration.txt | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +--- a/osmosis-replication/src/main/resources/org/openstreetmap/osmosis/replication/v0_6/impl/intervalConfiguration.txt ++++ b/osmosis-replication/src/main/resources/org/openstreetmap/osmosis/replication/v0_6/impl/intervalConfiguration.txt +@@ -1,5 +1,5 @@ + # The URL of the directory containing change files. +-baseUrl=http://planet.openstreetmap.org/hourly ++baseUrl=http://planet.openstreetmap.org/replication/hour + + # The length of an extraction interval in seconds (3600 = 1 hour). + intervalLength=3600 +--- a/osmosis-replication/src/main/resources/org/openstreetmap/osmosis/replication/v0_6/impl/replicationDownloaderConfiguration.txt ++++ b/osmosis-replication/src/main/resources/org/openstreetmap/osmosis/replication/v0_6/impl/replicationDownloaderConfiguration.txt +@@ -1,5 +1,5 @@ + # The URL of the directory containing change files. +-baseUrl=http://planet.openstreetmap.org/minute-replicate ++baseUrl=http://planet.openstreetmap.org/replication/minute + + # Defines the maximum time interval in seconds to download in a single invocation. + # Setting to 0 disables this feature. +--- a/osmosis-replication/src/main/resources/org/openstreetmap/osmosis/replication/v0_6/impl/replicationFileMergerConfiguration.txt ++++ b/osmosis-replication/src/main/resources/org/openstreetmap/osmosis/replication/v0_6/impl/replicationFileMergerConfiguration.txt +@@ -1,5 +1,5 @@ + # The URL of the directory containing change files. +-baseUrl=http://planet.openstreetmap.org/minute-replicate ++baseUrl=http://planet.openstreetmap.org/replication/minute + + # The length of an extraction interval in seconds (3600 = 1 hour). + intervalLength=60 diff --git a/debian/patches/0001-build-Exclude-db-server-as-a-java-project.patch b/debian/patches/0001-build-Exclude-db-server-as-a-java-project.patch new file mode 100644 index 0000000..d490173 --- /dev/null +++ b/debian/patches/0001-build-Exclude-db-server-as-a-java-project.patch @@ -0,0 +1,23 @@ +From 3de2d67237e319ac3e28213c556775663db4e4fe Mon Sep 17 00:00:00 2001 +From: Brett Henderson <br...@bretth.com> +Date: Wed, 7 Jan 2015 22:22:16 +1100 +Subject: build: Exclude db-server as a java project +Origin: https://github.com/openstreetmap/osmosis/commit/3de2d67237e319ac3e28213c556775663db4e4fe + +--- + build.gradle | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/build.gradle ++++ b/build.gradle +@@ -8,8 +8,9 @@ task wrapper(type: Wrapper) { + */ + def packageProjects = allprojects.findAll { project -> project.path.equals(':package') } + def buildProjects = allprojects.findAll { project -> project.path.equals(':build-support') } ++def dockerProjects = allprojects.findAll { project -> project.path.equals(':db-server') } + // Java projects are all those that aren't in the previous collections. +-def javaProjects = subprojects.findAll { project -> !packageProjects.contains(project) && !buildProjects.contains(project) } ++def javaProjects = subprojects.findAll { project -> !packageProjects.contains(project) && !buildProjects.contains(project) && !dockerProjects.contains(project) } + + // Apply common project configuration + subprojects { diff --git a/debian/patches/0001-db-server-Add-a-readme-explaining-basic-docker-usage.patch b/debian/patches/0001-db-server-Add-a-readme-explaining-basic-docker-usage.patch new file mode 100644 index 0000000..0eff370 --- /dev/null +++ b/debian/patches/0001-db-server-Add-a-readme-explaining-basic-docker-usage.patch @@ -0,0 +1,25 @@ +From 28723d03c44fe106c09e410877008974085719ea Mon Sep 17 00:00:00 2001 +From: Brett Henderson <br...@bretth.com> +Date: Wed, 7 Jan 2015 22:18:38 +1100 +Subject: db-server: Add a readme explaining basic docker usage +Origin: https://github.com/openstreetmap/osmosis/commit/28723d03c44fe106c09e410877008974085719ea + +--- + db-server/readme.txt | 11 +++++++++++ + 1 file changed, 11 insertions(+) + create mode 100644 db-server/readme.txt + +--- /dev/null ++++ b/db-server/readme.txt +@@ -0,0 +1,11 @@ ++This directory contains the scripts to create a docker-based database server to be used for unit testing. ++ ++To build the docker image, run the following script. ++ ./build.sh ++ ++To run the docker image, run the following command. To stop the server, press Ctrl-C. ++ docker run -ti --rm=true --name osmosis-build -p 5432:5432 bretth/osmosis-build ++ ++If you wish to troubleshoot a running server, you may run the following command to get a bash prompt ++inside the docker container. ++ docker exec -ti osmosis-build /bin/bash diff --git a/debian/patches/0001-db-server-Add-docker-workaround-to-allow-use-of-syml.patch b/debian/patches/0001-db-server-Add-docker-workaround-to-allow-use-of-syml.patch new file mode 100644 index 0000000..826b815 --- /dev/null +++ b/debian/patches/0001-db-server-Add-docker-workaround-to-allow-use-of-syml.patch @@ -0,0 +1,26 @@ +From aaf690bfad64536f65b82bce8d879c366fc86f7f Mon Sep 17 00:00:00 2001 +From: Brett Henderson <br...@bretth.com> +Date: Wed, 7 Jan 2015 21:44:46 +1100 +Subject: db-server: Add docker workaround to allow use of symlinks +Origin: https://github.com/openstreetmap/osmosis/commit/aaf690bfad64536f65b82bce8d879c366fc86f7f + +A Dockerfile cannot reference files outside the current directory and +won't follow symlinks. This means that scripts from the package project +cannot be referenced without copying them into the db-server directory. +To avoid this, we use docker's ability to read a directory in tar +format from standard input, and use tar to dereference the symlinks +first. +--- + db-server/build.sh | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/db-server/build.sh ++++ b/db-server/build.sh +@@ -1,3 +1,6 @@ + #!/bin/sh + +-docker build -t="bretth/osmosis-build" . ++# Build the docker image. ++# The use of tar is a workaround for the docker restriction of not following symlinks. This ++# tar command dereferences symlinks and then passes the resultant archive to the docker build. ++tar -czh . | docker build -t="bretth/osmosis-build" - diff --git a/debian/patches/0001-db-server-Add-initial-db-server-docker-image-for-tes.patch b/debian/patches/0001-db-server-Add-initial-db-server-docker-image-for-tes.patch new file mode 100644 index 0000000..710004e --- /dev/null +++ b/debian/patches/0001-db-server-Add-initial-db-server-docker-image-for-tes.patch @@ -0,0 +1,94 @@ +From aa4c67517afbc5b752ae34dbe95bb44c3d76b977 Mon Sep 17 00:00:00 2001 +From: Brett Henderson <br...@bretth.com> +Date: Wed, 7 Jan 2015 16:48:49 +1100 +Subject: db-server: Add initial db server docker image for testing database + tasks +Origin: https://github.com/openstreetmap/osmosis/commit/aa4c67517afbc5b752ae34dbe95bb44c3d76b977 + +--- + db-server/Dockerfile | 13 ++++++++++++ + db-server/build.sh | 3 +++ + db-server/docker-start.sh | 53 +++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 69 insertions(+) + create mode 100644 db-server/Dockerfile + create mode 100755 db-server/build.sh + create mode 100755 db-server/docker-start.sh + +--- /dev/null ++++ b/db-server/Dockerfile +@@ -0,0 +1,13 @@ ++FROM fedora:21 ++ ++# Install PostgreSQL ++RUN yum install -y postgresql-server postgresql-contrib ++ ++# Install PostGIS ++RUN yum install -y postgis ++ ++EXPOSE 5432 ++ ++COPY docker-start.sh /start.sh ++ ++CMD ["/start.sh"] +--- /dev/null ++++ b/db-server/build.sh +@@ -0,0 +1,3 @@ ++#!/bin/sh ++ ++docker build -t="bretth/osmosis-build" . +--- /dev/null ++++ b/db-server/docker-start.sh +@@ -0,0 +1,53 @@ ++#!/bin/bash ++ ++DATADIR="/var/lib/pgsql/data" ++ ++# test if DATADIR has content ++if [ ! "$(ls -A $DATADIR)" ]; then ++ # Create the en_US.UTF-8 locale. We need UTF-8 support in the database. ++ localedef -v -c -i en_US -f UTF-8 en_US.UTF-8 ++ ++ echo "Initializing Postgres Database at $DATADIR" ++ su postgres sh -lc "initdb --encoding=UTF-8 --locale=en_US.UTF-8" ++ ++ su postgres sh -lc "postgres --single -jE" <<-EOSQL ++ CREATE USER osm WITH SUPERUSER PASSWORD 'password'; ++ EOSQL ++ ++ # Allow the osm user to connect remotely with a password. ++ echo "host all osm 0.0.0.0/0 md5" >> "${DATADIR}/pg_hba.conf" ++ ++ # Create the pgsnapshot database owned by osm. ++ su postgres sh -lc "postgres --single -jE" <<-EOSQL ++ CREATE DATABASE pgosmsnap06_test OWNER osm; ++ EOSQL ++ ++ # Start the database temporarily while we configure it. ++ #su postgres sh -lc "postgres" & ++ #PID=$! ++ #echo "PID: ${PID}" ++ #sleep 1 ++ su postgres sh -lc "pg_ctl -w start" ++ ++ # Configure the database as the OSM user. ++ su postgres sh -lc "psql -U osm pgosmsnap06_test" <<-EOSQL ++ CREATE EXTENSION hstore; ++ EOSQL ++ ++ # Stop the database. ++ su postgres sh -lc "pg_ctl -w stop" ++fi ++ ++SHUTDOWN_COMMAND="echo \"Shutting down postgres\"; su postgres sh -lc \"pg_ctl -w stop\"" ++trap "${SHUTDOWN_COMMAND}" SIGTERM ++trap "${SHUTDOWN_COMMAND}" SIGINT ++ ++# Start the database server. ++su postgres sh -lc "pg_ctl -w start" ++ ++echo "Docker container startup complete" ++ ++# Wait for the server to exit. ++while test -e "/var/lib/pgsql/data/postmaster.pid"; do ++ sleep 0.5 ++done diff --git a/debian/patches/0001-db-server-Allow-remote-connections-to-the-server.patch b/debian/patches/0001-db-server-Allow-remote-connections-to-the-server.patch new file mode 100644 index 0000000..e461990 --- /dev/null +++ b/debian/patches/0001-db-server-Allow-remote-connections-to-the-server.patch @@ -0,0 +1,20 @@ +From 0b5af4f1d92c8645d75274305a7b4458398da7a7 Mon Sep 17 00:00:00 2001 +From: Brett Henderson <br...@bretth.com> +Date: Wed, 7 Jan 2015 22:18:20 +1100 +Subject: db-server: Allow remote connections to the server +Origin: https://github.com/openstreetmap/osmosis/commit/0b5af4f1d92c8645d75274305a7b4458398da7a7 + +--- + db-server/docker-start.sh | 1 + + 1 file changed, 1 insertion(+) + +--- a/db-server/docker-start.sh ++++ b/db-server/docker-start.sh +@@ -15,6 +15,7 @@ if [ ! "$(ls -A $DATADIR)" ]; then + EOSQL + + # Allow the osm user to connect remotely with a password. ++ echo "listen_addresses = '*'" >> "${DATADIR}/postgresql.conf" + echo "host all osm 0.0.0.0/0 md5" >> "${DATADIR}/pg_hba.conf" + + # Create the pgsnapshot database owned by osm. diff --git a/debian/patches/0001-db-server-Create-and-configure-the-api06_test-databa.patch b/debian/patches/0001-db-server-Create-and-configure-the-api06_test-databa.patch new file mode 100644 index 0000000..e898d3b --- /dev/null +++ b/debian/patches/0001-db-server-Create-and-configure-the-api06_test-databa.patch @@ -0,0 +1,39 @@ +From 391014fbe3b4c28950c0655155c3195aa031433a Mon Sep 17 00:00:00 2001 +From: Brett Henderson <br...@bretth.com> +Date: Wed, 7 Jan 2015 21:49:59 +1100 +Subject: db-server: Create and configure the api06_test database +Origin: https://github.com/openstreetmap/osmosis/commit/391014fbe3b4c28950c0655155c3195aa031433a + +--- + db-server/docker-start.sh | 11 +++++++++++ + db-server/script | 1 + + 2 files changed, 12 insertions(+) + create mode 120000 db-server/script + +--- a/db-server/docker-start.sh ++++ b/db-server/docker-start.sh +@@ -22,6 +22,11 @@ if [ ! "$(ls -A $DATADIR)" ]; then + CREATE DATABASE pgosmsnap06_test OWNER osm; + EOSQL + ++ # Create the apidb database owned by osm. ++ su postgres sh -lc "postgres --single -jE" <<-EOSQL ++ CREATE DATABASE api06_test OWNER osm; ++ EOSQL ++ + # Start the database server temporarily while we configure the databases. + su postgres sh -lc "pg_ctl -w start" + +@@ -35,6 +40,12 @@ if [ ! "$(ls -A $DATADIR)" ]; then + \i /install/script/pgsnapshot_schema_0.6_linestring.sql + EOSQL + ++ # Configure the api06_test database as the OSM user. ++ su postgres sh -lc "psql -U osm api06_test" <<-EOSQL ++ \i /install/script/contrib/apidb_0.6.sql ++ \i /install/script/contrib/apidb_0.6_osmosis_xid_indexing.sql ++ EOSQL ++ + # Stop the database. + su postgres sh -lc "pg_ctl -w stop" + fi diff --git a/debian/patches/0001-db-server-Eclipse-enable-the-new-project.patch b/debian/patches/0001-db-server-Eclipse-enable-the-new-project.patch new file mode 100644 index 0000000..18570ab --- /dev/null +++ b/debian/patches/0001-db-server-Eclipse-enable-the-new-project.patch @@ -0,0 +1,41 @@ +From 30d9bda3915c597184a560c34803c0c6854feb17 Mon Sep 17 00:00:00 2001 +From: Brett Henderson <br...@bretth.com> +Date: Wed, 7 Jan 2015 21:20:48 +1100 +Subject: db-server: Eclipse enable the new project +Origin: https://github.com/openstreetmap/osmosis/commit/30d9bda3915c597184a560c34803c0c6854feb17 + +--- + db-server/.gitignore | 4 ++++ + settings.gradle | 7 ++++--- + 2 files changed, 8 insertions(+), 3 deletions(-) + create mode 100644 db-server/.gitignore + +--- /dev/null ++++ b/db-server/.gitignore +@@ -0,0 +1,4 @@ ++.classpath ++.project ++.settings ++ +--- a/settings.gradle ++++ b/settings.gradle +@@ -1,11 +1,11 @@ +-include 'osmosis-apidb' +-include 'osmosis-areafilter' + include 'build-support' ++include 'db-server' ++include 'osmosis-areafilter' ++include 'osmosis-apidb' + include 'osmosis-core' + include 'osmosis-dataset' + include 'osmosis-extract' + include 'osmosis-hstore-jdbc' +-include 'package' + include 'osmosis-osm-binary' + include 'osmosis-pbf' + include 'osmosis-pbf2' +@@ -18,3 +18,4 @@ include 'osmosis-tagfilter' + include 'osmosis-tagtransform' + include 'osmosis-testutil' + include 'osmosis-xml' ++include 'package' diff --git a/debian/patches/0001-db-server-Minor-tweaks-to-readme-to-explain-docker-d.patch b/debian/patches/0001-db-server-Minor-tweaks-to-readme-to-explain-docker-d.patch new file mode 100644 index 0000000..0b60129 --- /dev/null +++ b/debian/patches/0001-db-server-Minor-tweaks-to-readme-to-explain-docker-d.patch @@ -0,0 +1,19 @@ +From bc2b2fa891f83a26e7c78ca002ba6faa255b2a74 Mon Sep 17 00:00:00 2001 +From: Brett Henderson <br...@bretth.com> +Date: Wed, 7 Jan 2015 22:23:56 +1100 +Subject: db-server: Minor tweaks to readme to explain docker dependency +Origin: https://github.com/openstreetmap/osmosis/commit/bc2b2fa891f83a26e7c78ca002ba6faa255b2a74 + +--- + db-server/readme.txt | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/db-server/readme.txt ++++ b/db-server/readme.txt +@@ -1,4 +1,6 @@ + This directory contains the scripts to create a docker-based database server to be used for unit testing. ++In order to use this server, docker must be installed on the local workstation. Beyond that, no additional ++configuration should be required. + + To build the docker image, run the following script. + ./build.sh diff --git a/debian/patches/0001-db-server-Perform-full-configuration-of-the-pgosmsna.patch b/debian/patches/0001-db-server-Perform-full-configuration-of-the-pgosmsna.patch new file mode 100644 index 0000000..0f894a6 --- /dev/null +++ b/debian/patches/0001-db-server-Perform-full-configuration-of-the-pgosmsna.patch @@ -0,0 +1,47 @@ +From e80b65214afd6e08ec529e50700af735af1f117b Mon Sep 17 00:00:00 2001 +From: Brett Henderson <br...@bretth.com> +Date: Wed, 7 Jan 2015 21:45:15 +1100 +Subject: db-server: Perform full configuration of the pgosmsnap06_test + database +Origin: https://github.com/openstreetmap/osmosis/commit/e80b65214afd6e08ec529e50700af735af1f117b + +--- + db-server/Dockerfile | 1 + + db-server/docker-start.sh | 13 +++++++------ + 2 files changed, 8 insertions(+), 6 deletions(-) + +--- a/db-server/Dockerfile ++++ b/db-server/Dockerfile +@@ -9,5 +9,6 @@ RUN yum install -y postgis + EXPOSE 5432 + + COPY docker-start.sh /start.sh ++COPY script /install/script + + CMD ["/start.sh"] +--- a/db-server/docker-start.sh ++++ b/db-server/docker-start.sh +@@ -22,16 +22,17 @@ if [ ! "$(ls -A $DATADIR)" ]; then + CREATE DATABASE pgosmsnap06_test OWNER osm; + EOSQL + +- # Start the database temporarily while we configure it. +- #su postgres sh -lc "postgres" & +- #PID=$! +- #echo "PID: ${PID}" +- #sleep 1 ++ # Start the database server temporarily while we configure the databases. + su postgres sh -lc "pg_ctl -w start" + +- # Configure the database as the OSM user. ++ # Configure the pgosmsnap06_test database as the OSM user. + su postgres sh -lc "psql -U osm pgosmsnap06_test" <<-EOSQL + CREATE EXTENSION hstore; ++ CREATE EXTENSION postgis; ++ \i /install/script/pgsnapshot_schema_0.6.sql ++ \i /install/script/pgsnapshot_schema_0.6_action.sql ++ \i /install/script/pgsnapshot_schema_0.6_bbox.sql ++ \i /install/script/pgsnapshot_schema_0.6_linestring.sql + EOSQL + + # Stop the database. diff --git a/debian/patches/0001-pgsnapshot-Fix-checkstyle-errors-introduced-by-previ.patch b/debian/patches/0001-pgsnapshot-Fix-checkstyle-errors-introduced-by-previ.patch new file mode 100644 index 0000000..930a462 --- /dev/null +++ b/debian/patches/0001-pgsnapshot-Fix-checkstyle-errors-introduced-by-previ.patch @@ -0,0 +1,23 @@ +From cd86c4434242da3afb2ee3b084673bfb9c7583b5 Mon Sep 17 00:00:00 2001 +From: Brett Henderson <br...@bretth.com> +Date: Fri, 20 Mar 2015 20:27:31 +1100 +Subject: pgsnapshot: Fix checkstyle errors introduced by previous way-node + retrieval fix +Origin: https://github.com/openstreetmap/osmosis/commit/cd86c4434242da3afb2ee3b084673bfb9c7583b5 + +--- + .../openstreetmap/osmosis/pgsnapshot/v0_6/impl/EntityFeatureDao.java | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/EntityFeatureDao.java ++++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/EntityFeatureDao.java +@@ -51,7 +51,8 @@ public class EntityFeatureDao<Tef extend + * @return All instances of this feature type for the entity. + */ + public Collection<Tdb> getAll(long entityId) { +- return jdbcTemplate.query(entityFeatureMapper.getSqlSelect("", true, true), new Object[] { entityId }, entityFeatureMapper.getRowMapper()); ++ return jdbcTemplate.query(entityFeatureMapper.getSqlSelect("", true, true), new Object[] {entityId}, ++ entityFeatureMapper.getRowMapper()); + } + + diff --git a/debian/patches/0001-pgsnapshot-Fix-query-for-retrieving-relation-members.patch b/debian/patches/0001-pgsnapshot-Fix-query-for-retrieving-relation-members.patch new file mode 100644 index 0000000..981f7ea --- /dev/null +++ b/debian/patches/0001-pgsnapshot-Fix-query-for-retrieving-relation-members.patch @@ -0,0 +1,21 @@ +From 276f3277a37ec7d6d9eb12ac81aff2ec69951cfc Mon Sep 17 00:00:00 2001 +From: Jeffrey Erikson <jeffrey.erik...@digitalglobe.com> +Date: Thu, 9 Apr 2015 14:48:40 -0400 +Subject: pgsnapshot: Fix query for retrieving relation members +Origin: https://github.com/openstreetmap/osmosis/commit/276f3277a37ec7d6d9eb12ac81aff2ec69951cfc + +--- + .../osmosis/pgsnapshot/v0_6/impl/RelationMemberMapper.java | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/RelationMemberMapper.java ++++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/RelationMemberMapper.java +@@ -59,7 +59,7 @@ public class RelationMemberMapper extend + .append("s e ON f.").append(getParentEntityName()).append("_id = e.id"); + } + if (filterByEntityId) { +- resultSql.append(" WHERE entity_id = ?"); ++ resultSql.append(" WHERE relation_id = ?"); + } + if (orderBy) { + resultSql.append(getSqlDefaultOrderBy()); diff --git a/debian/patches/0001-pgsnapshot-Handle-case-where-WayNodes-might-already-.patch b/debian/patches/0001-pgsnapshot-Handle-case-where-WayNodes-might-already-.patch new file mode 100644 index 0000000..7a1414b --- /dev/null +++ b/debian/patches/0001-pgsnapshot-Handle-case-where-WayNodes-might-already-.patch @@ -0,0 +1,28 @@ +From df5a10bc8060e3bad2a3ba6edbc537173a245368 Mon Sep 17 00:00:00 2001 +From: Jeffrey Erikson <jeffrey.erik...@digitalglobe.com> +Date: Thu, 9 Apr 2015 14:42:44 -0400 +Subject: pgsnapshot: Handle case where WayNodes might already be loaded +Origin: https://github.com/openstreetmap/osmosis/commit/df5a10bc8060e3bad2a3ba6edbc537173a245368 + +The WayMapper might already be loading node IDs when a Way +is retrieved, so this commit adds a check to see if the Way +already has a list of WayNodes before adding them to the Way +in WayDao. Without this check, the WayNodes end up duplicated. +--- + .../java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/WayDao.java | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/WayDao.java ++++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/WayDao.java +@@ -61,7 +61,10 @@ public class WayDao extends EntityDao<Wa + + + private void loadFeatures(long entityId, Way entity) { +- entity.getWayNodes().addAll(wayNodeDao.getAllRaw(entityId)); ++ if ( entity.getWayNodes().size() == 0 ) ++ { ++ entity.getWayNodes().addAll(wayNodeDao.getAllRaw(entityId)); ++ } + } + + diff --git a/debian/patches/0001-pgsnapshot-Remove-redundant-way-node-loading-logic.patch b/debian/patches/0001-pgsnapshot-Remove-redundant-way-node-loading-logic.patch new file mode 100644 index 0000000..3b5b585 --- /dev/null +++ b/debian/patches/0001-pgsnapshot-Remove-redundant-way-node-loading-logic.patch @@ -0,0 +1,45 @@ +From 38824af034e5fefaa9d710e10206662e15978c1a Mon Sep 17 00:00:00 2001 +From: Brett Henderson <br...@bretth.com> +Date: Thu, 7 May 2015 20:31:37 +1000 +Subject: pgsnapshot: Remove redundant way node loading logic +Origin: https://github.com/openstreetmap/osmosis/commit/38824af034e5fefaa9d710e10206662e15978c1a + +The way node loading logic no longer needs to hit the way_nodes table +because the ways table has the list of node ids embedded in the nodes +column. This logic was causing double loading until Jeffrey's recent +fix, but it is redundant and can be removed completely ... I hope. +--- + .../osmosis/pgsnapshot/v0_6/impl/WayDao.java | 22 ---------------------- + 1 file changed, 22 deletions(-) + +--- a/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/WayDao.java ++++ b/osmosis-pgsnapshot/src/main/java/org/openstreetmap/osmosis/pgsnapshot/v0_6/impl/WayDao.java +@@ -58,28 +58,6 @@ public class WayDao extends EntityDao<Wa + wayNodeMapper = new WayNodeMapper(); + wayNodeDao = new EntityFeatureDao<WayNode, DbOrderedFeature<WayNode>>(jdbcTemplate, wayNodeMapper); + } +- +- +- private void loadFeatures(long entityId, Way entity) { +- if (entity.getWayNodes().size() == 0) { +- entity.getWayNodes().addAll(wayNodeDao.getAllRaw(entityId)); +- } +- } +- +- +- /** +- * {@inheritDoc} +- */ +- @Override +- public Way getEntity(long entityId) { +- Way entity; +- +- entity = super.getEntity(entityId); +- +- loadFeatures(entityId, entity); +- +- return entity; +- } + + + /** diff --git a/debian/patches/series b/debian/patches/series index da0fbec..1184562 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -17,3 +17,21 @@ 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 +0001-Fix-deprecation-warnings-resulting-from-dependency-u.patch +0001-db-server-Add-initial-db-server-docker-image-for-tes.patch +0001-db-server-Eclipse-enable-the-new-project.patch +0001-db-server-Add-docker-workaround-to-allow-use-of-syml.patch +0001-db-server-Perform-full-configuration-of-the-pgosmsna.patch +0001-db-server-Create-and-configure-the-api06_test-databa.patch +0001-db-server-Allow-remote-connections-to-the-server.patch +0001-db-server-Add-a-readme-explaining-basic-docker-usage.patch +0001-build-Exclude-db-server-as-a-java-project.patch +0001-db-server-Minor-tweaks-to-readme-to-explain-docker-d.patch +0001-Fix-query-for-retrieving-way-nodes-in-pgsnapshot-mod.patch +0001-pgsnapshot-Fix-checkstyle-errors-introduced-by-previ.patch +0001-pgsnapshot-Handle-case-where-WayNodes-might-already-.patch +0001-pgsnapshot-Fix-query-for-retrieving-relation-members.patch +0001-Fix-checkstyle-errors.patch +0001-MessageFormat-needs-an-array-not-a-bare-long.patch +0001-Update-replication-urls-to-match-current-planet.osm..patch +0001-pgsnapshot-Remove-redundant-way-node-loading-logic.patch -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/osmosis.git _______________________________________________ Pkg-grass-devel mailing list Pkg-grass-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel