WFSI: Implement patch install finalization.
This commit is contained in:
parent
76bbfbb511
commit
a641609857
|
@ -521,7 +521,7 @@ bool DeleteDirRecursively(const std::string& directory)
|
|||
}
|
||||
|
||||
// Create directory and copy contents (does not overwrite existing files)
|
||||
void CopyDir(const std::string& source_path, const std::string& dest_path)
|
||||
void CopyDir(const std::string& source_path, const std::string& dest_path, bool destructive)
|
||||
{
|
||||
if (source_path == dest_path)
|
||||
return;
|
||||
|
@ -562,10 +562,16 @@ void CopyDir(const std::string& source_path, const std::string& dest_path)
|
|||
{
|
||||
if (!Exists(dest))
|
||||
File::CreateFullPath(dest + DIR_SEP);
|
||||
CopyDir(source, dest);
|
||||
CopyDir(source, dest, destructive);
|
||||
}
|
||||
else if (!Exists(dest) && !destructive)
|
||||
{
|
||||
Copy(source, dest);
|
||||
}
|
||||
else
|
||||
{
|
||||
Rename(source, dest);
|
||||
}
|
||||
else if (!Exists(dest))
|
||||
File::Copy(source, dest);
|
||||
#ifdef _WIN32
|
||||
} while (FindNextFile(hFind, &ffd) != 0);
|
||||
FindClose(hFind);
|
||||
|
|
|
@ -156,8 +156,9 @@ bool DeleteDirRecursively(const std::string& directory);
|
|||
// Returns the current directory
|
||||
std::string GetCurrentDir();
|
||||
|
||||
// Create directory and copy contents (does not overwrite existing files)
|
||||
void CopyDir(const std::string& source_path, const std::string& dest_path);
|
||||
// Create directory and copy contents (optionally overwrites existing files)
|
||||
void CopyDir(const std::string& source_path, const std::string& dest_path,
|
||||
bool destructive = false);
|
||||
|
||||
// Set the current directory to given directory
|
||||
bool SetCurrentDir(const std::string& directory);
|
||||
|
|
|
@ -276,7 +276,18 @@ IPCCommandResult WFSI::IOCtl(const IOCtlRequest& request)
|
|||
}
|
||||
|
||||
case IOCTL_WFSI_FINALIZE_PATCH_INSTALL:
|
||||
{
|
||||
INFO_LOG(IOS, "IOCTL_WFSI_FINALIZE_PATCH_INSTALL");
|
||||
if (m_patch_type != NOT_A_PATCH)
|
||||
{
|
||||
std::string current_title_dir =
|
||||
StringFromFormat("/vol/%s/title/%s/%s", m_device_name.c_str(),
|
||||
m_current_group_id_str.c_str(), m_current_title_id_str.c_str());
|
||||
std::string patch_dir = current_title_dir + "/_patch";
|
||||
File::CopyDir(WFS::NativePath(patch_dir), WFS::NativePath(current_title_dir), true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case IOCTL_WFSI_DELETE_TITLE:
|
||||
// Bytes 0-4: ??
|
||||
|
|
Loading…
Reference in New Issue