Christophe Giboudeaux 2020-11-21 12:58:33 +00:00 committed by Git OBS Bridge
parent 4d0d2d268d
commit 645e1aa4aa
9 changed files with 88 additions and 46 deletions

View File

@ -0,0 +1,44 @@
From 96ac04eca3444e8bed51daf3297d3e7b92089b93 Mon Sep 17 00:00:00 2001
From: Volker Krause <vkrause@kde.org>
Date: Sat, 14 Nov 2020 15:48:07 +0100
Subject: [PATCH] Disable Hafas binary journey queries on big endian systems
The current way or parsing those responses doesn't consider endianess at
all yet.
---
autotests/hafasqueryparsertest.cpp | 3 +++
src/lib/backends/hafasquerybackend.cpp | 4 ++++
2 files changed, 7 insertions(+)
diff --git a/autotests/hafasqueryparsertest.cpp b/autotests/hafasqueryparsertest.cpp
index a0838f1..3ded71e 100644
--- a/autotests/hafasqueryparsertest.cpp
+++ b/autotests/hafasqueryparsertest.cpp
@@ -35,6 +35,9 @@ private Q_SLOTS:
void testParseJourneyError()
{
+#if Q_BYTE_ORDER == Q_BIG_ENDIAN
+ QSKIP("not supported on big endian systems yet!", SkipAll);
+#endif
HafasQueryParser p;
const auto res = p.parseQueryJourneyResponse(readFile(SOURCE_DIR "/data/hafas/journey-binary-error.bin.gz"));
QVERIFY(res.empty());
diff --git a/src/lib/backends/hafasquerybackend.cpp b/src/lib/backends/hafasquerybackend.cpp
index ed68def..67fa65d 100644
--- a/src/lib/backends/hafasquerybackend.cpp
+++ b/src/lib/backends/hafasquerybackend.cpp
@@ -226,6 +226,10 @@ QString HafasQueryBackend::locationId(const Location &loc) const
bool HafasQueryBackend::queryJourney(const JourneyRequest &request, JourneyReply *reply, QNetworkAccessManager *nam) const
{
+#if Q_BYTE_ORDER == Q_BIG_ENDIAN
+#warning Hafas binary journey reponse parsing not implemented for big endian yet!
+ return false;
+#endif
if ((request.modes() & JourneySection::PublicTransport) == 0) {
return false;
}
--
2.29.2

View File

@ -1,13 +0,0 @@
<services>
<service name="obs_scm">
<param name="url">https://invent.kde.org/libraries/kpublictransport.git</param>
<param name="scm">git</param>
<param name="versionformat">0.0.1git.%ci~%h</param>
</service>
<service mode="buildtime" name="tar" />
<service mode="buildtime" name="recompress">
<param name="file">*.tar</param>
<param name="compression">xz</param>
</service>
<service mode="buildtime" name="set_version" />
</services>

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:eec6f5f94754a8fb87d83b7c8979060d4d0a30b188b0dc3e9f2523368f442d93
size 2881548

View File

@ -1,5 +0,0 @@
name: kpublictransport
version: 0.0.1git.20201108T190551~02631b5
mtime: 1604858751
commit: 02631b5699289c28f2984619e3e1a34cf061db9a

BIN
applications.keyring Normal file

Binary file not shown.

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ae26923f2c7452b3d0ad8013e8278f876fe46f52d062e0c760b1d8ec2acd6c00
size 344712

View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEyiYsbIPeTS+yijMqOmpNuDnqptcFAl+uonoACgkQOmpNuDnq
ptcEqw/8DUBd72s/CXLcHYgCfuT8+UgJFDeOKuJ2i7RipuQ5913UTW5faMVby25X
Dlkf0i52nBz/wbTjtKEfmkZT3BYwjQczlofNCcA9HIKILNB/Hv9ZZXKpNF6GA6un
0Mtud+kc0AounvGAq3QM5SZvxJDr2XxFAedp0CylvZ1BqBRL9ir0Ta31E3peMxui
/VOHHzVRqwy7vNwu713zK97PVteRK3TJ062F1hRokIJp0AmRKqa1Y2ige6G9/ASd
/4jY6jt7Zat/8m/mcloK+8HnZQ74Pm3Il76YNa7ISM38HEE5QYwIJ2CmeGVBqPK9
DLeUWRqw++q/Q0hAG7+up0/injPsn5KcFMi4ZEmUMJPzTGUuuNRyXkwuvRj2wq63
IF7rc+BnAqaFxxNxVUjanyoDA5KSaP6HuEz3YUqyzFsNWhWXTfz7XCe6TfW9AxpK
JXNI9cgci5IyqxTLHVla5Had/02AsbEMD6pqR7YVd/tKgNHgwXhCWmWCh/ftl9Pb
gHbwH2bP+nh5suFzX6yiroPByk+eJN6q6AJk1VgzxezKwCT/YZWhekIk5SBK8j4s
rhJNA/brxmaUf2vHPM3X5u05LKx3PYkyWz85AQg62tc/Kf0PvMR0QK27v9ESF1CC
3d35aB1fDpv93XPKswgUrB/1vq09fXUIg8wnHPPvoe854f9QNy4=
=aUwU
-----END PGP SIGNATURE-----

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Sat Nov 14 12:24:00 UTC 2020 - Christophe Giboudeaux <christophe@krop.fr>
- Update to 20.11.80.
* New feature release
- kpublictransport is now released using the KDE release service.
- Add upstream patch:
* 0001-Disable-Hafas-binary-journey-queries-on-big-endian-s.patch
-------------------------------------------------------------------
Mon Jul 22 07:46:15 UTC 2019 - Fabian Vogt <fabian@ritter-vogt.de>

View File

@ -16,29 +16,33 @@
#
%global sover 0
%global fullsover 0.0.1
%global sover 20
%global lname libKPublicTransport%{sover}
# Latest stable Applications (e.g. 17.08 in KA, but 17.11.80 in KUA)
%{!?_kapp_version: %define _kapp_version %(echo %{version}| awk -F. '{print $1"."$2}')}
%bcond_without lang
Name: kpublictransport
Version: 0.0.1
Version: 20.11.80
Release: 0
Summary: QML imports for querying public transport data
License: LGPL-2.0-or-later
Group: System/GUI/KDE
URL: https://www.kde.org
# Not there yet
Source: %{name}-%{version}.tar.xz
Source0: https://download.kde.org/unstable/release-service/%{version}/src/%{name}-%{version}.tar.xz
%if %{with lang}
Source1: https://download.kde.org/unstable/release-service/%{version}/src/%{name}-%{version}.tar.xz.sig
Source2: applications.keyring
%endif
# PATCH-FIX-UPSTREAM
Patch0: 0001-Disable-Hafas-binary-journey-queries-on-big-endian-s.patch
BuildRequires: bison
BuildRequires: cmake >= 3.5
BuildRequires: extra-cmake-modules
BuildRequires: fdupes
BuildRequires: flex
BuildRequires: kf5-filesystem
BuildRequires: pkgconfig
BuildRequires: cmake(Qt5Quick) >= 5.10.0
BuildRequires: cmake(Qt5Test) >= 5.10.0
BuildRequires: cmake(Qt5Widgets) >= 5.10.0
BuildRequires: cmake(Qt5Quick) >= 5.11.0
BuildRequires: cmake(Qt5Test) >= 5.11.0
BuildRequires: cmake(Qt5Widgets) >= 5.11.0
BuildRequires: pkgconfig(zlib)
Requires: %{lname} = %{version}
@ -65,8 +69,6 @@ Requires: cmake(Qt5Gui)
A library for access realtime public transport data and for performing public
ransport journey queries.Development files.
%lang_package -n %{lname}
%prep
%autosetup -p1
@ -76,23 +78,13 @@ ransport journey queries.Development files.
%install
%kf5_makeinstall -C build
%if %{with lang}
# Fill once released
# %find_lang %{name} --with-man --all-name
%endif
%check
export CTEST_OUTPUT_ON_FAILURE=1
export QT_QPA_PLATFORM=offscreen
%make_build -C build test
%ctest
%post -n %{lname} -p /sbin/ldconfig
%postun -n %{lname} -p /sbin/ldconfig
%if %{with lang}
%files -n %{lname}-lang -f %{name}.lang
%endif
%files
%license LICENSES/*
%dir %{_kf5_qmldir}/org/
@ -102,8 +94,7 @@ export QT_QPA_PLATFORM=offscreen
%files -n %{lname}
%license LICENSES/*
%{_kf5_debugdir}/org_kde_kpublictransport.categories
%{_kf5_libdir}/libKPublicTransport.so.%{fullsover}
%{_kf5_libdir}/libKPublicTransport.so.%{sover}
%{_kf5_libdir}/libKPublicTransport.so.*
%files devel
%license LICENSES/*