diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/common/repositorygen.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tools/common/repositorygen.cpp b/tools/common/repositorygen.cpp index 76d547526..733323a79 100644 --- a/tools/common/repositorygen.cpp +++ b/tools/common/repositorygen.cpp @@ -172,13 +172,20 @@ void QInstallerTools::generateMetaDataDirectory(const QString &outDir, const QSt blackList << QLatin1String("UserInterfaces") << QLatin1String("Translations") << QLatin1String("Licenses") << QLatin1String("Name"); + bool foundDefault = false; + bool foundVirtual = false; const QDomNodeList childNodes = package.childNodes(); for (int i = 0; i < childNodes.count(); ++i) { const QDomNode node = childNodes.at(i); const QString key = node.nodeName(); - // just skip comments and some tags... + + if (key == QLatin1String("Default")) + foundDefault = true; + if (key == QLatin1String("Virtual")) + foundVirtual = true; if (node.isComment() || blackList.contains(key)) - continue; + continue; // just skip comments and some tags... + const QString value = node.toElement().text(); QDomElement element = doc.createElement(key); for (int i = 0; i < node.attributes().size(); i++) { @@ -188,6 +195,11 @@ void QInstallerTools::generateMetaDataDirectory(const QString &outDir, const QSt update.appendChild(element).appendChild(doc.createTextNode(value)); } + if (foundDefault && foundVirtual) { + throw QInstaller::Error(QString::fromLatin1("Error: <Default> and <Virtual> elements are " + "mutually exclusive. File: '%0'").arg(packageXmlPath)); + } + // get the size of the data quint64 componentSize = 0; quint64 compressedComponentSize = 0; |