result r = E_SUCCESS;
struct stat fileinfo;
+ AppLogTag(OSP_INSTALLER, "+ Remove(): path=[%ls]", filePath.GetPointer());
+
std::unique_ptr<char[]> pFilePath(_StringConverter::CopyToCharArrayN(filePath));
TryReturn(pFilePath, false, "[osp-installer] pFilePath is null");
err = lstat(pFilePath.get(), &fileinfo);
- TryReturn(err >= 0, false, "[osp-installer] lstat() failed(%s), filepath = [%s]", strerror(errno), pFilePath.get());
+ if (err < 0)
+ {
+ AppLogTag(OSP_INSTALLER, "Remove(): lstat(%s): %s[errno:%d]: skip", pFilePath.get(), strerror(errno), errno);
+ return true;
+ }
if (S_ISLNK(fileinfo.st_mode))
{
- AppLogTag(OSP_INSTALLER, "Remove(): symlink, path = [%s]", pFilePath.get());
+ AppLogTag(OSP_INSTALLER, "Remove(): symlink, path=[%s]", pFilePath.get());
err = unlink(pFilePath.get());
- TryReturn(err >= 0, false, "[osp-installer] unlink() failed(%s), filepath = [%s]", strerror(errno), pFilePath.get());
+ TryReturn(err >= 0, false, "[osp-installer] unlink() failed(%s), filepath=[%s]", strerror(errno), pFilePath.get());
}
else if (S_ISDIR(fileinfo.st_mode))
{
- AppLogTag(OSP_INSTALLER, "Remove(): directory, path = [%ls]", filePath.GetPointer());
+ AppLogTag(OSP_INSTALLER, "Remove(): directory, path=[%ls]", filePath.GetPointer());
r = Directory::Remove(filePath, true);
TryReturn(!IsFailed(r), false, "[osp-installer] Directory::Remove() failed, filePath=%ls", filePath.GetPointer());
}
else
{
- AppLogTag(OSP_INSTALLER, "Remove(): file, path = [%ls]", filePath.GetPointer());
+ AppLogTag(OSP_INSTALLER, "Remove(): file, path=[%ls]", filePath.GetPointer());
r = File::Remove(filePath);
TryReturn(!IsFailed(r), false, "[osp-installer] File::Remove() failed, filePath=%ls", filePath.GetPointer());
}
int readBytes = 0;
result r = E_SUCCESS;
+ AppLogTag(OSP_INSTALLER, "+ Copy(): src=[%ls], dest=[%ls]", srcFilePath.GetPointer(), destFilePath.GetPointer());
+
File srcFile;
File destFile;
{
result r = E_SUCCESS;
+ AppLogTag(OSP_INSTALLER, "+ CopyDirectory(): src=[%ls], dest=[%ls]", srcFilePath.GetPointer(), destFilePath.GetPointer());
+
std::unique_ptr<Directory> pDir(new Directory);
TryReturn(pDir, false, "[osp-installer] pDir is null.");
TryReturn(pFilePath, false, "[osp-installer] pFilePath is null");
err = lstat(pFilePath.get(), &fileinfo);
- TryReturn(err >= 0, false, "[osp-installer] lstat() failed(%s), filepath = [%s]", strerror(errno), pFilePath.get());
+ TryReturn(err >= 0, false, "[osp-installer] lstat() failed(%s), filepath=[%s]", strerror(errno), pFilePath.get());
if (S_ISLNK(fileinfo.st_mode))
{
InstallerUtil::GetRealPath(const String& filePath, String& realPath)
{
char* pRealPath = null;
+
+ AppLogTag(OSP_INSTALLER, "+ GetRealPath(): path=[%ls], realPath=[%ls]", filePath.GetPointer(), realPath.GetPointer());
+
std::unique_ptr<char[]> pFilePath(_StringConverter::CopyToCharArrayN(filePath));
TryReturn(pFilePath, false, "[osp-installer] pFilePath is null");
int err = -1;
bool res = false;
+ AppLogTag(OSP_INSTALLER, "+ CreateSymlink(): oldPath=[%ls], newPath=[%ls]", oldPath.GetPointer(), newPath.GetPointer());
+
res = File::IsFileExist(oldPath);
- TryReturn(res == true, false, "[osp-installer] file not found, oldPath=(%ls).", oldPath.GetPointer());
+ TryReturn(res == true, false, "[osp-installer] file not found, oldPath=[%ls]", oldPath.GetPointer());
std::unique_ptr<char[]> pOldPath(_StringConverter::CopyToCharArrayN(oldPath));
TryReturn(pOldPath, false, "[osp-installer] pOldPath is null");
TryReturn(pNewPath, false, "[osp-installer] pNewPath is null");
err = symlink(pOldPath.get(), pNewPath.get());
- TryReturn(err == 0, false, "[osp-installer] symlink() is failed(%s), oldpath = [%s], newpath = [%s]", strerror(errno), pOldPath.get(), pNewPath.get());
+ TryReturn(err == 0, false, "[osp-installer] symlink() is failed(%s), oldpath=[%s], newpath=[%s]", strerror(errno), pOldPath.get(), pNewPath.get());
- AppLogTag(OSP_INSTALLER, "CreateSymlink() [%ls] -> [%ls]", newPath.GetPointer(), oldPath.GetPointer());
+ AppLogTag(OSP_INSTALLER, "CreateSymlink(): [%ls] -> [%ls]", newPath.GetPointer(), oldPath.GetPointer());
return true;
}
TryReturn(pFilePath, false, "[osp-installer] pFilePath is null");
err = chmod(pFilePath.get(), mode);
- TryReturn(err == 0, false, "[osp-installer] chmod() is failed(%s), filepath = [%s], mode = [%o]", strerror(errno), pFilePath.get(), mode);
+ TryReturn(err == 0, false, "[osp-installer] chmod() is failed(%s), filepath=[%s], mode=[%o]", strerror(errno), pFilePath.get(), mode);
return true;
}
TryReturn(pFilePath, false, "[osp-installer] pFilePath is null");
err = chown(pFilePath.get(), APP_OWNER_ID, APP_GROUP_ID);
- TryReturn(err == 0, false, "[osp-installer] chown() is failed(%s), filepath = [%s]", strerror(errno), pFilePath.get());
+ TryReturn(err == 0, false, "[osp-installer] chown() is failed(%s), filepath=[%s]", strerror(errno), pFilePath.get());
return true;
}
result r = E_SUCCESS;
bool res = false;
+ AppLogTag(OSP_INSTALLER, "+ ChangeDirectoryPermission(): path=[%ls], mode=[%04o]", filePath.GetPointer(), mode);
+
res = File::IsFileExist(filePath);
- TryReturn(res == true, false, "[osp-installer] file not found, filePath = [%ls]", filePath.GetPointer());
+ if (res == false)
+ {
+ AppLogTag(OSP_INSTALLER, "ChangeDirectoryPermission(): path=[%ls]: skip", filePath.GetPointer());
+ return true;
+ }
std::unique_ptr<Directory> pDir(new Directory);
TryReturn(pDir, false, "[osp-installer] pDir is null.");
r = pDir->Construct(filePath);
- TryReturn(!IsFailed(r), false, "[osp-installer] pDir->Construct() failed, filePath = [%ls]", filePath.GetPointer());
+ TryReturn(!IsFailed(r), false, "[osp-installer] pDir->Construct() failed, filePath=[%ls]", filePath.GetPointer());
std::unique_ptr<DirEnumerator> pDirEnum(pDir->ReadN());
TryReturn(pDirEnum, false, "[osp-installer] pDirEnum is null.");
bool
InstallerUtil::IsDrmFile(const Osp::Base::String& path)
{
- AppLogTag(OSP_INSTALLER, "IsDrmFile() called, path = [%ls]", path.GetPointer());
+ AppLogTag(OSP_INSTALLER, "+ IsDrmFile() called, path=[%ls]", path.GetPointer());
return false;
}
bool
InstallerUtil::DecryptPackage(const Osp::Base::String& packagePath)
{
- AppLogTag(OSP_INSTALLER, "DecryptPackage() called, packagePath = [%ls]", packagePath.GetPointer());
+ AppLogTag(OSP_INSTALLER, "+ DecryptPackage() called, packagePath=[%ls]", packagePath.GetPointer());
return true;
}
}
bool
-InstallerUtil::CreateSymlinkForAppId(const String& inPath, String& outPath)
+InstallerUtil::CreateSymlinkForAppDirectory(const String& inPath, String& outPath)
{
String appId;
+
+ AppLogTag(OSP_INSTALLER, "+ CreateSymlinkForAppDirectory(): path=[%ls]", inPath.GetPointer());
+
int length = inPath.GetLength();
inPath.SubString(length - APPID_LENGTH, APPID_LENGTH, appId);
}
outPath = newPath;
+ AppLogTag(OSP_INSTALLER, "CreateSymlinkForAppDirectory(): output path=[%ls]", outPath.GetPointer());
return true;
}
-void
-InstallerUtil::Log(const char* pTagName, const char* pFormat, ...)
-{
- va_list args;
-
- va_start(args, pFormat);
-
- AppLogTagInternal(OSP_INSTALLER, "", 0, pFormat, args);
-
- va_end(args);
-
-}
-