return TAC_ERROR_UNKNOWN;
}
- ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, TAC_METADATA_KEY, METADATA_VALUE);
+ ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, TAC_METADATA_KEY, METADATA_VALUE_TRUE);
if (ret != PMINFO_R_OK) {
pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
return TAC_ERROR_UNKNOWN;
for (auto& symlinkAssembly : bf::recursive_directory_iterator(tacDir)) {
std::string symPath = symlinkAssembly.path().string();
std::string fileName = symlinkAssembly.path().filename().string();
- if (bf::is_symlink(symPath)) {
+ if (isSymlinkFile(symPath)) {
std::string originPath = bf::read_symlink(symPath).string();
if (!isNativeImage(symPath)) {
std::string dllPath = concatPath(binDir, fileName);
return TAC_ERROR_INVALID_PACKAGE;
}
- if (!strcmp(metaValue.c_str(), "true")) {
+ if (!strcmp(metaValue.c_str(), METADATA_VALUE_TRUE)) {
std::string binDir = concatPath(rootPath, "bin");
std::string tacDir = concatPath(binDir, TAC_SYMLINK_SUB_DIR);
std::string binNIDir = concatPath(binDir, APP_NI_SUB_DIR);
}
}
+ bs::error_code error;
for (auto& originPath : enableNuget) {
if (exist(originPath)) {
std::string fileName = originPath.substr(originPath.rfind('/') + 1);
if (exist(binNIDir)) {
std::string originNIPath = changeExtension(originPath, "dll", "ni.dll");
if (exist(originNIPath)) {
- bf::create_symlink(originNIPath, concatPath(tacDir, NIFileName));
+ bf::create_symlink(originNIPath, concatPath(tacDir, NIFileName), error);
+ if (error) {
+ _SERR("Failed to create symlink %s file", concatPath(tacDir, NIFileName).c_str());
+ return TAC_ERROR_UNKNOWN;
+ }
_SOUT("%s symbolic link file generated successfully.", concatPath(tacDir, NIFileName).c_str());
copySmackAndOwnership(tacDir.c_str(), concatPath(tacDir, NIFileName).c_str(), true);
}
}
}
- bf::create_symlink(originPath, concatPath(tacDir, fileName));
+ bf::create_symlink(originPath, concatPath(tacDir, fileName), error);
+ if (error) {
+ _SERR("Failed to create symlink %s file", concatPath(tacDir, fileName).c_str());
+ return TAC_ERROR_UNKNOWN;
+ }
_SOUT("%s symbolic link file generated successfully.", concatPath(tacDir, fileName).c_str());
copySmackAndOwnership(tacDir.c_str(), concatPath(tacDir, fileName).c_str(), true);
return TAC_ERROR_UNKNOWN;
}
- ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, TAC_METADATA_KEY, METADATA_VALUE);
+ ret = pkgmgrinfo_appinfo_metadata_filter_add(handle, TAC_METADATA_KEY, METADATA_VALUE_TRUE);
if (ret != PMINFO_R_OK) {
pkgmgrinfo_appinfo_metadata_filter_destroy(handle);
return TAC_ERROR_UNKNOWN;