Maemo: Fix directory deployment issues.

This commit is contained in:
Christian Kandeler
2011-04-21 11:10:47 +02:00
parent 2781453b94
commit e40a0ca990
2 changed files with 9 additions and 12 deletions

View File

@@ -323,8 +323,10 @@ bool MaemoMountAndCopyDeployStep::isDeploymentNeeded(const QString &hostName) co
const int deployableCount = deployables->deployableCount(); const int deployableCount = deployables->deployableCount();
for (int i = 0; i < deployableCount; ++i) { for (int i = 0; i < deployableCount; ++i) {
const MaemoDeployable &d = deployables->deployableAt(i); const MaemoDeployable &d = deployables->deployableAt(i);
if (currentlyNeedsDeployment(hostName, d)) if (currentlyNeedsDeployment(hostName, d)
|| QFileInfo(d.localFilePath).isDir()) {
m_filesToCopy << d; m_filesToCopy << d;
}
} }
return !m_filesToCopy.isEmpty(); return !m_filesToCopy.isEmpty();
} }

View File

@@ -312,18 +312,13 @@ void MaemoCopyToSysrootStep::run(QFutureInterface<bool> &fi)
const QFileInfo localFileInfo(deployable.localFilePath); const QFileInfo localFileInfo(deployable.localFilePath);
const QString targetFilePath = tc->sysroot() + sep const QString targetFilePath = tc->sysroot() + sep
+ deployable.remoteDir + sep + localFileInfo.fileName(); + deployable.remoteDir + sep + localFileInfo.fileName();
if (QFileInfo(targetFilePath).exists()
&& MaemoGlobal::isFileNewerThan(targetFilePath, localFileInfo.lastModified())) {
continue;
}
sysRootDir.mkpath(deployable.remoteDir.mid(1)); sysRootDir.mkpath(deployable.remoteDir.mid(1));
QFile::remove(targetFilePath); QString errorMsg;
if (!QFile::copy(deployable.localFilePath, targetFilePath)) { MaemoGlobal::removeRecursively(targetFilePath, errorMsg);
emit addOutput(tr("Sysroot installation failed: " if (!MaemoGlobal::copyRecursively(deployable.localFilePath,
"Could not copy '%1' to '%2'. Continuing anyway.") targetFilePath, &errorMsg)) {
.arg(QDir::toNativeSeparators(deployable.localFilePath), emit addOutput(tr("Sysroot installation failed: $1\n"
QDir::toNativeSeparators(targetFilePath)), " Continuing anyway.").arg(errorMsg), ErrorMessageOutput);
ErrorMessageOutput);
} }
QCoreApplication::processEvents(); QCoreApplication::processEvents();
if (fi.isCanceled()) { if (fi.isCanceled()) {