Compare commits

..

No commits in common. "main" and "24.02" have entirely different histories.
main ... 24.02

4 changed files with 30 additions and 35 deletions

View File

@ -11,7 +11,7 @@ OBJS = $(patsubst src/%.c,dist/%.o,$(SRCS))
CFLAGS = -O3 -fstack-protector-strong -fcf-protection=full -fstack-clash-protection CFLAGS = -O3 -fstack-protector-strong -fcf-protection=full -fstack-clash-protection
LIBS = -linih -lmp LIBS = -linih -lmp
VERSION = 24.04 VERSION = 24.02
all: dist dist/matt $(PO_OUTS) all: dist dist/matt $(PO_OUTS)

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-08-25 22:43+0300\n" "POT-Creation-Date: 2024-08-22 03:32+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -17,11 +17,11 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: src/callback.c:39 src/callback.c:56 #: src/callback.c:36 src/callback.c:53
msgid "Failed to sync " msgid "Failed to sync "
msgstr "Failed to sync " msgstr "Failed to sync "
#: src/callback.c:50 src/cmd/sync.c:46 #: src/callback.c:47 src/cmd/sync.c:46
msgid "Synced " msgid "Synced "
msgstr "Synced " msgstr "Synced "
@ -204,7 +204,7 @@ msgstr "Failed to run the editor: %s"
msgid "Failed to open the editor: %s" msgid "Failed to open the editor: %s"
msgstr "Failed to open the editor: %s" msgstr "Failed to open the editor: %s"
#: src/cmd/info.c:13 src/cmd/info.c:23 src/cmd/install.c:94 src/cmd/remove.c:53 #: src/cmd/info.c:13 src/cmd/info.c:23 src/cmd/install.c:92 src/cmd/remove.c:53
msgid "Package " msgid "Package "
msgstr "Package " msgstr "Package "
@ -294,67 +294,67 @@ msgstr "There are no avaliable pools, have you synced yet?"
msgid "Specified " msgid "Specified "
msgstr "Specified " msgstr "Specified "
#: src/cmd/install.c:76 #: src/cmd/install.c:73
msgid "Failed to load " msgid "Failed to load "
msgstr "Failed to load " msgstr "Failed to load "
#: src/cmd/install.c:85 src/cmd/remove.c:55 #: src/cmd/install.c:83 src/cmd/remove.c:55
msgid "Failed to find " msgid "Failed to find "
msgstr "Failed to find " msgstr "Failed to find "
#: src/cmd/install.c:103 #: src/cmd/install.c:101
msgid "Failed to resolve " msgid "Failed to resolve "
msgstr "Failed to resolve " msgstr "Failed to resolve "
#: src/cmd/install.c:112 #: src/cmd/install.c:110
msgid "Nothing to do (no packages to install)" msgid "Nothing to do (no packages to install)"
msgstr "Nothing to do (no packages to install)" msgstr "Nothing to do (no packages to install)"
#: src/cmd/install.c:121 src/cmd/install.c:123 src/cmd/remove.c:75 #: src/cmd/install.c:119 src/cmd/install.c:121 src/cmd/remove.c:75
#: src/cmd/remove.c:77 src/cmd/update.c:50 src/cmd/update.c:52 #: src/cmd/remove.c:77 src/cmd/update.c:50 src/cmd/update.c:52
msgid "Following " msgid "Following "
msgstr "Following " msgstr "Following "
#: src/cmd/install.c:129 src/cmd/remove.c:84 #: src/cmd/install.c:127 src/cmd/remove.c:84
msgid "Total of " msgid "Total of "
msgstr "Total of " msgstr "Total of "
#: src/cmd/install.c:132 src/cmd/update.c:59 #: src/cmd/install.c:130 src/cmd/update.c:59
#, c-format #, c-format
msgid "Root directory is modified, install scripts will be saved in %s" msgid "Root directory is modified, install scripts will be saved in %s"
msgstr "Root directory is modified, install scripts will be saved in %s" msgstr "Root directory is modified, install scripts will be saved in %s"
#: src/cmd/install.c:134 src/cmd/remove.c:85 src/cmd/update.c:61 #: src/cmd/install.c:132 src/cmd/remove.c:85 src/cmd/update.c:61
msgid "Continue?" msgid "Continue?"
msgstr "Continue?" msgstr "Continue?"
#: src/cmd/install.c:135 src/cmd/remove.c:86 src/cmd/update.c:62 #: src/cmd/install.c:133 src/cmd/remove.c:86 src/cmd/update.c:62
msgid "Operation cancelled" msgid "Operation cancelled"
msgstr "Operation cancelled" msgstr "Operation cancelled"
#: src/cmd/install.c:151 src/cmd/install.c:155 src/cmd/install.c:175 #: src/cmd/install.c:149 src/cmd/install.c:153 src/cmd/install.c:173
#: src/cmd/install.c:191 src/cmd/remove.c:93 src/cmd/update.c:72 #: src/cmd/install.c:189 src/cmd/remove.c:93 src/cmd/update.c:72
#: src/cmd/update.c:83 src/cmd/update.c:94 #: src/cmd/update.c:83 src/cmd/update.c:94
msgid "(" msgid "("
msgstr "(" msgstr "("
#: src/cmd/install.c:161 src/cmd/update.c:78 #: src/cmd/install.c:159 src/cmd/update.c:78
msgid "Failed to download " msgid "Failed to download "
msgstr "Failed to download " msgstr "Failed to download "
#: src/cmd/install.c:182 src/cmd/remove.c:100 src/cmd/update.c:89 #: src/cmd/install.c:180 src/cmd/remove.c:100 src/cmd/update.c:89
msgid "Failed to remove " msgid "Failed to remove "
msgstr "Failed to remove " msgstr "Failed to remove "
#: src/cmd/install.c:198 src/cmd/update.c:100 #: src/cmd/install.c:196 src/cmd/update.c:100
msgid "Failed to install " msgid "Failed to install "
msgstr "Failed to install " msgstr "Failed to install "
#: src/cmd/install.c:205 #: src/cmd/install.c:203
msgid "Installed " msgid "Installed "
msgstr "Installed " msgstr "Installed "
#: src/cmd/install.c:205 #: src/cmd/install.c:203
msgid "Installed all of the " msgid "Installed all of the "
msgstr "Installed all of the " msgstr "Installed all of the "

View File

@ -3,10 +3,7 @@
#include "log.h" #include "log.h"
bool callback_install(lm_ctx_t *ctx, lm_pkg_t *pkg, char *file, size_t current, size_t total, void *data) { bool callback_install(lm_ctx_t *ctx, lm_pkg_t *pkg, char *file, size_t current, size_t total, void *data) {
if (current < total) bar(current, total);
bar(current, total);
else
bar_free();
return true; return true;
} }

View File

@ -47,7 +47,7 @@ bool cmd_install(lm_ctx_t *ctx, config_t *config, args_t *args){
ssize_t current = 0, size = 0, save = 0, li = 0; ssize_t current = 0, size = 0, save = 0, li = 0;
bool ret = false, r = false, is_local = false; bool ret = false, r = false, is_local = false;
lm_pkg_t *pkg = NULL, **locals = NULL; lm_pkg_t *pkg = NULL, *locals = NULL;
lm_ctx_resolve_list_t *list = NULL; lm_ctx_resolve_list_t *list = NULL;
lm_entry_t older; lm_entry_t older;
char ssize[LONGSTR_MAX+3]; char ssize[LONGSTR_MAX+3];
@ -57,7 +57,7 @@ bool cmd_install(lm_ctx_t *ctx, config_t *config, args_t *args){
if(NULL != args->list[i].name || NULL == (name = args->list[i].value)) if(NULL != args->list[i].name || NULL == (name = args->list[i].value))
continue; continue;
// if this is a local archive, load it // if thiş is a local archive, load it
if(endswith(name, ".mpf") && access(name, F_OK) == 0){ if(endswith(name, ".mpf") && access(name, F_OK) == 0){
if(access(name, R_OK) != 0){ if(access(name, R_OK) != 0){
error(_("Specified "FG_BOLD"%s"FG_RESET" archive does not have read access"), name); error(_("Specified "FG_BOLD"%s"FG_RESET" archive does not have read access"), name);
@ -65,18 +65,16 @@ bool cmd_install(lm_ctx_t *ctx, config_t *config, args_t *args){
} }
if(NULL == locals) if(NULL == locals)
locals = malloc(sizeof(lm_pkg_t*)); locals = malloc(sizeof(lm_pkg_t));
else else
locals = realloc(locals, sizeof(lm_pkg_t*)*((++li)+1)); locals = realloc(locals, sizeof(lm_pkg_t)*((++li)+1));
pkg = malloc(sizeof(lm_pkg_t)); if(!lm_ctx_package_from(ctx, &locals[li], name)){
locals[li] = pkg;
if(!lm_ctx_package_from(ctx, pkg, name)){
error(_("Failed to load "FG_BOLD"%s"FG_RESET": %s"), name, lm_strerror()); error(_("Failed to load "FG_BOLD"%s"FG_RESET": %s"), name, lm_strerror());
goto end; goto end;
} }
pkg = &locals[li];
goto resolve; goto resolve;
} }
@ -141,7 +139,7 @@ bool cmd_install(lm_ctx_t *ctx, config_t *config, args_t *args){
is_local = false; is_local = false;
for(size_t i = 0; i < (li+1) && NULL != locals; i++){ for(size_t i = 0; i < (li+1) && NULL != locals; i++){
if(lm_package_is_same(locals[i], pkg)){ if(lm_package_is_same(&locals[i], pkg)){
is_local = true; is_local = true;
break; break;
} }
@ -210,7 +208,7 @@ end:
bar_free(); bar_free();
for(size_t i = 0; i < (li+1) && NULL != locals; i++) for(size_t i = 0; i < (li+1) && NULL != locals; i++)
lm_ctx_package_from_free(locals[li]); lm_ctx_package_from_free(&locals[li]);
free(locals); free(locals);
lm_ctx_resolve_free(list); lm_ctx_resolve_free(list);