From: Ilho Kim Date: Thu, 19 Dec 2024 04:46:05 +0000 (+0900) Subject: Fix Update fail when there is no pacakge root path X-Git-Tag: accepted/tizen/unified/20241224.130057~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2dbb35f2a90f35fd6bee623f30595c794df58609;p=platform%2Fcore%2Fappfw%2Fapp-installers.git Fix Update fail when there is no pacakge root path Among the steps executed in Update, there are steps that presupporse that the root path of the package exists If the root path of the package doesn't exist and there is package information in the database, the update type installation is performed and the update will fail In this case, Install type installation is performed instead of Update type Change-Id: I1f5dae8a29101728a546667baf329ef08c6292af Signed-off-by: Ilho Kim --- diff --git a/src/common/pkgmgr_interface.cc b/src/common/pkgmgr_interface.cc index b7d3ccdf..03324daa 100644 --- a/src/common/pkgmgr_interface.cc +++ b/src/common/pkgmgr_interface.cc @@ -18,6 +18,7 @@ #include "common/pkgmgr_registration.h" #include "common/utils/file_util.h" #include "common/utils/manifest_util.h" +#include "common/utils/request.h" #include "common/utils/user_util.h" namespace fs = std::filesystem; @@ -32,8 +33,8 @@ const uid_t kGlobalUserUid = tzplatform_getuid(TZ_SYS_GLOBALAPP_USER); bool CheckIfAppFilesExists(const std::string& pkgid, uid_t uid, bool is_readonly) { - return fs::exists(ci::GetManifestLocation(pkgid, - uid, is_readonly)); + return fs::exists(ci::GetManifestLocation(pkgid, uid, is_readonly)) && + fs::exists(fs::path(ci::GetRootAppPath(is_readonly, uid)) / pkgid); } bool IsDeltaPkg(const std::string& path) {