Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package kitinerary for openSUSE:Factory checked in at 2022-02-04 21:46:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kitinerary (Old) and /work/SRC/openSUSE:Factory/.kitinerary.new.1898 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kitinerary" Fri Feb 4 21:46:57 2022 rev:44 rq:951052 version:21.12.2 Changes: -------- --- /work/SRC/openSUSE:Factory/kitinerary/kitinerary.changes 2022-01-11 21:15:57.932819389 +0100 +++ /work/SRC/openSUSE:Factory/.kitinerary.new.1898/kitinerary.changes 2022-02-04 21:47:36.337118871 +0100 @@ -1,0 +2,16 @@ +Tue Feb 1 13:03:07 UTC 2022 - Christophe Giboudeaux <christo...@krop.fr> + +- Update to 21.12.2 + * New bugfix release + * For more details please see: + * https://kde.org/announcements/gear/21.12.2/ +- Changes since 21.12.1: + * Round up when converting vector bounding box to integers + * Include the pen width in computing vector bounding boxes + * Only consider rectangular strokes for the PDF vector barcode detection + * Fix build against KF5.91+ + * Add extractor script for Skymark booking emails + * Normalize flight numbers during post-processing + * Make the same city detection consider more information + +------------------------------------------------------------------- Old: ---- kitinerary-21.12.1.tar.xz kitinerary-21.12.1.tar.xz.sig New: ---- kitinerary-21.12.2.tar.xz kitinerary-21.12.2.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kitinerary.spec ++++++ --- /var/tmp/diff_new_pack.IiVTBN/_old 2022-02-04 21:47:37.009114284 +0100 +++ /var/tmp/diff_new_pack.IiVTBN/_new 2022-02-04 21:47:37.013114256 +0100 @@ -18,7 +18,7 @@ %bcond_without released Name: kitinerary -Version: 21.12.1 +Version: 21.12.2 Release: 0 Summary: Data model and extraction system for travel reservations License: LGPL-2.1-or-later ++++++ kitinerary-21.12.1.tar.xz -> kitinerary-21.12.2.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitinerary-21.12.1/CMakeLists.txt new/kitinerary-21.12.2/CMakeLists.txt --- old/kitinerary-21.12.1/CMakeLists.txt 2022-01-03 23:00:07.000000000 +0100 +++ new/kitinerary-21.12.2/CMakeLists.txt 2022-01-29 00:31:44.000000000 +0100 @@ -3,7 +3,7 @@ # SPDX-License-Identifier: BSD-3-Clause cmake_minimum_required(VERSION 3.16 FATAL_ERROR) -set(PIM_VERSION "5.19.1") +set(PIM_VERSION "5.19.2") project(KItinerary VERSION ${PIM_VERSION}) set(KF5_MIN_VERSION "5.87.0") @@ -40,8 +40,8 @@ find_package(SharedMimeInfo 1.3 REQUIRED) endif() -set(KMIME_VERSION "5.19.1") -set(PIM_PKPASS "5.19.1") +set(KMIME_VERSION "5.19.2") +set(PIM_PKPASS "5.19.2") find_package(KF5Mime ${KMIME_VERSION} CONFIG REQUIRED) find_package(KF5CalendarCore ${KF5_MIN_VERSION} CONFIG) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitinerary-21.12.1/autotests/locationutiltest.cpp new/kitinerary-21.12.2/autotests/locationutiltest.cpp --- old/kitinerary-21.12.1/autotests/locationutiltest.cpp 2022-01-03 23:00:07.000000000 +0100 +++ new/kitinerary-21.12.2/autotests/locationutiltest.cpp 2022-01-29 00:31:44.000000000 +0100 @@ -80,6 +80,20 @@ QVERIFY(!LocationUtil::isSameLocation(txl, sxf, LocationUtil::Exact)); QVERIFY(!LocationUtil::isSameLocation(txl, {}, LocationUtil::CityLevel)); QVERIFY(!LocationUtil::isSameLocation({}, sxf, LocationUtil::Exact)); + + + GeoCoordinates mnhCoord({49.47922, 8.46941}); + GeoCoordinates lwhCoord({49.47716, 8.43406}); + TrainStation mnh; + mnh.setGeo(mnhCoord); + TrainStation lwh; + lwh.setGeo(lwhCoord); + QVERIFY(LocationUtil::isSameLocation(mnh, lwh, LocationUtil::CityLevel)); // wrong, but we have no other information + mnh.setName(_("Mannheim Hbf")); + lwh.setName(_("Ludwigshafen (Rhein) Hauptbahnhof")); + QVERIFY(!LocationUtil::isSameLocation(mnh, lwh, LocationUtil::CityLevel)); + lwh.setName(_("Mannheim (Rhein) West")); + QVERIFY(LocationUtil::isSameLocation(mnh, lwh, LocationUtil::CityLevel)); } void testLocationNameCompare_data() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitinerary-21.12.1/po/ca/kitinerary.po new/kitinerary-21.12.2/po/ca/kitinerary.po --- old/kitinerary-21.12.1/po/ca/kitinerary.po 2022-01-04 01:25:41.000000000 +0100 +++ new/kitinerary-21.12.2/po/ca/kitinerary.po 2022-02-01 01:16:37.000000000 +0100 @@ -177,28 +177,3 @@ "Refer??ncia de la reserva: %1\n" "Sota el nom: %2\n" "Lloc de la recollida: %3" - -#~ msgid "Reservation reference: %1" -#~ msgstr "Refer??ncia de la reserva: %1" - -#~| msgid "" -#~| "Reservation reference: %1\n" -#~| "Under name: %2\n" -#~| "\n" -#~| "PickUp location: %3\n" -#~| "\n" -#~| "Dropoff Location: %4" -#~ msgid "" -#~ "Reservation reference: %1\n" -#~ "Under name: %2\n" -#~ "\n" -#~ "Pickup location: %3\n" -#~ "\n" -#~ "Dropoff location: %4" -#~ msgstr "" -#~ "Refer??ncia de la reserva: %1\n" -#~ "Sota el nom: %2\n" -#~ "\n" -#~ "Lloc de la recollida: %3\n" -#~ "\n" -#~ "Lloc de l'entrega: %4" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitinerary-21.12.1/po/ca@valencia/kitinerary.po new/kitinerary-21.12.2/po/ca@valencia/kitinerary.po --- old/kitinerary-21.12.1/po/ca@valencia/kitinerary.po 2022-01-04 01:25:41.000000000 +0100 +++ new/kitinerary-21.12.2/po/ca@valencia/kitinerary.po 2022-02-01 01:16:37.000000000 +0100 @@ -177,28 +177,3 @@ "Refer??ncia de la reserva: %1\n" "Sota el nom: %2\n" "Lloc de la recollida: %3" - -#~ msgid "Reservation reference: %1" -#~ msgstr "Refer??ncia de la reserva: %1" - -#~| msgid "" -#~| "Reservation reference: %1\n" -#~| "Under name: %2\n" -#~| "\n" -#~| "PickUp location: %3\n" -#~| "\n" -#~| "Dropoff Location: %4" -#~ msgid "" -#~ "Reservation reference: %1\n" -#~ "Under name: %2\n" -#~ "\n" -#~ "Pickup location: %3\n" -#~ "\n" -#~ "Dropoff location: %4" -#~ msgstr "" -#~ "Refer??ncia de la reserva: %1\n" -#~ "Sota el nom: %2\n" -#~ "\n" -#~ "Lloc de la recollida: %3\n" -#~ "\n" -#~ "Lloc de l'entrega: %4" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitinerary-21.12.1/po/zh_CN/kitinerary.po new/kitinerary-21.12.2/po/zh_CN/kitinerary.po --- old/kitinerary-21.12.1/po/zh_CN/kitinerary.po 2022-01-04 01:25:41.000000000 +0100 +++ new/kitinerary-21.12.2/po/zh_CN/kitinerary.po 2022-02-01 01:16:37.000000000 +0100 @@ -8,7 +8,7 @@ "Project-Id-Version: kdeorg\n" "Report-Msgid-Bugs-To: https://bugs.kde.org\n" "POT-Creation-Date: 2021-08-15 00:19+0000\n" -"PO-Revision-Date: 2021-12-22 14:09\n" +"PO-Revision-Date: 2022-01-08 15:25\n" "Last-Translator: \n" "Language-Team: Chinese Simplified\n" "Language: zh_CN\n" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitinerary-21.12.1/src/cli/org.kde.kitinerary-extractor.appdata.xml new/kitinerary-21.12.2/src/cli/org.kde.kitinerary-extractor.appdata.xml --- old/kitinerary-21.12.1/src/cli/org.kde.kitinerary-extractor.appdata.xml 2022-01-03 23:00:07.000000000 +0100 +++ new/kitinerary-21.12.2/src/cli/org.kde.kitinerary-extractor.appdata.xml 2022-01-29 00:31:44.000000000 +0100 @@ -101,9 +101,9 @@ <binary>kitinerary-extractor</binary> </provides> <releases> + <release version="5.19.2" date="2022-02-03"/> <release version="5.19.1" date="2022-01-06"/> <release version="5.19.0" date="2021-12-09"/> <release version="5.18.3" date="2021-11-04"/> - <release version="5.18.2" date="2021-10-07"/> </releases> </component> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitinerary-21.12.1/src/lib/CMakeLists.txt new/kitinerary-21.12.2/src/lib/CMakeLists.txt --- old/kitinerary-21.12.1/src/lib/CMakeLists.txt 2022-01-03 23:00:07.000000000 +0100 +++ new/kitinerary-21.12.2/src/lib/CMakeLists.txt 2022-01-29 00:31:44.000000000 +0100 @@ -167,11 +167,11 @@ PUBLIC Qt::Core KF5::Mime + KF5::I18n # for ki18n_version.h in semi-public headers, needed for KF5.91+, not needed in master anymore PRIVATE Qt::Qml Qt::QmlPrivate KF5::Archive - KF5::I18n KF5::Contacts KPim::PkPass OpenSSL::Crypto diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitinerary-21.12.1/src/lib/flightpostprocessor.cpp new/kitinerary-21.12.2/src/lib/flightpostprocessor.cpp --- old/kitinerary-21.12.1/src/lib/flightpostprocessor.cpp 2022-01-03 23:00:07.000000000 +0100 +++ new/kitinerary-21.12.2/src/lib/flightpostprocessor.cpp 2022-01-29 00:31:44.000000000 +0100 @@ -41,6 +41,7 @@ flight = ExtractorUtil::extractTerminals(flight); flight.setDepartureTerminal(flight.departureTerminal().simplified()); flight.setArrivalTerminal(flight.arrivalTerminal().simplified()); + flight.setFlightNumber(flight.flightNumber().simplified()); // arrival less than a day before departure is an indication of the extractor failing to detect day rollover if (duration < 0 && duration > -3600*24) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitinerary-21.12.1/src/lib/locationutil.cpp new/kitinerary-21.12.2/src/lib/locationutil.cpp --- old/kitinerary-21.12.1/src/lib/locationutil.cpp 2022-01-03 23:00:07.000000000 +0100 +++ new/kitinerary-21.12.2/src/lib/locationutil.cpp 2022-01-29 00:31:44.000000000 +0100 @@ -210,8 +210,6 @@ static bool isSameLocationName(const QString &lhs, const QString &rhs, LocationUtil::Accuracy accuracy) { - Q_UNUSED(accuracy) // TODO for city level we can strip station or airport suffixes for example - if (lhs.isEmpty() || rhs.isEmpty()) { return false; } @@ -221,13 +219,30 @@ return true; } - // check if any of the unicode normalization approaches helps + // check if any of the Unicode normalization approaches helps const auto lhsNormalized = stripDiacritics(lhs); const auto rhsNormalized = stripDiacritics(rhs); const auto lhsTransliterated = applyTransliterations(lhs); const auto rhsTransliterated = applyTransliterations(rhs); - return lhsNormalized.compare(rhsNormalized, Qt::CaseInsensitive) == 0 || lhsNormalized.compare(rhsTransliterated, Qt::CaseInsensitive) == 0 - || lhsTransliterated.compare(rhsNormalized, Qt::CaseInsensitive) == 0 || lhsTransliterated.compare(rhsTransliterated, Qt::CaseInsensitive) == 0; + if (lhsNormalized.compare(rhsNormalized, Qt::CaseInsensitive) == 0 || lhsNormalized.compare(rhsTransliterated, Qt::CaseInsensitive) == 0 + || lhsTransliterated.compare(rhsNormalized, Qt::CaseInsensitive) == 0 || lhsTransliterated.compare(rhsTransliterated, Qt::CaseInsensitive) == 0) { + return true; + } + + if (accuracy == LocationUtil::CityLevel) { + // check for a common prefix + bool foundSeparator = false; + for (auto i = 0; i < std::min(lhsNormalized.size(), rhsNormalized.size()); ++i) { + if (lhsNormalized[i] != rhsNormalized[i]) { + return foundSeparator; + } + foundSeparator |= !lhsNormalized[i].isLetter(); + } + + return lhsNormalized.startsWith(rhsNormalized) || rhsNormalized.startsWith(lhsNormalized); + } + + return false; } bool LocationUtil::isSameLocation(const QVariant &lhs, const QVariant &rhs, LocationUtil::Accuracy accuracy) @@ -246,10 +261,17 @@ return d < (isAirport ? 2000 : 1000); } case CityLevel: - return d < 50000; + if (d >= 50000) { + return false; + } + if (d < 2000) { + return true; + } + if (d < 50000 && address(lhs).addressLocality().isEmpty() && name(lhs).isEmpty()) { + return true; + } break; } - return false; } const auto lhsAddr = address(lhs); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitinerary-21.12.1/src/lib/pdf/pdfextractoroutputdevice.cpp new/kitinerary-21.12.2/src/lib/pdf/pdfextractoroutputdevice.cpp --- old/kitinerary-21.12.1/src/lib/pdf/pdfextractoroutputdevice.cpp 2022-01-03 23:00:07.000000000 +0100 +++ new/kitinerary-21.12.2/src/lib/pdf/pdfextractoroutputdevice.cpp 2022-01-29 00:31:44.000000000 +0100 @@ -92,6 +92,34 @@ return !qFuzzyCompare(pen.widthF(), 0.0) && pen.color() == Qt::black; } +static bool isRectangularPath(const QPainterPath &path) +{ + qreal x = 0.0, y = 0.0; + for (int i = 0; i < path.elementCount(); ++i) { + const auto elem = path.elementAt(i); + switch (elem.type) { + case QPainterPath::MoveToElement: + x = elem.x; + y = elem.y; + break; + case QPainterPath::LineToElement: + if (x != elem.x && y != elem.y) { + qDebug() << "path contains diagonal line, discarding"; + return false; + } + x = elem.x; + y = elem.y; + break; + case QPainterPath::CurveToElement: + case QPainterPath::CurveToDataElement: + qDebug() << "path contains a curve, discarding"; + return false; + } + } + + return true; +} + void PdfExtractorOutputDevice::stroke(GfxState *state) { const auto pen = PopplerUtils::currentPen(state); @@ -100,6 +128,9 @@ } const auto path = PopplerUtils::convertPath(state->getPath(), Qt::WindingFill); + if (!isRectangularPath(path)) { + return; + } const auto t = PopplerUtils::currentTransform(state); m_vectorOps.push_back(VectorOp{VectorOp::Path, t, {path, pen, QBrush()}}); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitinerary-21.12.1/src/lib/pdf/pdfvectorpicture.cpp new/kitinerary-21.12.2/src/lib/pdf/pdfvectorpicture.cpp --- old/kitinerary-21.12.1/src/lib/pdf/pdfvectorpicture.cpp 2022-01-03 23:00:07.000000000 +0100 +++ new/kitinerary-21.12.2/src/lib/pdf/pdfvectorpicture.cpp 2022-01-29 00:31:44.000000000 +0100 @@ -59,10 +59,15 @@ if (d->strokes.empty()) { return {}; } + + double maxPenWidth = 0.0; if (d->boundingRect.isEmpty()) { for (const auto &stroke : d->strokes) { d->boundingRect = d->boundingRect.united(stroke.path.boundingRect()); + maxPenWidth = std::max(maxPenWidth, stroke.pen.widthF()); } + // include the pen width, for strokes drawn on the boundary + d->boundingRect.adjust(-maxPenWidth, -maxPenWidth, maxPenWidth, maxPenWidth); } return d->boundingRect; @@ -102,8 +107,8 @@ if (d->image.isNull()) { bool shouldFlip = false; const double scale = (RenderDPI / 72.0) * scaleFromTransform(d->transform, &shouldFlip); // 1/72 dpi is the unit for the vector coordinates - const int width = boundingRect().width() * scale; - const int height = boundingRect().height() * scale; + const int width = std::ceil(boundingRect().width() * scale); + const int height = std::ceil(boundingRect().height() * scale); d->image = QImage(width, height, QImage::Format_Grayscale8); d->image.fill(Qt::white); QPainter p(&d->image); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitinerary-21.12.1/src/lib/scripts/extractors.qrc new/kitinerary-21.12.2/src/lib/scripts/extractors.qrc --- old/kitinerary-21.12.1/src/lib/scripts/extractors.qrc 2022-01-03 23:00:07.000000000 +0100 +++ new/kitinerary-21.12.2/src/lib/scripts/extractors.qrc 2022-01-29 00:31:44.000000000 +0100 @@ -115,6 +115,8 @@ <file>sas-receipt.js</file> <file>simplebooking.json</file> <file>simplebooking.js</file> + <file>skymark.json</file> + <file>skymark.js</file> <file>sncb.json</file> <file>sncb.js</file> <file>sncf.json</file> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitinerary-21.12.1/src/lib/scripts/skymark.js new/kitinerary-21.12.2/src/lib/scripts/skymark.js --- old/kitinerary-21.12.1/src/lib/scripts/skymark.js 1970-01-01 01:00:00.000000000 +0100 +++ new/kitinerary-21.12.2/src/lib/scripts/skymark.js 2022-01-29 00:31:44.000000000 +0100 @@ -0,0 +1,29 @@ +/* + SPDX-FileCopyrightText: 2022 Volker Krause <vkra...@kde.org> + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +function parseBooking(content) { + var baseRes = JsonLd.newFlightReservation(); + const flight = content.match(/(\d{1,2}\w{3}\d{4}) Flight No.([A-Z0-9 ]+) \[.*:([^\]]+)\]\n.*from (.*) at (\d{2}:\d{2}) -> .* at (.*) at (\d{2}:\d{2})/); + baseRes.reservationNumber = flight[3]; + baseRes.reservationFor.flightNumber = flight[2]; + baseRes.reservationFor.departureAirport.name = flight[4]; + baseRes.reservationFor.departureTime = JsonLd.toDateTime(flight[1] + flight[5], "ddMMMyyyyhh:mm", "en"); + baseRes.reservationFor.arrivalAirport.name = flight[6]; + baseRes.reservationFor.arrivalTime = JsonLd.toDateTime(flight[1] + flight[7], "ddMMMyyyyhh:mm", "en"); + + var reservations = new Array(); + const passengers = content.match(/-Passengers\n([\s\S]*?)\n-/)[1].split(/\n/); + for (const passenger of passengers) { + const name = passenger.match(/M[a-z]+\.(.*)\(/); + if (!name) { + break; + } + var res = JsonLd.clone(baseRes); + res.underName.name = name[1]; + reservations.push(res); + } + + return reservations; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitinerary-21.12.1/src/lib/scripts/skymark.json new/kitinerary-21.12.2/src/lib/scripts/skymark.json --- old/kitinerary-21.12.1/src/lib/scripts/skymark.json 1970-01-01 01:00:00.000000000 +0100 +++ new/kitinerary-21.12.2/src/lib/scripts/skymark.json 2022-01-29 00:31:44.000000000 +0100 @@ -0,0 +1,13 @@ +{ + "filter": [ + { + "field": "From", + "match": "rese...@skymark.jp", + "mimeType": "message/rfc822", + "scope": "Parent" + } + ], + "function": "parseBooking", + "mimeType": "text/plain", + "script": "skymark.js" +}