Skip to content
Snippets Groups Projects
Commit 3d853792 authored by ck's avatar ck
Browse files

Maemo: Introduce functions for package name construction.

parent 2d7b3bf4
No related branches found
No related tags found
No related merge requests found
......@@ -134,7 +134,7 @@ bool MaemoPackageCreationStep::createPackage()
if (!QFileInfo(projectDir + QLatin1String("/debian")).exists()) {
const QString command = QLatin1String("dh_make -s -n -p ")
% executableFileName() % QLatin1String("_0.1");
% executableFileName() % versionString();
if (!runCommand(buildProc, command))
return false;
QFile rulesFile(projectDir + QLatin1String("/debian/rules"));
......@@ -245,18 +245,33 @@ QString MaemoPackageCreationStep::targetRoot() const
bool MaemoPackageCreationStep::packagingNeeded() const
{
#if 0
QFileInfo execInfo(executable());
const QString packageFile = execInfo.absolutePath() % QLatin1Char('/')
% executableFileName() % QLatin1String("_0.1_armel.deb");
QFileInfo packageInfo(packageFile);
#if 1
// TODO: When the package contents get user-modifiable, we need
// to check whether files have been added and/or removed and whether
// the newest one is newer than the package.
// For the first check, we should have a switch that the widget sets
// to true when the user has changed the package contents and which
// we set to false after a successful package creation.
QFileInfo packageInfo(packageFilePath(executable()));
return !packageInfo.exists()
|| packageInfo.lastModified() <= execInfo.lastModified();
|| packageInfo.lastModified() <= QFileInfo(executable()).lastModified();
#else
return false;
#endif
}
QString MaemoPackageCreationStep::packageFilePath(const QString &executableFilePath)
{
return executableFilePath % QLatin1Char('/')
% QFileInfo(executableFilePath).fileName() % versionString()
% QLatin1String("_armel.deb");
}
QString MaemoPackageCreationStep::versionString()
{
return QLatin1String("_0.1");
}
const QLatin1String MaemoPackageCreationStep::CreatePackageId("Qt4ProjectManager.MaemoPackageCreationStep");
} // namespace Internal
......
......@@ -59,6 +59,8 @@ class MaemoPackageCreationStep : public ProjectExplorer::BuildStep
friend class MaemoPackageCreationFactory;
public:
MaemoPackageCreationStep(ProjectExplorer::BuildConfiguration *buildConfig);
static QString packageFilePath(const QString &executableFilePath);
private:
MaemoPackageCreationStep(ProjectExplorer::BuildConfiguration *buildConfig,
MaemoPackageCreationStep *other);
......@@ -78,6 +80,8 @@ private:
QString targetRoot() const;
bool packagingNeeded() const;
static QString versionString();
static const QLatin1String CreatePackageId;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment