Harmattan: Introduce new condition for auto-generation of manifest file.

In addition to using an empty file as in 2.3, the user can now also put
a magic string at the start of the manifest file. This way, we can use
this as the default while also documenting it in-place.

Task-number: https://projects.maemo.org/bugzilla/show_bug.cgi?id=284797
Change-Id: I375a73a5d2e9d3e0973d97d81e0110e788d0159a
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
Christian Kandeler
2011-12-05 15:48:14 +01:00
parent 0bec54d180
commit 0a59f34794
2 changed files with 7 additions and 10 deletions

View File

@@ -1,3 +1,4 @@
AutoGenerateAegisFile
<!-- Aegis manifest declares the security credentials required by an
application to run correctly. By default, a manifest file will be
created or updated automatically as a part of build.
@@ -9,9 +10,8 @@
To create a manifest file automatically as a part of build (DEFAULT):
* You may leave this file as-is.
* Do not list any '<credential name="token" />' entries
outside of comments.
* Make sure this file starts with the string "AutoGenerateAegisFile" (without quotes).
* Alternatively, it can also be completely empty.
To provide a manifest yourself:

View File

@@ -370,14 +370,8 @@ bool MaemoDebianPackageCreationStep::copyDebianFiles(bool inSourceBuild)
foreach (const QString &fileName, files) {
const QString srcFile = templatesDirPath + QLatin1Char('/') + fileName;
QString newFileName = fileName;
if (newFileName == Qt4HarmattanTarget::aegisManifestFileName()) {
// If the user has touched the Aegis manifest file, we copy it for use
// by MADDE. Otherwise the required capabilities will be auto-detected,
// unless the user explicitly requests that no manifest should be created.
if (QFileInfo(srcFile).size() == 0)
continue;
if (newFileName == Qt4HarmattanTarget::aegisManifestFileName())
newFileName = maemoTarget()->packageName() + QLatin1String(".aegis");
}
const QString destFile = debianDirPath + QLatin1Char('/') + newFileName;
if (fileName == QLatin1String("rules")) {
@@ -393,6 +387,9 @@ bool MaemoDebianPackageCreationStep::copyDebianFiles(bool inSourceBuild)
.arg(QDir::toNativeSeparators(srcFile), reader.errorString()));
return false;
}
if (reader.data().isEmpty() || reader.data().startsWith("AutoGenerateAegisFile"))
continue;
if (reader.data().startsWith("NoAegisFile")) {
QFile targetFile(destFile);
if (!targetFile.open(QIODevice::WriteOnly)) {