tac_error_e resetTACPackage(const std::string& pkgId)
{
- std::string pkgRoot;
- if (getRootPath(pkgId, pkgRoot) < 0) {
+ std::string rootPath = getRootPath(pkgId);
+ if (rootPath.empty()) {
fprintf(stderr, "Failed to get root path from [%s]\n", pkgId.c_str());
return TAC_ERROR_INVALID_PACKAGE;
}
std::vector<std::string> tacNativeImage;
- std::string binDir = concatPath(pkgRoot, "bin");
+ std::string binDir = concatPath(rootPath, "bin");
std::string tacDir = concatPath(binDir, TAC_SYMLINK_SUB_DIR);
if (bf::exists(tacDir)) {
try {
tac_error_e disableTACPackage(const std::string& pkgId)
{
- std::string pkgRoot;
- if (getRootPath(pkgId, pkgRoot) < 0) {
+ std::string rootPath = getRootPath(pkgId);
+ if (rootPath.empty()) {
fprintf(stderr, "Failed to get root path from [%s]\n", pkgId.c_str());
return TAC_ERROR_INVALID_PACKAGE;
}
- std::string binDir = concatPath(pkgRoot, "bin");
+ std::string binDir = concatPath(rootPath, "bin");
std::string tacDir = concatPath(binDir, TAC_SYMLINK_SUB_DIR);
std::string binNIDir = concatPath(binDir, APP_NI_SUB_DIR);
if (bf::exists(tacDir)) {
tac_error_e enableTACPackage(const std::string& pkgId)
{
- std::string rootPath;
- if (getRootPath(pkgId, rootPath) < 0) {
+ std::string rootPath = getRootPath(pkgId);
+ if (rootPath.empty()) {
fprintf(stderr, "Failed to get root path from [%s]\n", pkgId.c_str());
return TAC_ERROR_INVALID_PACKAGE;
}
- std::string execName;
- if (getExecName(pkgId, execName) < 0) {
- fprintf(stderr, "Failed to get root path from [%s]\n", pkgId.c_str());
+ std::string execName = getExecName(pkgId);
+ if (execName.empty()) {
+ fprintf(stderr, "Failed to get exec name from [%s]\n", pkgId.c_str());
return TAC_ERROR_INVALID_PACKAGE;
}
- std::string metaValue;
- if (getMetadataValue(pkgId, TAC_METADATA_KEY, metaValue) < 0) {
- fprintf(stderr, "Failed to get root path from [%s]\n", pkgId.c_str());
+ std::string metaValue = getMetadataValue(pkgId, TAC_METADATA_KEY);
+ if (metaValue.empty()) {
+ fprintf(stderr, "Failed to get metadata from [%s]\n", pkgId.c_str());
return TAC_ERROR_INVALID_PACKAGE;
}