/libloc-0.9.15.tar.gz
/libloc-0.9.16.tar.gz
+/libloc-0.9.17.tar.gz
+++ /dev/null
-From efaa883cbf89e1db6695b6cc0119eeea62256abd Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
-Date: Mon, 24 Jul 2023 10:57:49 +0200
-Subject: [PATCH] Fix string escaping in location tool
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Python 3.12 started to warn on an invalid string escape sequence:
-
-$ location list-networks-by-as --format ipset 1
-/usr/bin/location:583: SyntaxWarning: invalid escape sequence '\d'
- m = re.match("^AS(\d+)$", object)
-IpsetOutputWriter requires family being set
-
-This patch fixes the warning as well as the regular expression by
-using a raw string.
-
-<https://docs.python.org/3.12/whatsnew/changelog.html#id77>
-
-Signed-off-by: Petr Písař <ppisar@redhat.com>
----
- src/scripts/location.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/scripts/location.in b/src/scripts/location.in
-index 60b11d6..b34cc91 100644
---- a/src/scripts/location.in
-+++ b/src/scripts/location.in
-@@ -580,7 +580,7 @@ class CLI(object):
- families = [ socket.AF_INET6, socket.AF_INET ]
-
- for object in ns.objects:
-- m = re.match("^AS(\d+)$", object)
-+ m = re.match(r"^AS(\d+)$", object)
- if m:
- object = int(m.group(1))
-
---
-2.41.0
-
+++ /dev/null
-From 1f2ece2868f370bda1c4c01be401bcfb137f383d Mon Sep 17 00:00:00 2001
-From: Michael Tremer <michael.tremer@ipfire.org>
-Date: Mon, 3 Jul 2023 15:05:13 +0000
-Subject: [PATCH 2/2] export: Raise an error when trying to export ipset for
- both families
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
-Signed-off-by: Petr Písař <ppisar@redhat.com>
----
- src/python/location/export.py | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/src/python/location/export.py b/src/python/location/export.py
-index 25a532e..1d147b1 100644
---- a/src/python/location/export.py
-+++ b/src/python/location/export.py
-@@ -147,6 +147,10 @@ class IpsetOutputWriter(OutputWriter):
- # Count all networks
- self.networks = 0
-
-+ # Check that family is being set
-+ if not self.family:
-+ raise ValueError("%s requires family being set" % self.__class__.__name__)
-+
- @property
- def hashsize(self):
- """
---
-2.41.0
-
+++ /dev/null
-From 76852f60da75827f1296358e6be511a04355d073 Mon Sep 17 00:00:00 2001
-From: Michael Tremer <michael.tremer@ipfire.org>
-Date: Mon, 3 Jul 2023 14:53:50 +0000
-Subject: [PATCH 1/2] location: Fix correct set name when family is selected
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This does however not fix the problem if no --family= parameter is being
-given because we will then export for multiple families in one file.
-
-This is for example not supported for ipset.
-
-Fixes: #12897
-Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
-Signed-off-by: Petr Písař <ppisar@redhat.com>
----
- src/scripts/location.in | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/src/scripts/location.in b/src/scripts/location.in
-index be13156..60b11d6 100644
---- a/src/scripts/location.in
-+++ b/src/scripts/location.in
-@@ -514,7 +514,7 @@ class CLI(object):
- writer = self.__get_output_formatter(ns)
-
- for asn in ns.asn:
-- f = writer("AS%s" % asn, f=sys.stdout)
-+ f = writer("AS%s" % asn, family=ns.family, f=sys.stdout)
-
- # Print all matching networks
- for n in db.search_networks(asns=[asn], family=ns.family):
-@@ -527,7 +527,7 @@ class CLI(object):
-
- for country_code in ns.country_code:
- # Open standard output
-- f = writer(country_code, f=sys.stdout)
-+ f = writer(country_code, family=ns.family, f=sys.stdout)
-
- # Print all matching networks
- for n in db.search_networks(country_codes=[country_code], family=ns.family):
-@@ -554,7 +554,7 @@ class CLI(object):
- raise ValueError(_("You must at least pass one flag"))
-
- writer = self.__get_output_formatter(ns)
-- f = writer("custom", f=sys.stdout)
-+ f = writer("custom", family=ns.family, f=sys.stdout)
-
- for n in db.search_networks(flags=flags, family=ns.family):
- f.write(n)
-@@ -563,7 +563,7 @@ class CLI(object):
-
- def handle_list_bogons(self, db, ns):
- writer = self.__get_output_formatter(ns)
-- f = writer("bogons", f=sys.stdout)
-+ f = writer("bogons", family=ns.family, f=sys.stdout)
-
- for n in db.list_bogons(family=ns.family):
- f.write(n)
---
-2.41.0
-
Name: libloc
-Version: 0.9.16
-Release: 2%{?dist}
+Version: 0.9.17
+Release: 1%{?dist}
Summary: Library to determine a location of an IP address in the Internet
+# bash-completion/location: LGPL-2.1-or-later
# COPYING: LGPL-2.1 text
# data/database.db: CC-BY-SA-4.0
# man/libloc.txt: LGPL-2.1-or-later
License: LGPL-2.1-or-later
URL: https://location.ipfire.org/
Source0: https://source.ipfire.org/releases/%{name}/%{name}-%{version}.tar.gz
-# 1/2 Fix "location list-networks-by-as --format ipset" output,
-# in upstream after 0.9.16, upstream bug #12897
-Patch0: libloc-0.9.16-location-Fix-correct-set-name-when-family-is-selecte.patch
-# 2/2 Fix "location list-networks-by-as --format ipset" output,
-# in upstream after 0.9.16, upstream bug #12897
-Patch1: libloc-0.9.16-export-Raise-an-error-when-trying-to-export-ipset-fo.patch
-# Fix string escaping with Python 3.12, in upstream after 0.9.16,
-# upstream bug #13188
-Patch2: libloc-0.9.16-Fix-string-escaping-in-location-tool.patch
BuildRequires: asciidoc
BuildRequires: autoconf >= 2.60
# autoconf-archive for unbundled m4/ax_prog_perl_modules.m4
BuildRequires: pkgconf-m4
# pkgconf-pkg-config for pkg-config program
BuildRequires: pkgconf-pkg-config
+BuildRequires: pkgconfig(bash-completion)
BuildRequires: pkgconfig(libsystemd)
BuildRequires: pkgconfig(python) >= 3.4
# pkgconfig(systemd) not needed, we configure a value from systemd-rpm-macros
Summary: Tools for downloading and querying IPFire Location database
BuildArch: noarch
Requires: python3-%{name} = %{version}-%{release}
+Recommends: %{name}-tools-bash-completion = %{version}-%{release}
%description tools
"location" program retrieves information from the location database. This data
countries. There is also an integration with systemd which helps updating the
location database periodically.
+%package tools-bash-completion
+Summary: Bash completion support for IPFire location tools
+BuildArch: noarch
+Requires: bash-completion
+Requires: %{name}-tools = %{version}-%{release}
+
+%description tools-bash-completion
+This package implements Bash completion scripts for IPFire location tools.
+
%prep
%autosetup -p1
# Unbundle m4 macros
%global default_database_file %{_sharedstatedir}/location/database.db
%{configure} \
--disable-analyzer \
+ --enable-bash-completion \
--with-database-path=%{default_database_file} \
--enable-debug \
--enable-largefile \
%files -f %{name}.lang
%license COPYING
+%doc debian/changelog
%{_libdir}/libloc.so.1*
%files devel
%files tools
%{_bindir}/location*
%{_mandir}/man1/location.1*
-%{_unitdir}/*
+%{_unitdir}/location-update.*
+
+%files tools-bash-completion
+%{_datadir}/bash-completion/completions/location
%changelog
+* Tue Aug 01 2023 Petr Pisar <ppisar@redhat.com> - 0.9.17-1
+- 0.9.17 bump
+
* Mon Jul 24 2023 Petr Pisar <ppisar@redhat.com> - 0.9.16-2
- Fix "location list-networks-by-as --format ipset" output
(upstream bug #12897)
-SHA512 (libloc-0.9.16.tar.gz) = 4a4800d8638244917de8f41d75aff289b60b35e8c5b9546e68f78aab29b2f05d0db383b8403bf93a0e0fdf3916e56eb4f8b10fd9771826d85d49bc7b4917558b
+SHA512 (libloc-0.9.17.tar.gz) = 91086f28f49c49db8c511170340678ef34ada81499ad7a2c91da8db17605094beac668eca9582679960553aae57b8653ec353553377b580721f97abb0f5b2e98