diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2023-02-13 14:20:26 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2023-03-10 18:09:17 +0100 |
commit | 1e720681fc9ed8a3c4eb685fe16055ed8f42c4c2 (patch) | |
tree | ca163e66d06514ecd26621b0b26d91266b94f3a5 | |
parent | a9f28aa939f9f994b420fdfb4cccc0053cd7382c (diff) | |
download | qttools-1e720681fc9ed8a3c4eb685fe16055ed8f42c4c2.tar.gz |
Allow a Comment field to document clues to updaters
There's no comment mechanism native to JSON and our tooling is fussy
about rejecting an attribution file if it has any unknown keys; so
provide a key to serve as a work-around, in which developers can leave
notes to those reading the attribution later.
Pick-to: 6.5
Change-Id: Ibd80b773d1c28715ec7c10a087f663a921b9ca6c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r-- | src/qtattributionsscanner/scanner.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/qtattributionsscanner/scanner.cpp b/src/qtattributionsscanner/scanner.cpp index 5c0d542e1..897954e69 100644 --- a/src/qtattributionsscanner/scanner.cpp +++ b/src/qtattributionsscanner/scanner.cpp @@ -208,7 +208,7 @@ static std::optional<Package> readPackage(const QJsonObject &object, const QStri const QString key = iter.key(); if (!iter.value().isString() && key != "QtParts"_L1 && key != "SecurityCritical"_L1 - && key != "Files"_L1 && key != "LicenseFiles"_L1) { + && key != "Files"_L1 && key != "LicenseFiles"_L1 && key != "Comment"_L1) { if (logLevel != SilentLog) std::cerr << qPrintable(tr("File %1: Expected JSON string as value of %2.").arg( QDir::toNativeSeparators(filePath), key)) << std::endl; @@ -237,6 +237,11 @@ static std::optional<Package> readPackage(const QJsonObject &object, const QStri continue; } } + } else if (key == "Comment"_L1) { + // Accepted purely to record details of potential interest doing + // updates in future. Value is an arbitrary object. Any number of + // Comment entries may be present: JSON doesn't require names to be + // unique, albeit some linters may kvetch. } else if (key == "Id"_L1) { p.id = value; } else if (key == "Homepage"_L1) { |