From ea28e9ee1b35bbbd5bc8e6e6ee68beaf6ac3935e Mon Sep 17 00:00:00 2001 From: ngn Date: Thu, 1 Aug 2024 19:31:25 +0300 Subject: [PATCH] fix: remove libmp headers --- Makefile | 2 +- locale/tr/LC_MESSAGES/confer.po | 150 +++++++++++++++++++++++++++++--- src/cmd.h | 1 - src/main.c | 29 +++--- 4 files changed, 151 insertions(+), 31 deletions(-) diff --git a/Makefile b/Makefile index 900956c..a5e5e50 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ dist/%.o: src/%.c locale/%.mo: locale/%.po msgfmt $^ -o $@ -locale/%.po: locale/mc.pot +locale/%.po: locale/confer.pot cp $@ $@.old if msgmerge $@ $^ -o $@ ; then \ rm $@.old ; \ diff --git a/locale/tr/LC_MESSAGES/confer.po b/locale/tr/LC_MESSAGES/confer.po index 4e633d7..4a07449 100644 --- a/locale/tr/LC_MESSAGES/confer.po +++ b/locale/tr/LC_MESSAGES/confer.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-08-01 04:31+0300\n" +"POT-Creation-Date: 2024-08-01 19:30+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -66,6 +66,15 @@ msgstr "Author" msgid "Keywords" msgstr "Keywords" +#: src/ctx.c:15 +msgid "Home directory is NULL" +msgstr "" + +#: src/ctx.c:21 src/ctx.c:37 +#, fuzzy +msgid "Failed to access to the home directory" +msgstr "Failed to open the directory: %s" + #: src/log.c:127 msgid "y" msgstr "y" @@ -103,45 +112,52 @@ msgstr "pull down a configuration" msgid "build the configuration in the current directory" msgstr "build the configuration in the current directory" -#: src/main.c:73 -msgid "Please specify the homedir with " +#: src/main.c:78 +#, fuzzy +msgid "Please specify the home directory with " msgstr "Please specify the homedir with " -#: src/main.c:84 +#: src/main.c:83 +#, fuzzy +msgid "Cannot access to the home directory (" +msgstr "Failed to open the directory: %s" + +#: src/main.c:97 msgid "Failed to lock, confer is already running" msgstr "Failed to lock, confer is already running" -#: src/main.c:88 -msgid "Failed to lock, are you root?" -msgstr "Failed to lock, are you root?" +#: src/main.c:101 +msgid "Failed to lock, do you have access to the home directory?" +msgstr "" -#: src/main.c:100 +#: src/main.c:113 msgid "Command not found: " msgstr "Command not found: " -#: src/main.c:102 +#: src/main.c:115 #, c-format msgid "MatterLinux configuration manager (version %s)" msgstr "MatterLinux configuration manager (version %s)" -#: src/main.c:103 +#: src/main.c:116 msgid "Usage: " msgstr "Usage: " -#: src/main.c:105 +#: src/main.c:118 msgid "Here is a list of available commands:" msgstr "Here is a list of available commands:" -#: src/main.c:111 +#: src/main.c:124 msgid "Here is a list of available options:" msgstr "Here is a list of available options:" -#: src/main.c:114 src/main.c:115 +#: src/main.c:126 src/main.c:127 #, c-format msgid " " msgstr " " -#: src/main.c:117 +#: src/main.c:129 +#, fuzzy msgid "" "Licensed under GPLv3, see https://www.gnu.org/licenses/ for more information" msgstr "" @@ -221,3 +237,109 @@ msgstr "Failed to open \"%s\" for reading" #, c-format msgid "Failed to open \"%s\" for writing" msgstr "Failed to open \"%s\" for writing" + +#: src/cmd/gen.c:24 +msgid "Please specify only a signle directory for the repository" +msgstr "" + +#: src/cmd/gen.c:29 +msgid "Please specify a directory for the repository" +msgstr "" + +#: src/cmd/gen.c:34 +#, fuzzy +msgid "Failed to access the directory" +msgstr "Failed to open the directory: %s" + +#: src/cmd/gen.c:39 +#, fuzzy +msgid "Failed to change directory to the specified directory" +msgstr "Failed to create directory: %s" + +#: src/cmd/gen.c:44 src/cmd/pull.c:102 +#, fuzzy +msgid "Failed to load the configuration file (" +msgstr "Failed to parse configuration file" + +#: src/cmd/gen.c:49 src/cmd/pull.c:107 +#, fuzzy +msgid "Loaded repository configuration" +msgstr "Failed to parse configuration file" + +#: src/cmd/gen.c:55 src/cmd/pull.c:134 +msgid "Copying all the targets" +msgstr "" + +#: src/cmd/gen.c:61 src/cmd/pull.c:150 +#, fuzzy +msgid "Failed to copy the target:" +msgstr "Failed to open the directory: %s" + +#: src/cmd/pull.c:39 +msgid "Please specify only a single config name or a URL" +msgstr "" + +#: src/cmd/pull.c:44 +#, fuzzy +msgid "Please specify a config name or a URL" +msgstr "Please specify the homedir with " + +#: src/cmd/pull.c:62 +#, fuzzy +msgid "Specified configuration is not found" +msgstr "Configuration file not found" + +#: src/cmd/pull.c:65 +msgid "Failed to access the URL" +msgstr "" + +#: src/cmd/pull.c:81 +msgid "Cloning " +msgstr "" + +#: src/cmd/pull.c:86 +#, fuzzy, c-format +msgid "Failed to clone the %s:" +msgstr "Failed to open the directory: %s" + +#: src/cmd/pull.c:97 +#, fuzzy, c-format +msgid "Failed to chdir to %s" +msgstr "Failed to create directory: %s" + +#: src/cmd/pull.c:110 +msgid "Do you want to continue?" +msgstr "" + +#: src/cmd/pull.c:116 +msgid "Checking all the targets" +msgstr "" + +#: src/cmd/pull.c:122 +#, fuzzy, c-format +msgid "Failed to access the source for the target \"%s\"" +msgstr "Failed to get the location header" + +#: src/cmd/pull.c:131 +msgid "All the target checks were successful" +msgstr "" + +#: src/cmd/pull.c:144 +msgid "Install the target?" +msgstr "" + +#: src/cmd/pull.c:145 +msgid "Skipping target" +msgstr "" + +#: src/cmd/pull.c:178 +msgid "Installing all the requirements" +msgstr "" + +#: src/cmd/pull.c:181 +#, fuzzy +msgid "Failed to run the " +msgstr "Failed to init curl" + +#~ msgid "Failed to lock, are you root?" +#~ msgstr "Failed to lock, are you root?" diff --git a/src/cmd.h b/src/cmd.h index 72bccb1..54f49fa 100644 --- a/src/cmd.h +++ b/src/cmd.h @@ -1,5 +1,4 @@ #pragma once -#include #include #include "args.h" diff --git a/src/main.c b/src/main.c index 7870a00..65d4bad 100644 --- a/src/main.c +++ b/src/main.c @@ -20,9 +20,8 @@ */ -// clang-format on +// clang-format on -#include #include #include #include @@ -42,10 +41,10 @@ ctx_t ctx; -void handler(int sig){ +void handler(int sig) { unlock(ctx.lock_path); printf("\e[?25h\n"); - if(SIGSEGV == sig) + if (SIGSEGV == sig) error(_("Program received a segfault")); exit(1); } @@ -59,28 +58,29 @@ int main(int argc, char *argv[]) { textdomain("confer"); cmd_t commands[] = { - {.name = "pull", .lock = true, .desc = _("pull down a configuration"), .func = cmd_pull }, - {.name = "gen", .lock = false, .desc = _("build the configuration in the current directory"), .func = cmd_gen }, + {.name = "pull", .lock = true, .desc = _("pull down a configuration"), .func = cmd_pull}, + {.name = "gen", .lock = false, .desc = _("build the configuration in the current directory"), .func = cmd_gen }, }; - args_t *args = NULL; - char *homedir = NULL; - bool ret = false; + args_t *args = NULL; + char *homedir = NULL; + bool ret = false; args = args_parse(argc, argv); if (args->count <= 0 || args->list[0].name != NULL) goto help; - if((homedir = args_get_string(args, "home")) == NULL) + if ((homedir = args_get_string(args, "home")) == NULL) homedir = getenv("HOME"); - if(!ctx_init(&ctx, homedir)){ + if (!ctx_init(&ctx, homedir)) { switch (errno) { case HomedirInvalid: - error(_("Please specify the home directory with "FG_BOLD"--home"FG_RESET" option or specify the "FG_BOLD"HOME"FG_RESET" environment variable")); + error(_("Please specify the home directory with " FG_BOLD "--home" FG_RESET " option or specify the " FG_BOLD + "HOME" FG_RESET " environment variable")); break; case HomedirAccessFail: - error(_("Cannot access to the home directory ("FG_BOLD"%s"FG_RESET")"), homedir); + error(_("Cannot access to the home directory (" FG_BOLD "%s" FG_RESET ")"), homedir); break; } @@ -123,8 +123,7 @@ help: info(_("Here is a list of available options:")); - printf( - _(" " FG_BOLD "--yes" FG_RESET ":\t skip the confirmation\n")); + printf(_(" " FG_BOLD "--yes" FG_RESET ":\t skip the confirmation\n")); printf(_(" " FG_BOLD "--home" FG_RESET ":\t path to your home directory\n\n")); info(_("Licensed under GPLv3, see https://www.gnu.org/licenses/ for more information"));