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

Maemo: Get rid of unneeded code.

All this environment setting was just an approximation of what the
"mad" script does better.
parent b21523f9
......@@ -157,12 +157,8 @@ bool MaemoPackageCreationStep::createPackage(QProcess *buildProc)
emit addOutput(tr("Creating package file ..."), MessageOutput);
checkProjectName();
QString error;
if (!preparePackagingProcess(buildProc, qt4BuildConfiguration(),
buildDirectory(), &error)) {
raiseError(error);
return false;
}
preparePackagingProcess(buildProc, qt4BuildConfiguration(),
buildDirectory());
const QString projectDir
= buildConfiguration()->target()->project()->projectDirectory();
......@@ -478,51 +474,16 @@ void MaemoPackageCreationStep::raiseError(const QString &shortMsg,
TASK_CATEGORY_BUILDSYSTEM));
}
bool MaemoPackageCreationStep::preparePackagingProcess(QProcess *proc,
const Qt4BuildConfiguration *bc, const QString &workingDir, QString *error)
void MaemoPackageCreationStep::preparePackagingProcess(QProcess *proc,
const Qt4BuildConfiguration *bc, const QString &workingDir)
{
const QString targetRoot = MaemoGlobal::targetRoot(bc->qtVersion());
QFile configFile(targetRoot % QLatin1String("/config.sh"));
if (!configFile.open(QIODevice::ReadOnly)) {
*error = tr("Cannot open MADDE config file '%1'.")
.arg(nativePath(configFile));
return false;
}
Utils::Environment env = bc->environment();
const QString &path
= QDir::toNativeSeparators(MaemoGlobal::maddeRoot(bc->qtVersion())
+ QLatin1Char('/'));
#ifdef Q_OS_WIN
env.prependOrSetPath(path % QLatin1String("bin"));
#endif
env.prependOrSetPath(targetRoot % QLatin1String("/bin"));
env.prependOrSetPath(path % QLatin1String("madbin"));
if (bc->qmakeBuildConfiguration() & QtVersion::DebugBuild) {
env.appendOrSet(QLatin1String("DEB_BUILD_OPTIONS"),
QLatin1String("nostrip"), QLatin1String(" "));
}
QString perlLib
= QDir::fromNativeSeparators(path % QLatin1String("madlib/perl5"));
#ifdef Q_OS_WIN
perlLib = perlLib.remove(QLatin1Char(':'));
perlLib = perlLib.prepend(QLatin1Char('/'));
#endif
env.set(QLatin1String("PERL5LIB"), perlLib);
env.set(QLatin1String("PWD"), workingDir);
const QRegExp envPattern(QLatin1String("([^=]+)=[\"']?([^;\"']+)[\"']? ;.*"));
QByteArray line;
do {
line = configFile.readLine(200);
if (envPattern.exactMatch(line))
env.set(envPattern.cap(1), envPattern.cap(2));
} while (!line.isEmpty());
proc->setEnvironment(env.toStringList());
proc->setWorkingDirectory(workingDir);
return true;
}
QString MaemoPackageCreationStep::packagingCommand(const Qt4BuildConfiguration *bc,
......
......@@ -75,9 +75,8 @@ public:
QString versionString(QString *error) const;
bool setVersionString(const QString &version, QString *error);
static bool preparePackagingProcess(QProcess *proc,
const Qt4BuildConfiguration *bc, const QString &workingDir,
QString *error);
static void preparePackagingProcess(QProcess *proc,
const Qt4BuildConfiguration *bc, const QString &workingDir);
static QString packagingCommand(const Qt4BuildConfiguration *bc,
const QString &commandName);
static void ensureShlibdeps(QByteArray &rulesContent);
......
......@@ -155,13 +155,8 @@ void MaemoPublisherFremantleFree::createPackage()
}
emit progressReport(tr("Cleaning up temporary directory ..."));
if (!MaemoPackageCreationStep::preparePackagingProcess(m_process,
m_buildConfig, m_tmpProjectDir, &error)) {
finishWithFailure(tr("Error preparing packaging process: %1").arg(error),
tr("Publishing failed: Could not create package."));
return;
}
MaemoPackageCreationStep::preparePackagingProcess(m_process,
m_buildConfig, m_tmpProjectDir);
setState(RunningQmake);
ProjectExplorer::AbstractProcessStep * const qmakeStep
= m_buildConfig->qmakeStep();
......
......@@ -691,12 +691,8 @@ AbstractQt4MaemoTarget::ActionStatus AbstractDebBasedQt4MaemoTarget::createSpeci
QProcess dh_makeProc;
QString error;
const Qt4BuildConfiguration * const bc = activeBuildConfiguration();
if (!MaemoPackageCreationStep::preparePackagingProcess(&dh_makeProc, bc,
projectDir.path() + QLatin1Char('/') + PackagingDirName, &error)) {
raiseError(error);
return ActionFailed;
}
MaemoPackageCreationStep::preparePackagingProcess(&dh_makeProc, bc,
projectDir.path() + QLatin1Char('/') + PackagingDirName);
const QString dhMakeDebianDir = projectDir.path() + QLatin1Char('/')
+ PackagingDirName + QLatin1String("/debian");
MaemoGlobal::removeRecursively(dhMakeDebianDir, error);
......
Markdown is supported
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