增量编译场景下,针对占用的目录删除不了时,继续编译。

Signed-off-by: fangyunzhong <fangyunzhong2@huawei.com>
This commit is contained in:
fangyunzhong
2022-09-23 11:05:03 +08:00
parent ece8d22916
commit d213f183eb
2 changed files with 8 additions and 2 deletions
+6 -1
View File
@@ -280,7 +280,12 @@ bool FileEntry::IsIgnore(const string &filename) const
bool FileEntry::RemoveAllDirInner(const FileEntry &entry)
{
if (entry.IsFile()) {
return remove(entry.GetFilePath().GetPath().c_str()) == 0;
bool result = remove(entry.GetFilePath().GetPath().c_str()) == 0;
if (!result) {
cerr << "Error: " << entry.GetFilePath().GetPath() << "remove fail !" << endl;
return false;
}
return true;
}
for (const auto &iter : entry.GetChilds()) {
+2 -1
View File
@@ -125,6 +125,7 @@ uint32_t ResourcePack::InitOutput() const
}
bool forceWrite = packageParser_.GetForceWrite();
bool combine = packageParser_.GetCombine();
string output = packageParser_.GetOutput();
string resourcesPath = FileEntry::FilePath(output).Append(RESOURCES_DIR).GetPath();
if (ResourceUtil::FileExist(resourcesPath)) {
@@ -134,7 +135,7 @@ uint32_t ResourcePack::InitOutput() const
}
if (!ResourceUtil::RmoveAllDir(resourcesPath)) {
return RESTOOL_ERROR;
return combine ? RESTOOL_SUCCESS : RESTOOL_ERROR;
}
}
return RESTOOL_SUCCESS;