summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Griebl <robert.griebl@qt.io>2020-02-20 14:30:46 +0100
committerRobert Griebl <robert.griebl@qt.io>2020-02-20 20:10:16 +0100
commitc8c3e7408c95d33328173249606a3070e7ce677d (patch)
tree31c2702ffdeb0858c88fc8b4423544a2cc58c8cf
parent371335ad081b4ce7cdf00dc8079b19c8599c836e (diff)
downloadqtapplicationmanager-c8c3e7408c95d33328173249606a3070e7ce677d.tar.gz
Show a warning when packaging old manifests
Support for this is still there, but a pro-active deprecation warning shouldn't hurt. Change-Id: I6bde47d653f0a21653cb4beeca633617e4a54d06 Fixes: AUTOSUITE-1465 Reviewed-by: Nikolay Zamotaev <nzamotaev@luxoft.com> Reviewed-by: Dominik Holland <dominik.holland@qt.io>
-rw-r--r--src/tools/packager/packagingjob.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/tools/packager/packagingjob.cpp b/src/tools/packager/packagingjob.cpp
index 810f838d..ca8bb151 100644
--- a/src/tools/packager/packagingjob.cpp
+++ b/src/tools/packager/packagingjob.cpp
@@ -154,6 +154,21 @@ void PackagingJob::execute() Q_DECL_NOEXCEPT_EXPR(false)
QString infoName = qSL("info.yaml");
QScopedPointer<PackageInfo> package(PackageInfo::fromManifest(source.absoluteFilePath(infoName)));
+ // warn the user that old-style manifests are going to be deprecated in the future
+ try {
+ QFile f(package->manifestPath());
+ f.open(QFile::ReadOnly);
+ YamlParser p(f.readAll());
+
+ auto header = p.parseHeader();
+ if (header.first == qL1S("am-application") && header.second == 1) {
+ fprintf(stderr, "WARNING: 'info.yaml' is still using the old format (type '%s', version '%d').\n"
+ " This is going to be deprecated in a future release.\n",
+ qPrintable(header.first), header.second);
+ }
+ } catch (...) {
+ }
+
// build report
InstallationReport report(package->id());
report.addFile(infoName);