From 8b79c94af7f7cf2e5e5342294bc6e5a908cacabf Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Sat, 28 May 2016 13:22:38 +0200 Subject: 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. --- methods/cdrom.cc | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'methods/cdrom.cc') 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 -#include #include #include #include @@ -19,6 +18,8 @@ #include #include +#include "aptmethod.h" + #include #include #include @@ -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(); } -- cgit v1.2.3