forked from qt-creator/qt-creator
Maemo: Introduce functions for package name construction.
This commit is contained in:
@@ -134,7 +134,7 @@ bool MaemoPackageCreationStep::createPackage()
|
|||||||
|
|
||||||
if (!QFileInfo(projectDir + QLatin1String("/debian")).exists()) {
|
if (!QFileInfo(projectDir + QLatin1String("/debian")).exists()) {
|
||||||
const QString command = QLatin1String("dh_make -s -n -p ")
|
const QString command = QLatin1String("dh_make -s -n -p ")
|
||||||
% executableFileName() % QLatin1String("_0.1");
|
% executableFileName() % versionString();
|
||||||
if (!runCommand(buildProc, command))
|
if (!runCommand(buildProc, command))
|
||||||
return false;
|
return false;
|
||||||
QFile rulesFile(projectDir + QLatin1String("/debian/rules"));
|
QFile rulesFile(projectDir + QLatin1String("/debian/rules"));
|
||||||
@@ -245,18 +245,33 @@ QString MaemoPackageCreationStep::targetRoot() const
|
|||||||
|
|
||||||
bool MaemoPackageCreationStep::packagingNeeded() const
|
bool MaemoPackageCreationStep::packagingNeeded() const
|
||||||
{
|
{
|
||||||
#if 0
|
#if 1
|
||||||
QFileInfo execInfo(executable());
|
// TODO: When the package contents get user-modifiable, we need
|
||||||
const QString packageFile = execInfo.absolutePath() % QLatin1Char('/')
|
// to check whether files have been added and/or removed and whether
|
||||||
% executableFileName() % QLatin1String("_0.1_armel.deb");
|
// the newest one is newer than the package.
|
||||||
QFileInfo packageInfo(packageFile);
|
// 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()
|
return !packageInfo.exists()
|
||||||
|| packageInfo.lastModified() <= execInfo.lastModified();
|
|| packageInfo.lastModified() <= QFileInfo(executable()).lastModified();
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#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");
|
const QLatin1String MaemoPackageCreationStep::CreatePackageId("Qt4ProjectManager.MaemoPackageCreationStep");
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -59,6 +59,8 @@ class MaemoPackageCreationStep : public ProjectExplorer::BuildStep
|
|||||||
friend class MaemoPackageCreationFactory;
|
friend class MaemoPackageCreationFactory;
|
||||||
public:
|
public:
|
||||||
MaemoPackageCreationStep(ProjectExplorer::BuildConfiguration *buildConfig);
|
MaemoPackageCreationStep(ProjectExplorer::BuildConfiguration *buildConfig);
|
||||||
|
|
||||||
|
static QString packageFilePath(const QString &executableFilePath);
|
||||||
private:
|
private:
|
||||||
MaemoPackageCreationStep(ProjectExplorer::BuildConfiguration *buildConfig,
|
MaemoPackageCreationStep(ProjectExplorer::BuildConfiguration *buildConfig,
|
||||||
MaemoPackageCreationStep *other);
|
MaemoPackageCreationStep *other);
|
||||||
@@ -78,6 +80,8 @@ private:
|
|||||||
QString targetRoot() const;
|
QString targetRoot() const;
|
||||||
bool packagingNeeded() const;
|
bool packagingNeeded() const;
|
||||||
|
|
||||||
|
static QString versionString();
|
||||||
|
|
||||||
static const QLatin1String CreatePackageId;
|
static const QLatin1String CreatePackageId;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user