Commit a529a804 authored by Christian Kandeler's avatar Christian Kandeler
Browse files

Harmattan: Create empty Aegis manifest file on target creation.

This way, the developer gets a hint about what to edit when
it becomes necessary to manually set capabilities.

Change-Id: I03ef476b87cba26fd15d1bc28ba652d4114578b6
Reviewed-on: http://codereview.qt.nokia.com/676

Reviewed-by: default avatarChristian Kandeler <christian.kandeler@nokia.com>
parent 13cb0b6d
......@@ -442,10 +442,16 @@ bool MaemoDebianPackageCreationStep::copyDebianFiles(bool inSourceBuild)
QDir templatesDir(templatesDirPath);
const QStringList &files = templatesDir.entryList(QDir::Files);
foreach (const QString &fileName, files) {
const QString srcFile
= templatesDirPath + QLatin1Char('/') + fileName;
const QString destFile
= debianDirPath + QLatin1Char('/') + fileName;
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.
if (QFileInfo(srcFile).size() == 0)
continue;
newFileName = maemoTarget()->packageName() + QLatin1String(".aegis");
}
const QString destFile = debianDirPath + QLatin1Char('/') + newFileName;
if (fileName == QLatin1String("rules")) {
if (!adaptRulesFile(srcFile, destFile))
return false;
......
......@@ -1083,6 +1083,17 @@ QString Qt4HarmattanTarget::defaultDisplayName()
"Qt4 Harmattan target display name");
}
QString Qt4HarmattanTarget::aegisManifestFileName()
{
return QLatin1String("manifest.aegis");
}
void Qt4HarmattanTarget::handleTargetAddedSpecial()
{
AbstractDebBasedQt4MaemoTarget::handleTargetAddedSpecial();
QFile(debianDirPath() + QLatin1Char('/') + aegisManifestFileName()).open(QIODevice::WriteOnly);
}
void Qt4HarmattanTarget::addAdditionalControlFileFields(QByteArray &controlContents)
{
Q_UNUSED(controlContents);
......
......@@ -138,6 +138,7 @@ signals:
void controlChanged();
protected:
virtual void handleTargetAddedSpecial();
bool adaptControlFileField(QByteArray &document, const QByteArray &fieldName,
const QByteArray &newFieldValue);
......@@ -151,7 +152,6 @@ private:
virtual bool setShortDescriptionInternal(const QString &description);
virtual ActionStatus createSpecialTemplates();
virtual void handleTargetAddedSpecial();
virtual bool targetCanBeRemoved() const;
virtual void removeTarget();
virtual bool initAdditionalPackagingSettingsFromOtherTarget();
......@@ -258,8 +258,10 @@ public:
virtual bool allowsQmlDebugging() const { return true; }
static QString defaultDisplayName();
static QString aegisManifestFileName();
private:
void handleTargetAddedSpecial();
virtual void addAdditionalControlFileFields(QByteArray &controlContents);
virtual QString debianDirName() const;
virtual QByteArray packageManagerNameFieldName() const;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment