fix: check if INSTALL script does not exist

This commit is contained in:
ngn 2024-08-08 19:07:28 +03:00
parent 8080299d7d
commit cdb997215b
3 changed files with 3 additions and 6 deletions

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-08-08 16:32+0300\n"
"POT-Creation-Date: 2024-08-08 19:07+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"

View File

@ -20,8 +20,7 @@ bool __lm_ctx_save_install(lm_ctx_t *ctx, lm_pkg_t *pkg, char *install_path){
return false;
}
// no need to save empty install script :)
if(is_empty(install_path))
if(!exists(install_path, NULL) || is_empty(install_path))
return true;
char script_name[strlen(pkg->data.name)+15];
@ -42,8 +41,7 @@ bool __lm_ctx_save_install(lm_ctx_t *ctx, lm_pkg_t *pkg, char *install_path){
}
bool __lm_ctx_run_install(char *root, char *install_path) {
// no need to run empty install script :)
if(is_empty(install_path))
if(!exists(install_path, NULL) || is_empty(install_path))
return true;
char *args[] = {"/bin/bash", install_path, NULL}, *oldpwd = NULL;

View File

@ -42,7 +42,6 @@ lm_pkg_files_t *lm_package_extract(lm_pkg_t *pkg, char *target){
if(!__lm_package_extract_check(files->data_file) ||
!__lm_package_extract_check(files->hashes_file) ||
!__lm_package_extract_check(files->changes_file) ||
!__lm_package_extract_check(files->install_file) ||
!__lm_package_extract_check(files->files_archive)){
goto end;
}