]> git.ipfire.org Git - location/debian/libloc.git/commitdiff
Add upstream patch for older Python 3
authorJochen Sprickerhof <git@jochen.sprickerhof.de>
Fri, 8 Jul 2022 11:30:57 +0000 (13:30 +0200)
committerJochen Sprickerhof <git@jochen.sprickerhof.de>
Fri, 8 Jul 2022 11:31:52 +0000 (13:31 +0200)
Also drop functools dependency.

debian/patches/0000-Revert-configure-Require-Python-3.9.patch [new file with mode: 0644]
debian/patches/0001-Make-sources-around-that-we-can-run-tests-without-lo.patch
debian/patches/series

diff --git a/debian/patches/0000-Revert-configure-Require-Python-3.9.patch b/debian/patches/0000-Revert-configure-Require-Python-3.9.patch
new file mode 100644 (file)
index 0000000..8c58c7a
--- /dev/null
@@ -0,0 +1,57 @@
+From: Michael Tremer <michael.tremer@ipfire.org>
+Date: Thu, 14 Apr 2022 17:11:49 +0000
+Subject: Revert "configure: Require Python >= 3.9"
+
+This reverts commit 643b8d062ac11efef6c74cf8af7281079e2533e9.
+
+Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
+---
+ configure.ac         | 2 +-
+ src/python/export.py | 7 ++++---
+ 2 files changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index e96e9ce..8b27cf6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -154,7 +154,7 @@ AM_CONDITIONAL(HAVE_SYSTEMD, [test "x$have_systemd" = "xyes"])
+ # ------------------------------------------------------------------------------
+ # Python
+-AM_PATH_PYTHON([3.9])
++AM_PATH_PYTHON([3.4])
+ PKG_CHECK_MODULES([PYTHON], [python-${PYTHON_VERSION}])
+ # Perl
+diff --git a/src/python/export.py b/src/python/export.py
+index 3cdece4..13c0540 100644
+--- a/src/python/export.py
++++ b/src/python/export.py
+@@ -17,7 +17,6 @@
+ #                                                                             #
+ ###############################################################################
+-import functools
+ import io
+ import ipaddress
+ import logging
+@@ -59,6 +58,9 @@ class OutputWriter(object):
+               else:
+                       self.f = io.StringIO()
++              # Tag
++              self.tag = self._make_tag()
++
+               # Call any custom initialization
+               self.init()
+@@ -74,8 +76,7 @@ class OutputWriter(object):
+       def __repr__(self):
+               return "<%s %s f=%s>" % (self.__class__.__name__, self, self.f)
+-      @functools.cached_property
+-      def tag(self):
++      def _make_tag(self):
+               families = {
+                       socket.AF_INET6 : "6",
+                       socket.AF_INET  : "4",
index 9cea44fef0623d75fa185f35d204a9ad507097e0..4879c4c550e5357ab92ae4f09f8a38baa80669b9 100644 (file)
@@ -14,7 +14,7 @@ Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
  src/python/__init__.py.in         |   26 -
  src/python/database.py            |  213 -----
  src/python/downloader.py          |  211 -----
- src/python/export.py              |  291 -------
+ src/python/export.py              |  292 -------
  src/python/i18n.py                |   26 -
  src/python/importer.py            |  250 ------
  src/python/location-importer.in   | 1535 -------------------------------------
@@ -22,14 +22,14 @@ Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
  src/python/location/__init__.py   |   24 +
  src/python/location/database.py   |  213 +++++
  src/python/location/downloader.py |  211 +++++
- src/python/location/export.py     |  291 +++++++
+ src/python/location/export.py     |  292 +++++++
  src/python/location/i18n.py       |   26 +
  src/python/location/importer.py   |  250 ++++++
  src/python/location/logger.py     |   46 ++
  src/python/logger.py              |   46 --
  src/scripts/location-importer.in  | 1535 +++++++++++++++++++++++++++++++++++++
  src/scripts/location.in           |  644 ++++++++++++++++
- 21 files changed, 3266 insertions(+), 3276 deletions(-)
+ 21 files changed, 3267 insertions(+), 3277 deletions(-)
  delete mode 100644 src/python/__init__.py.in
  delete mode 100644 src/python/database.py
  delete mode 100644 src/python/downloader.py
@@ -634,10 +634,10 @@ index 05f7872..0000000
 -              return True
 diff --git a/src/python/export.py b/src/python/export.py
 deleted file mode 100644
-index 3cdece4..0000000
+index 13c0540..0000000
 --- a/src/python/export.py
 +++ /dev/null
-@@ -1,291 +0,0 @@
+@@ -1,292 +0,0 @@
 -#!/usr/bin/python3
 -###############################################################################
 -#                                                                             #
@@ -657,7 +657,6 @@ index 3cdece4..0000000
 -#                                                                             #
 -###############################################################################
 -
--import functools
 -import io
 -import ipaddress
 -import logging
@@ -699,6 +698,9 @@ index 3cdece4..0000000
 -              else:
 -                      self.f = io.StringIO()
 -
+-              # Tag
+-              self.tag = self._make_tag()
+-
 -              # Call any custom initialization
 -              self.init()
 -
@@ -714,8 +716,7 @@ index 3cdece4..0000000
 -      def __repr__(self):
 -              return "<%s %s f=%s>" % (self.__class__.__name__, self, self.f)
 -
--      @functools.cached_property
--      def tag(self):
+-      def _make_tag(self):
 -              families = {
 -                      socket.AF_INET6 : "6",
 -                      socket.AF_INET  : "4",
@@ -3876,10 +3877,10 @@ index 0000000..05f7872
 +              return True
 diff --git a/src/python/location/export.py b/src/python/location/export.py
 new file mode 100644
-index 0000000..3cdece4
+index 0000000..13c0540
 --- /dev/null
 +++ b/src/python/location/export.py
-@@ -0,0 +1,291 @@
+@@ -0,0 +1,292 @@
 +#!/usr/bin/python3
 +###############################################################################
 +#                                                                             #
@@ -3899,7 +3900,6 @@ index 0000000..3cdece4
 +#                                                                             #
 +###############################################################################
 +
-+import functools
 +import io
 +import ipaddress
 +import logging
@@ -3941,6 +3941,9 @@ index 0000000..3cdece4
 +              else:
 +                      self.f = io.StringIO()
 +
++              # Tag
++              self.tag = self._make_tag()
++
 +              # Call any custom initialization
 +              self.init()
 +
@@ -3956,8 +3959,7 @@ index 0000000..3cdece4
 +      def __repr__(self):
 +              return "<%s %s f=%s>" % (self.__class__.__name__, self, self.f)
 +
-+      @functools.cached_property
-+      def tag(self):
++      def _make_tag(self):
 +              families = {
 +                      socket.AF_INET6 : "6",
 +                      socket.AF_INET  : "4",
index 7e1ed4bfa4aec3357fa87eb260e02a867f4ff0f6..920dc84680c94462638f058e4383583f07686763 100644 (file)
@@ -1,2 +1,3 @@
+0000-Revert-configure-Require-Python-3.9.patch
 0001-Make-sources-around-that-we-can-run-tests-without-lo.patch
 0002-downloader-Fetch-__version__-from-C-module.patch