[Git][debian-gis-team/pyosmium][master] 4 commits: New upstream version 3.1.3

Bas Couwenberg gitlab at salsa.debian.org
Sat Feb 6 14:14:03 GMT 2021



Bas Couwenberg pushed to branch master at Debian GIS Project / pyosmium


Commits:
49bf56ae by Bas Couwenberg at 2021-02-06T15:03:35+01:00
New upstream version 3.1.3
- - - - -
77d22465 by Bas Couwenberg at 2021-02-06T15:03:38+01:00
Update upstream source from tag 'upstream/3.1.3'

Update to upstream version '3.1.3'
with Debian dir ee9b81e536f0e76c1970fe67f9d8cb7170be9171
- - - - -
8165189f by Bas Couwenberg at 2021-02-06T15:03:52+01:00
New upstream release.

- - - - -
a608fd79 by Bas Couwenberg at 2021-02-06T15:04:44+01:00
Set distribution to unstable.

- - - - -


5 changed files:

- CHANGELOG.md
- debian/changelog
- src/osmium/replication/server.py
- src/osmium/version.py
- tools/pyosmium-up-to-date


Changes:

=====================================
CHANGELOG.md
=====================================
@@ -4,6 +4,17 @@
 All notable changes to this project will be documented in this file.
 This project adheres to [Semantic Versioning](http://semver.org/).
 
+## [3.1.3] - 2021-02-05
+
+### Fixed
+
+- up-to-date: check if any updates are available before starting download
+- AttributeError when writing replication headers and network is unreachable
+
+### Changed
+
+- update to pybind11 2.6.2
+
 ## [3.1.2] - 2021-01-13
 
 ### Fixed
@@ -14,7 +25,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
 
 ### Added
 
-- support for lz4 compression (compled in when library is found)
+- support for lz4 compression (compiled in when library is found)
 
 ### Changed
 


=====================================
debian/changelog
=====================================
@@ -1,10 +1,11 @@
-pyosmium (3.1.2-2) UNRELEASED; urgency=medium
+pyosmium (3.1.3-1) unstable; urgency=medium
 
+  * New upstream release.
   * Drop unused build dependencies.
     (closes: #980339)
   * Update upstream metadata.
 
- -- Bas Couwenberg <sebastic at debian.org>  Mon, 18 Jan 2021 05:40:54 +0100
+ -- Bas Couwenberg <sebastic at debian.org>  Sat, 06 Feb 2021 15:04:32 +0100
 
 pyosmium (3.1.2-1) unstable; urgency=medium
 


=====================================
src/osmium/replication/server.py
=====================================
@@ -170,7 +170,8 @@ class ReplicationServer:
             h.set("osmosis_replication_base_url", self.baseurl)
             h.set("osmosis_replication_sequence_number", str(diffs.id))
             info = self.get_state_info(diffs.id)
-            h.set("osmosis_replication_timestamp", info.timestamp.strftime("%Y-%m-%dT%H:%M:%SZ"))
+            if info is not None:
+                h.set("osmosis_replication_timestamp", info.timestamp.strftime("%Y-%m-%dT%H:%M:%SZ"))
         if extra_headers is not None:
             for k, v in extra_headers.items():
                 h.set(k, v)


=====================================
src/osmium/version.py
=====================================
@@ -5,11 +5,11 @@ Version information.
 # the major version
 pyosmium_major = '3.1'
 # current release (Pip version)
-pyosmium_release = '3.1.2'
+pyosmium_release = '3.1.3'
 
 # libosmium version shipped with the Pip release
 libosmium_version = '2.16.0'
 # protozero version shipped with the Pip release
 protozero_version = '1.7.0'
 # pybind11 version shipped with the Pip release
-pybind11_version = '2.6.1'
+pybind11_version = '2.6.2'


=====================================
tools/pyosmium-up-to-date
=====================================
@@ -19,11 +19,11 @@ This program can update normal OSM data files as well as OSM history files.
 It detects automatically on what type of file it is called.
 
 The program returns 0, if updates have been successfully applied up to
-the newest data. It returns 1, if some updates have been applied but
-there is still data available on the server (either because the size
-limit has been reached or there was a network error which could not be
-resolved). Any other error results in a return code larger than 1. The
-output file is guaranteed to be unmodified in that case.
+the newest data or no new data was available. It returns 1, if some updates
+have been applied but there is still data available on the server (either
+because the size limit has been reached or there was a network error which
+could not be resolved). Any other error results in a return code larger than 1.
+The output file is guaranteed to be unmodified in that case.
 
 Some OSM data sources require a cookie to be sent with the HTTP requests. 
 Pyosmium-up-to-date does not fetch the cookie from these services for you.
@@ -33,6 +33,7 @@ cookies to the server and will save received cookies to the jar file.
 
 import re
 import sys
+import traceback
 import logging
 import socket
 
@@ -76,7 +77,14 @@ def update_from_custom_server(url, seq, ts, options):
         cookie_jar.load(options.cookie)
         opener = urlrequest.build_opener(urlrequest.HTTPCookieProcessor(cookie_jar))
         svr.open_url = opener.open
-    log.info("Using replication service at %s" % url)
+
+    log.info("Using replication service at %s", url)
+
+    current = svr.get_state_info()
+    if current is None:
+        log.error("Cannot download state information. Is the replication URL correct?")
+        return 3
+    log.debug("Server is at sequence %d (%s).", current.sequence, current.timestamp)
 
     if seq is None:
         log.info("Using timestamp %s as starting point." % ts)
@@ -86,6 +94,10 @@ def update_from_custom_server(url, seq, ts, options):
                       % (str(ts), url))
             return 3
     else:
+        if seq >= current.sequence:
+            log.info("File is already up to date.")
+            return 0
+
         log.debug("Using given sequence ID %d" % seq)
         startseq = seq + 1
         ts = svr.get_state_info(seq=startseq)
@@ -240,9 +252,13 @@ if __name__ == '__main__':
         log.error(str(e))
         exit(2)
 
-    if url is None:
-        ret = update_from_osm_server(ts, options)
-    else:
-        ret = update_from_custom_server(url, seq, ts, options)
+    try:
+        if url is None:
+            ret = update_from_osm_server(ts, options)
+        else:
+            ret = update_from_custom_server(url, seq, ts, options)
+    except:
+        traceback.print_exc()
+        exit(254)
 
     exit(ret)



View it on GitLab: https://salsa.debian.org/debian-gis-team/pyosmium/-/compare/927076ac77fca9e94455217d68d8647e0b414905...a608fd79bf098e7142200da9fc849def9fcf282c

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/pyosmium/-/compare/927076ac77fca9e94455217d68d8647e0b414905...a608fd79bf098e7142200da9fc849def9fcf282c
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20210206/c1dae85f/attachment-0001.html>


More information about the Pkg-grass-devel mailing list