summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2016-05-28 13:53:09 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2016-05-28 18:12:02 +0200
commit570ec96dbf4f720d8eff694f8c4429e0b0a033b4 (patch)
tree8e9ed5f6ba9e09c97a3a74ad855fa6c27d0d1057
parent8b79c94af7f7cf2e5e5342294bc6e5a908cacabf (diff)
look into the right textdomain for apt-utils again
Broken in e7e10e47476606e3b2274cf66b1e8ea74b236757 by looking always into "apt" while we ship some tools in "apt-utils"…
-rw-r--r--apt-private/private-cmndline.cc2
-rw-r--r--apt-private/private-main.cc22
-rw-r--r--apt-private/private-main.h5
-rw-r--r--cmdline/apt-cache.cc2
-rw-r--r--cmdline/apt-cdrom.cc2
-rw-r--r--cmdline/apt-config.cc2
-rw-r--r--cmdline/apt-extracttemplates.cc2
-rw-r--r--cmdline/apt-get.cc2
-rw-r--r--cmdline/apt-helper.cc2
-rw-r--r--cmdline/apt-internal-solver.cc2
-rw-r--r--cmdline/apt-mark.cc2
-rw-r--r--cmdline/apt-sortpkgs.cc2
-rw-r--r--cmdline/apt.cc2
-rw-r--r--ftparchive/apt-ftparchive.cc2
14 files changed, 26 insertions, 25 deletions
diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc
index 829085916..7e50b1401 100644
--- a/apt-private/private-cmndline.cc
+++ b/apt-private/private-cmndline.cc
@@ -10,6 +10,7 @@
#include <apt-pkg/strutl.h>
#include <apt-private/private-cmndline.h>
+#include <apt-private/private-main.h>
#include <stdarg.h>
#include <string.h>
@@ -451,6 +452,7 @@ std::vector<CommandLine::Dispatch> ParseCommandLine(CommandLine &CmdL, APT_CMD c
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();
diff --git a/apt-private/private-main.cc b/apt-private/private-main.cc
index 0a9f4713f..0075f813f 100644
--- a/apt-private/private-main.cc
+++ b/apt-private/private-main.cc
@@ -16,11 +16,29 @@
#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() /*{{{*/
{
diff --git a/apt-private/private-main.h b/apt-private/private-main.h
index db6d3e0b7..0d60797ed 100644
--- a/apt-private/private-main.h
+++ b/apt-private/private-main.h
@@ -1,11 +1,14 @@
#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[]);
diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc
index 481833084..6153f0e49 100644
--- a/cmdline/apt-cache.cc
+++ b/cmdline/apt-cache.cc
@@ -1142,8 +1142,6 @@ static std::vector<aptDispatchWithHelp> 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_CACHE, &_config, &_system, argc, argv, &ShowHelp, &GetCommands);
diff --git a/cmdline/apt-cdrom.cc b/cmdline/apt-cdrom.cc
index ba01a4c74..bac808a41 100644
--- a/cmdline/apt-cdrom.cc
+++ b/cmdline/apt-cdrom.cc
@@ -225,8 +225,6 @@ static std::vector<aptDispatchWithHelp> 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);
diff --git a/cmdline/apt-config.cc b/cmdline/apt-config.cc
index 69485de90..6953a8172 100644
--- a/cmdline/apt-config.cc
+++ b/cmdline/apt-config.cc
@@ -97,8 +97,6 @@ static std::vector<aptDispatchWithHelp> 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);
diff --git a/cmdline/apt-extracttemplates.cc b/cmdline/apt-extracttemplates.cc
index 8f77425e4..a4468b989 100644
--- a/cmdline/apt-extracttemplates.cc
+++ b/cmdline/apt-extracttemplates.cc
@@ -339,8 +339,6 @@ static std::vector<aptDispatchWithHelp> 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);
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 4ac15274c..73db71f00 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -432,8 +432,6 @@ static std::vector<aptDispatchWithHelp> 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);
diff --git a/cmdline/apt-helper.cc b/cmdline/apt-helper.cc
index fd4d269c2..f3b8c326e 100644
--- a/cmdline/apt-helper.cc
+++ b/cmdline/apt-helper.cc
@@ -199,8 +199,6 @@ static std::vector<aptDispatchWithHelp> 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);
diff --git a/cmdline/apt-internal-solver.cc b/cmdline/apt-internal-solver.cc
index 12f4d6f93..80f92152a 100644
--- a/cmdline/apt-internal-solver.cc
+++ b/cmdline/apt-internal-solver.cc
@@ -65,8 +65,6 @@ static std::vector<aptDispatchWithHelp> GetCommands() /*{{{*/
/*}}}*/
int main(int argc,const char *argv[]) /*{{{*/
{
- InitLocale();
-
// we really don't need anything
DropPrivileges();
diff --git a/cmdline/apt-mark.cc b/cmdline/apt-mark.cc
index 4e86edc77..0cba31e70 100644
--- a/cmdline/apt-mark.cc
+++ b/cmdline/apt-mark.cc
@@ -316,8 +316,6 @@ static std::vector<aptDispatchWithHelp> GetCommands() /*{{{*/
/*}}}*/
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);
diff --git a/cmdline/apt-sortpkgs.cc b/cmdline/apt-sortpkgs.cc
index 9495ee354..b80bbedd6 100644
--- a/cmdline/apt-sortpkgs.cc
+++ b/cmdline/apt-sortpkgs.cc
@@ -152,8 +152,6 @@ static std::vector<aptDispatchWithHelp> GetCommands() /*{{{*/
/*}}}*/
int main(int argc,const char *argv[]) /*{{{*/
{
- InitLocale();
-
CommandLine CmdL;
ParseCommandLine(CmdL, APT_CMD::APT_SORTPKG, &_config, &_system, argc, argv, &ShowHelp, &GetCommands);
diff --git a/cmdline/apt.cc b/cmdline/apt.cc
index 3c3d3ca1c..4b266bcbe 100644
--- a/cmdline/apt.cc
+++ b/cmdline/apt.cc
@@ -97,8 +97,6 @@ static std::vector<aptDispatchWithHelp> 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);
diff --git a/ftparchive/apt-ftparchive.cc b/ftparchive/apt-ftparchive.cc
index d985646f7..ab6f48d61 100644
--- a/ftparchive/apt-ftparchive.cc
+++ b/ftparchive/apt-ftparchive.cc
@@ -1044,8 +1044,6 @@ static std::vector<aptDispatchWithHelp> 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);