aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@digia.com>2012-11-27 15:45:41 +0100
committerJoerg Bornemann <joerg.bornemann@digia.com>2012-11-27 16:29:08 +0100
commit28de3ccbe989cadd163ad4639048aa35229bfea1 (patch)
tree0920dae2d952cf600bb1d350302b4952f00e3bd6
parent5c8ba6a582e2ad825bdfdb9fb55ae650f2a12da0 (diff)
Fix directory clean-up (again).
- Don't follow symlinks. - Mark current subtree as non-empty if removal of empty directory fails and we were asked not to abort. Change-Id: Ib46ed34f7e70eebca6f07c91d6e1db64f4954bcb Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
-rw-r--r--src/lib/buildgraph/artifactcleaner.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/buildgraph/artifactcleaner.cpp b/src/lib/buildgraph/artifactcleaner.cpp
index 56af22b51..64c19d828 100644
--- a/src/lib/buildgraph/artifactcleaner.cpp
+++ b/src/lib/buildgraph/artifactcleaner.cpp
@@ -161,7 +161,7 @@ void ArtifactCleaner::removeEmptyDirectories(const QString &rootDir, const Build
QDirIterator it(rootDir, QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot);
while (it.hasNext()) {
it.next();
- if (it.fileInfo().isDir())
+ if (!it.fileInfo().isSymLink() && it.fileInfo().isDir())
removeEmptyDirectories(it.filePath(), options, &subTreeIsEmpty);
else
subTreeIsEmpty = false;
@@ -174,10 +174,11 @@ void ArtifactCleaner::removeEmptyDirectories(const QString &rootDir, const Build
throw error;
qbsWarning() << error.toString();
m_hasError = true;
+ subTreeIsEmpty = false;
}
- } else if (isEmpty) {
- *isEmpty = subTreeIsEmpty;
}
+ if (!subTreeIsEmpty && isEmpty)
+ *isEmpty = false;
}
} // namespace Internal