diff --git a/locale/tr/LC_MESSAGES/libmp.po b/locale/tr/LC_MESSAGES/libmp.po index 7a83c6f..7db0e02 100644 --- a/locale/tr/LC_MESSAGES/libmp.po +++ b/locale/tr/LC_MESSAGES/libmp.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-07-16 16:03+0300\n" +"POT-Creation-Date: 2024-07-16 19:29+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/src/ctx/install.c b/src/ctx/install.c index 5c8c6a0..33401aa 100644 --- a/src/ctx/install.c +++ b/src/ctx/install.c @@ -170,11 +170,6 @@ bool lm_ctx_install(lm_ctx_t *ctx, lm_pkg_t *pkg, lm_ctx_install_callback_t call return false; } - if(lm_ctx_database_is_installed(ctx, pkg, false)){ - lm_error_set(LM_ERR_PkgAlreadyInstalled); - return false; - } - if(NULL == ctx->root){ lm_error_set(LM_ERR_CtxRootNULL); return false; @@ -188,6 +183,16 @@ bool lm_ctx_install(lm_ctx_t *ctx, lm_pkg_t *pkg, lm_ctx_install_callback_t call if(!lm_ctx_database_init(ctx)) return false; // error set by function + if(lm_ctx_database_is_installed(ctx, pkg, false)){ + lm_error_set(LM_ERR_PkgAlreadyInstalled); + return false; + } + + if(lm_package_path_is_empty(pkg)){ + lm_error_set(LM_ERR_PkgPathsEmpty); + return false; + } + if(!extract_archive(ctx->temp, pkg->paths.archive)) return false; // error set by function diff --git a/src/util.c b/src/util.c index 4aef5fd..7c71f13 100644 --- a/src/util.c +++ b/src/util.c @@ -140,6 +140,7 @@ bool extract_archive(char *dst, char *src) { char srcfull[PATH_MAX + 1]; if (NULL == realpath(src, srcfull)) { + pdebug(__func__, "failed to get realpath for %s: %s", src, strerror(errno)); lm_error_set(LM_ERR_ArcRealpathFail); goto end; }