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-01-11 21:15:06 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kitinerary (Old) and /work/SRC/openSUSE:Factory/.kitinerary.new.1892 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kitinerary" Tue Jan 11 21:15:06 2022 rev:43 rq:944341 version:21.12.1 Changes: -------- --- /work/SRC/openSUSE:Factory/kitinerary/kitinerary.changes 2021-12-13 20:40:31.476456621 +0100 +++ /work/SRC/openSUSE:Factory/.kitinerary.new.1892/kitinerary.changes 2022-01-11 21:15:57.932819389 +0100 @@ -1,0 +2,15 @@ +Tue Jan 4 10:25:47 UTC 2022 - Christophe Giboudeaux <christo...@krop.fr> + +- Update to 21.12.1 + * New bugfix release + * For more details please see: + * https://kde.org/announcements/gear/21.12.1/ +- Changes since 21.12.0: + * Fixes for vitolus extractor + * Extract UIC operator code from SNCF TER barcodes + * Make proper json + * Find more reservation number variants in SNCF TER PDF tickets + * Add extractor script for Amtrak tickets + * Make the VIA Rail extractor work both with a full PDF or just the barcode + +------------------------------------------------------------------- Old: ---- kitinerary-21.12.0.tar.xz kitinerary-21.12.0.tar.xz.sig New: ---- kitinerary-21.12.1.tar.xz kitinerary-21.12.1.tar.xz.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kitinerary.spec ++++++ --- /var/tmp/diff_new_pack.QtGHo6/_old 2022-01-11 21:15:58.568819836 +0100 +++ /var/tmp/diff_new_pack.QtGHo6/_new 2022-01-11 21:15:58.572819839 +0100 @@ -16,16 +16,16 @@ # -%bcond_without lang +%bcond_without released Name: kitinerary -Version: 21.12.0 +Version: 21.12.1 Release: 0 Summary: Data model and extraction system for travel reservations License: LGPL-2.1-or-later Group: System/GUI/KDE URL: https://www.kde.org Source: https://download.kde.org/stable/release-service/%{version}/src/%{name}-%{version}.tar.xz -%if %{with lang} +%if %{with released} Source1: https://download.kde.org/stable/release-service/%{version}/src/%{name}-%{version}.tar.xz.sig Source2: applications.keyring %endif @@ -92,7 +92,7 @@ %install %kf5_makeinstall -C build -%if %{with lang} +%if %{with released} %find_lang %{name} --with-man --with-qt --all-name %endif @@ -119,7 +119,7 @@ %{_kf5_cmakedir}/KPimItinerary/ %{_kf5_libdir}/libKPimItinerary.so -%if %{with lang} +%if %{with released} %files -n libKPimItinerary5-lang -f %{name}.lang %endif ++++++ kitinerary-21.12.0.tar.xz -> kitinerary-21.12.1.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitinerary-21.12.0/CMakeLists.txt new/kitinerary-21.12.1/CMakeLists.txt --- old/kitinerary-21.12.0/CMakeLists.txt 2021-11-30 22:49:45.000000000 +0100 +++ new/kitinerary-21.12.1/CMakeLists.txt 2022-01-03 23:00:07.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.0") +set(PIM_VERSION "5.19.1") 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.0") -set(PIM_PKPASS "5.19.0") +set(KMIME_VERSION "5.19.1") +set(PIM_PKPASS "5.19.1") 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.0/po/fr/kitinerary.po new/kitinerary-21.12.1/po/fr/kitinerary.po --- old/kitinerary-21.12.0/po/fr/kitinerary.po 2021-12-03 01:17:56.000000000 +0100 +++ new/kitinerary-21.12.1/po/fr/kitinerary.po 2022-01-04 01:25:41.000000000 +0100 @@ -6,7 +6,7 @@ "Project-Id-Version: desktop files\n" "Report-Msgid-Bugs-To: https://bugs.kde.org\n" "POT-Creation-Date: 2021-08-15 00:19+0000\n" -"PO-Revision-Date: 2021-07-16 10:26+0200\n" +"PO-Revision-Date: 2021-12-27 22:06+0100\n" "Last-Translator: Xavier Besnard <xavier.besn...@neuf.fr>\n" "Language-Team: French <kde-francoph...@kde.org>\n" "Language: fr\n" @@ -14,7 +14,7 @@ "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -"X-Generator: Lokalize 21.04.3\n" +"X-Generator: Lokalize 21.12.0\n" "X-Environment: kde\n" "X-Accelerator-Marker: &\n" "X-Text-Markup: kde4\n" @@ -121,7 +121,7 @@ #: calendarhandler.cpp:360 #, kde-format msgid "Website: %1" -msgstr "Site internet??: %1" +msgstr "Site internet??: %1" #: calendarhandler.cpp:403 #, kde-format diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitinerary-21.12.0/po/zh_CN/kitinerary.po new/kitinerary-21.12.1/po/zh_CN/kitinerary.po --- old/kitinerary-21.12.0/po/zh_CN/kitinerary.po 2021-12-03 01:17:56.000000000 +0100 +++ new/kitinerary-21.12.1/po/zh_CN/kitinerary.po 2022-01-04 01:25:41.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-11-30 15:23\n" +"PO-Revision-Date: 2021-12-22 14:09\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.0/src/cli/org.kde.kitinerary-extractor.appdata.xml new/kitinerary-21.12.1/src/cli/org.kde.kitinerary-extractor.appdata.xml --- old/kitinerary-21.12.0/src/cli/org.kde.kitinerary-extractor.appdata.xml 2021-11-30 22:49:45.000000000 +0100 +++ new/kitinerary-21.12.1/src/cli/org.kde.kitinerary-extractor.appdata.xml 2022-01-03 23:00:07.000000000 +0100 @@ -101,9 +101,9 @@ <binary>kitinerary-extractor</binary> </provides> <releases> + <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"/> - <release version="5.18.1" date="2021-09-02"/> - <release version="5.18.0" date="2021-08-12"/> </releases> </component> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitinerary-21.12.0/src/lib/scripts/amtrack.js new/kitinerary-21.12.1/src/lib/scripts/amtrack.js --- old/kitinerary-21.12.0/src/lib/scripts/amtrack.js 1970-01-01 01:00:00.000000000 +0100 +++ new/kitinerary-21.12.1/src/lib/scripts/amtrack.js 2022-01-03 23:00:07.000000000 +0100 @@ -0,0 +1,51 @@ +/* + SPDX-FileCopyrightText: 2021 Volker Krause <vkra...@kde.org> + SPDX-License-Identifier: LGPL-2.0-or-later +*/ + +function parseTicket(pdf, node, triggerNode) { + const page = pdf.pages[triggerNode.location]; + const text = page.text; + + var legs = new Array(); + var idx = 0; + while (true) { + const train = text.substr(idx).match(/TRAIN +\w.*? +(.*?) +DEPARTS\s+ARRIVES \(\w{3} (.*)\)\n\s*(\d+)\s+(\w{3} \d{1,2}), (\d{4})\n\s*(.*)?\n?\s*\d+ (.*) Seats?\n? +(\d{1,2}:\d{2} [AP]M) +(\d{1,2}:\d{2} [AP]M)/); + if (!train) { + break; + } + idx += train.index + train[0].length; + + var leg = JsonLd.newTrainReservation(); + leg.reservedTicket.ticketToken = 'qrcode:' + triggerNode.content; + leg.reservationFor.trainNumber = train[3]; + leg.reservationFor.departureTime = JsonLd.toDateTime(train[4] + ' ' + train[5] + ' ' + train[8], 'MMM d yyyy h:mm AP', 'en'); + leg.reservationFor.arrivalTime = JsonLd.toDateTime(train[2] + ' ' + train[5] + ' ' + train[9], 'MMM d yyyy h:mm AP', 'en'); + leg.reservedTicket.ticketedSeat.seatingType = train[7]; + + const stations = (train[1] + ' ' + (train[6] ?? '')).match(/(.*) - (.*)/); + leg.reservationFor.departureStation.name = stations[1]; + leg.reservationFor.arrivalStation.name = stations[2]; + legs.push(leg); + } + + var reservations = new Array(); + const pasHdr = text.match(/PASSENGERS \((\d+)\).*\n/); + const pasCount = pasHdr[1]; + idx = pasHdr.index + pasHdr[0].length; + for (var i = 0; i < pasCount; ++i) { + const pas = text.substr(idx).match(/([^,]*), (.*?) .*?(\d{10})?(?: \| .*)?\n/); + idx += pas.index + pas[0].length; + for (const leg of legs) { + var res = JsonLd.clone(leg); + res.underName.givenName = pas[2]; + res.underName.familyName = pas[1]; + if (pas[3]) { + res.programMembershipUsed.membershipNumber = pas[3]; + } + reservations.push(res); + } + } + + return reservations; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitinerary-21.12.0/src/lib/scripts/amtrack.json new/kitinerary-21.12.1/src/lib/scripts/amtrack.json --- old/kitinerary-21.12.0/src/lib/scripts/amtrack.json 1970-01-01 01:00:00.000000000 +0100 +++ new/kitinerary-21.12.1/src/lib/scripts/amtrack.json 2022-01-03 23:00:07.000000000 +0100 @@ -0,0 +1,12 @@ +{ + "filter": [ + { + "match": "^[0-9A-Z]{6}-\\d{2}[A-Z]{3}\\d{2}$", + "mimeType": "text/plain", + "scope": "Descendants" + } + ], + "function": "parseTicket", + "mimeType": "application/pdf", + "script": "amtrack.js" +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitinerary-21.12.0/src/lib/scripts/extractors.qrc new/kitinerary-21.12.1/src/lib/scripts/extractors.qrc --- old/kitinerary-21.12.0/src/lib/scripts/extractors.qrc 2021-11-30 22:49:45.000000000 +0100 +++ new/kitinerary-21.12.1/src/lib/scripts/extractors.qrc 2022-01-03 23:00:07.000000000 +0100 @@ -18,6 +18,8 @@ <file>airdo.js</file> <file>amadeus.json</file> <file>amadeus.js</file> + <file>amtrack.json</file> + <file>amtrack.js</file> <file>aohostels.json</file> <file>aohostels.js</file> <file>availpro.json</file> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitinerary-21.12.0/src/lib/scripts/fcmtravel.json new/kitinerary-21.12.1/src/lib/scripts/fcmtravel.json --- old/kitinerary-21.12.0/src/lib/scripts/fcmtravel.json 2021-11-30 22:49:45.000000000 +0100 +++ new/kitinerary-21.12.1/src/lib/scripts/fcmtravel.json 2022-01-03 23:00:07.000000000 +0100 @@ -1,7 +1,7 @@ { "filter": [ - { "field": "From", "match": "@fcmtravel\.", "mimeType": "message/rfc822", "scope": "Ancestors" }, - { "field": "From", "match": "@travellink\.", "mimeType": "message/rfc822", "scope": "Ancestors" } + { "field": "From", "match": "@fcmtravel\\.", "mimeType": "message/rfc822", "scope": "Ancestors" }, + { "field": "From", "match": "@travellink\\.", "mimeType": "message/rfc822", "scope": "Ancestors" } ], "script": "fcmtravel.js", "mimeType": "text/plain" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitinerary-21.12.0/src/lib/scripts/sncf.js new/kitinerary-21.12.1/src/lib/scripts/sncf.js --- old/kitinerary-21.12.0/src/lib/scripts/sncf.js 2021-11-30 22:49:45.000000000 +0100 +++ new/kitinerary-21.12.1/src/lib/scripts/sncf.js 2022-01-03 23:00:07.000000000 +0100 @@ -235,6 +235,7 @@ // see https://community.kde.org/KDE_PIM/KItinerary/SNCF_Barcodes#SNCF_Secutix_Tickets var res = JsonLd.newTrainReservation(); var code = ByteArray.decodeLatin1(triggerNode.content.slice(260)); + res.reservationFor.provider.identifier = 'uic:' + code.substr(4, 4); res.reservationNumber = code.substr(8, 9); res.reservationFor.departureStation.name = code.substr(17, 5); res.reservationFor.departureStation.identifier = "sncf:" + code.substr(17, 5); @@ -250,7 +251,7 @@ var pnr = text.match(res.reservationNumber + '[^\n]* ([A-Z0-9]{6})\n'); var layoutVersion = 1; if (!pnr) { - pnr = text.match(/PAO\s*:\s*([A-Z0-9]{6})\n/); + pnr = text.match(/(?:PAO|REF)\s*:\s*([A-Z0-9]{6,8})\n/); layoutVersion = 2; } res.reservationNumber = pnr[1]; @@ -262,6 +263,9 @@ reservations[0].reservationFor.departureStation.identifier = res.reservationFor.departureStation.identifier; reservations[reservations.length - 1].reservationFor.arrivalStation.identifier = res.reservationFor.arrivalStation.identifier; + for (r of reservations) { + r.reservationFor.provider = res.reservationFor.provider; + } return reservations; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitinerary-21.12.0/src/lib/scripts/viarail.js new/kitinerary-21.12.1/src/lib/scripts/viarail.js --- old/kitinerary-21.12.0/src/lib/scripts/viarail.js 2021-11-30 22:49:45.000000000 +0100 +++ new/kitinerary-21.12.1/src/lib/scripts/viarail.js 2022-01-03 23:00:07.000000000 +0100 @@ -4,7 +4,7 @@ SPDX-License-Identifier: LGPL-2.0-or-later */ -function parseBoardingPass(pdf, node, triggerNode) { +function parseBarcode(barcode) { // barcode content // 13x FTR number // 29x traveler family name @@ -16,24 +16,39 @@ // 4x train number // 8x departure date yyyyMMdd // 4x departure time hhmm - // 22x given name + // 20x given name + // 2x stuff, often empty // 5x stuff, possibly containing Adult/Child/etc info // 6x confirmation number // 12x purchase date/time as yyyyMMddhhmm // 6x stuff, presumably class being part of this - var barcode = triggerNode.content; var res = JsonLd.newTrainReservation(); res.reservationFor.provider = barcode.substr(58, 3); res.reservationFor.trainNumber = barcode.substr(61, 4).trim(); res.reservationFor.departureTime = JsonLd.toDateTime(barcode.substr(65, 12), "yyyyMMddhhmm", "en"); + res.reservationFor.departureStation.identifier = 'via:' + barcode.substr(50, 4); res.reservationFor.departureStation.name = barcode.substr(50, 4); + res.reservationFor.arrivalStation.identifier = 'via:' + barcode.substr(54, 4); res.reservationFor.arrivalStation.name = barcode.substr(54, 4); res.reservedTicket.ticketedSeat.seatSection = barcode.substr(42, 2).trim(); res.reservedTicket.ticketedSeat.seatNumber = barcode.substr(44, 6).trim(); res.reservedTicket.ticketToken = "azteccode:" + barcode; res.underName.familyName = barcode.substr(13, 29).trim(); - res.underName.givenName = barcode.substr(77, 22).trim(); + res.underName.givenName = barcode.substr(77, 20).trim(); res.reservationNumber = barcode.substr(104, 6); return res; } + +function parseBoardingPass(pdf, node, triggerNode) { + var res = node.result[0]; + const text = pdf.pages[triggerNode.location].text; + const stationNames = text.match(/FTR\s*:\s*\d+\n(.*) +(.*)\n/); + res.reservationFor.departureStation.name = stationNames[1]; + res.reservationFor.arrivalStation.name = stationNames[2]; + const arrivalDate = text.match(/Date\s*:.*Date\s*:\s*\w+\.\s*(.*)\n/); + const arrivalTime = text.match(/Arrival\s*:\s*(.*)\n/); + console.log(arrivalDate[1] + ' ' + arrivalTime[1]); + res.reservationFor.arrivalTime = JsonLd.toDateTime(arrivalDate[1] + ' ' + arrivalTime[1], 'MMM d, yyyy HH:mm AP', 'en'); + return res; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitinerary-21.12.0/src/lib/scripts/viarail.json new/kitinerary-21.12.1/src/lib/scripts/viarail.json --- old/kitinerary-21.12.0/src/lib/scripts/viarail.json 2021-11-30 22:49:45.000000000 +0100 +++ new/kitinerary-21.12.1/src/lib/scripts/viarail.json 2022-01-03 23:00:07.000000000 +0100 @@ -1,4 +1,4 @@ -{ +[{ "filter": [ { "match": "^\\d{13}.{37}[A-Z]{8}VIA", @@ -7,6 +7,18 @@ } ], "function": "parseBoardingPass", - "script": "viarail.js", - "mimeType": "application/pdf" -} + "mimeType": "application/pdf", + "script": "viarail.js" +}, +{ + "filter": [ + { + "match": "^\\d{13}.{37}[A-Z]{8}VIA", + "mimeType": "text/plain", + "scope": "Current" + } + ], + "function": "parseBarcode", + "mimeType": "text/plain", + "script": "viarail.js" +}] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/kitinerary-21.12.0/src/lib/scripts/vitolus.js new/kitinerary-21.12.1/src/lib/scripts/vitolus.js --- old/kitinerary-21.12.0/src/lib/scripts/vitolus.js 2021-11-30 22:49:45.000000000 +0100 +++ new/kitinerary-21.12.1/src/lib/scripts/vitolus.js 2022-01-03 23:00:07.000000000 +0100 @@ -11,7 +11,8 @@ var theDate = content.match(/Termin Datum: (.*)/)[1] var theTime = content.match(/Termin Uhrzeit: (.*) Uhr/)[1] var addr = content.match(/Adresse der Teststation: (.*), (.*), ([0-9]*) (.*)/) - var cancelUrl = content.match(/F??r Absagen verwenden Sie bitte folgenden Link: (.*)/)[1] + + var cancelUrlMatch = content.match(/F??r Absagen verwenden Sie bitte folgenden Link: (.*)/) const address = JsonLd.newObject("PostalAddress") address.addressCountry = "DE" @@ -21,13 +22,23 @@ res.reservationFor.name = name - res.potentialAction = JsonLd.newObject("CancelAction") - res.potentialAction.url = cancelUrl + // FIXME some cancel urls are not matched + if (cancelUrlMatch) { + res.potentialAction = JsonLd.newObject("CancelAction") + res.potentialAction.url = cancelUrlMatch[1] + } res.reservationFor.location.address = address res.reservationFor.location.name = addr[1] - res.reservationFor.startDate = JsonLd.toDateTime(theDate + " " + theTime, "dd.MM.yyyy hh:mm", "de") + // Both hh::mm and hh.mm are observed in the wild + var dateTime = JsonLd.toDateTime(theDate + " " + theTime, "dd.MM.yyyy hh:mm", "de") + + if (isNaN(dateTime.getTime())) { + dateTime = JsonLd.toDateTime(theDate + " " + theTime, "dd.MM.yyyy hh.mm", "de") + } + + res.reservationFor.startDate = dateTime return res }