diff options
author | David Kalnischkies <david@kalnischkies.de> | 2016-05-28 13:22:38 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2016-05-28 18:12:02 +0200 |
commit | 8b79c94af7f7cf2e5e5342294bc6e5a908cacabf (patch) | |
tree | b5e7c254f6a4aa96203aee262cf5fb13ded87fbb /methods/cdrom.cc | |
parent | eceb219c2a64f3f81421c3c6587380b6ae81a530 (diff) |
use std::locale::global instead of setlocale
We use a wild mixture of C and C++ ways of generating output, so having
a consistent world-view in both styles sounds like a good idea and
should help in preventing regressions.
Diffstat (limited to 'methods/cdrom.cc')
-rw-r--r-- | methods/cdrom.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/methods/cdrom.cc b/methods/cdrom.cc index d9ddecb6a..161822ac6 100644 --- a/methods/cdrom.cc +++ b/methods/cdrom.cc @@ -10,7 +10,6 @@ // Include Files /*{{{*/ #include <config.h> -#include <apt-pkg/acquire-method.h> #include <apt-pkg/cdrom.h> #include <apt-pkg/cdromutl.h> #include <apt-pkg/error.h> @@ -19,6 +18,8 @@ #include <apt-pkg/strutl.h> #include <apt-pkg/hashes.h> +#include "aptmethod.h" + #include <string> #include <vector> #include <sys/stat.h> @@ -29,7 +30,7 @@ using namespace std; -class CDROMMethod : public pkgAcqMethod +class CDROMMethod : public aptMethod { bool DatabaseLoaded; bool Debug; @@ -54,9 +55,9 @@ class CDROMMethod : public pkgAcqMethod // CDROMMethod::CDROMethod - Constructor /*{{{*/ // --------------------------------------------------------------------- /* */ -CDROMMethod::CDROMMethod() : pkgAcqMethod("1.0",SingleInstance | LocalOnly | +CDROMMethod::CDROMMethod() : aptMethod("cdrom", "1.0",SingleInstance | LocalOnly | SendConfig | NeedsCleanup | - Removable), + Removable), DatabaseLoaded(false), Debug(false), MountedByApt(false) @@ -279,8 +280,6 @@ bool CDROMMethod::Fetch(FetchItem *Itm) int main() { - setlocale(LC_ALL, ""); - - CDROMMethod Mth; - return Mth.Run(); + _config->CndSet("Binary::cdrom::Debug::NoDropPrivs", true); + return CDROMMethod().Run(); } |