#include <apt-pkg/strutl.h>
#include <apt-private/private-cmndline.h>
+#include <apt-private/private-main.h>
#include <stdarg.h>
#include <string.h>
Configuration * const * const Cnf, pkgSystem ** const Sys, int const argc, const char *argv[],
bool (*ShowHelp)(CommandLine &), std::vector<aptDispatchWithHelp> (*GetCommands)(void))
{
+ InitLocale(Binary);
if (Cnf != NULL && pkgInitConfig(**Cnf) == false)
{
_error->DumpErrors();
#include <apti18n.h>
-void InitLocale() /*{{{*/
+void InitLocale(APT_CMD const binary) /*{{{*/
{
std::locale::global(std::locale(""));
- textdomain(PACKAGE);
+ switch(binary)
+ {
+ case APT_CMD::APT:
+ case APT_CMD::APT_CACHE:
+ case APT_CMD::APT_CDROM:
+ case APT_CMD::APT_CONFIG:
+ case APT_CMD::APT_HELPER:
+ case APT_CMD::APT_GET:
+ case APT_CMD::APT_MARK:
+ textdomain("apt");
+ break;
+ case APT_CMD::APT_EXTRACTTEMPLATES:
+ case APT_CMD::APT_FTPARCHIVE:
+ case APT_CMD::APT_INTERNAL_SOLVER:
+ case APT_CMD::APT_SORTPKG:
+ textdomain("apt-utils");
+ break;
+ }
}
+void InitLocale() {}
/*}}}*/
void InitSignals() /*{{{*/
{
#ifndef APT_PRIVATE_MAIN_H
#define APT_PRIVATE_MAIN_H
+#include <apt-private/private-cmndline.h>
+
#include <apt-pkg/macros.h>
class CommandLine;
-APT_PUBLIC void InitLocale();
+void InitLocale(APT_CMD const binary);
+APT_PUBLIC APT_DEPRECATED_MSG("Is a no-op now") void InitLocale();
APT_PUBLIC void InitSignals();
APT_PUBLIC void CheckIfSimulateMode(CommandLine &CmdL);
APT_PUBLIC void CheckIfCalledByScript(int argc, const char *argv[]);
/*}}}*/
int main(int argc,const char *argv[]) /*{{{*/
{
- InitLocale();
-
// Parse the command line and initialize the package library
CommandLine CmdL;
auto const Cmds = ParseCommandLine(CmdL, APT_CMD::APT_CACHE, &_config, &_system, argc, argv, &ShowHelp, &GetCommands);
/*}}}*/
int main(int argc,const char *argv[]) /*{{{*/
{
- InitLocale();
-
// Parse the command line and initialize the package library
CommandLine CmdL;
auto const Cmds = ParseCommandLine(CmdL, APT_CMD::APT_CDROM, &_config, &_system, argc, argv, &ShowHelp, &GetCommands);
/*}}}*/
int main(int argc,const char *argv[]) /*{{{*/
{
- InitLocale();
-
// Parse the command line and initialize the package library
CommandLine CmdL;
auto const Cmds = ParseCommandLine(CmdL, APT_CMD::APT_CONFIG, &_config, &_system, argc, argv, &ShowHelp, &GetCommands);
/*}}}*/
int main(int argc, const char **argv) /*{{{*/
{
- InitLocale();
-
CommandLine CmdL;
auto const Cmds = ParseCommandLine(CmdL, APT_CMD::APT_EXTRACTTEMPLATES, &_config, &_system, argc, argv, &ShowHelp, &GetCommands);
/*}}}*/
int main(int argc,const char *argv[]) /*{{{*/
{
- InitLocale();
-
// Parse the command line and initialize the package library
CommandLine CmdL;
auto const Cmds = ParseCommandLine(CmdL, APT_CMD::APT_GET, &_config, &_system, argc, argv, &ShowHelp, &GetCommands);
/*}}}*/
int main(int argc,const char *argv[]) /*{{{*/
{
- InitLocale();
-
CommandLine CmdL;
auto const Cmds = ParseCommandLine(CmdL, APT_CMD::APT_HELPER, &_config, &_system, argc, argv, &ShowHelp, &GetCommands);
/*}}}*/
int main(int argc,const char *argv[]) /*{{{*/
{
- InitLocale();
-
// we really don't need anything
DropPrivileges();
/*}}}*/
int main(int argc,const char *argv[]) /*{{{*/
{
- InitLocale();
-
CommandLine CmdL;
auto const Cmds = ParseCommandLine(CmdL, APT_CMD::APT_MARK, &_config, &_system, argc, argv, &ShowHelp, &GetCommands);
/*}}}*/
int main(int argc,const char *argv[]) /*{{{*/
{
- InitLocale();
-
CommandLine CmdL;
ParseCommandLine(CmdL, APT_CMD::APT_SORTPKG, &_config, &_system, argc, argv, &ShowHelp, &GetCommands);
/*}}}*/
int main(int argc, const char *argv[]) /*{{{*/
{
- InitLocale();
-
CommandLine CmdL;
auto const Cmds = ParseCommandLine(CmdL, APT_CMD::APT, &_config, &_system, argc, argv, &ShowHelp, &GetCommands);
/*}}}*/
int main(int argc, const char *argv[]) /*{{{*/
{
- InitLocale();
-
// Parse the command line and initialize the package library
CommandLine CmdL;
auto const Cmds = ParseCommandLine(CmdL, APT_CMD::APT_FTPARCHIVE, &_config, NULL, argc, argv, ShowHelp, &GetCommands);