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.
21 files changed:
#include <apt-private/private-main.h>
#include <iostream>
#include <apt-private/private-main.h>
#include <iostream>
#include <string.h>
#include <unistd.h>
#include <signal.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
void InitLocale() /*{{{*/
{
void InitLocale() /*{{{*/
{
+ std::locale::global(std::locale(""));
textdomain(PACKAGE);
}
/*}}}*/
textdomain(PACKAGE);
}
/*}}}*/
#include <apt-pkg/acquire-method.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/acquire-method.h>
#include <apt-pkg/configuration.h>
#include <string>
class aptMethod : public pkgAcqMethod
#include <string>
class aptMethod : public pkgAcqMethod
aptMethod(char const * const Binary, char const * const Ver, unsigned long const Flags) :
pkgAcqMethod(Ver, Flags), Binary(Binary)
aptMethod(char const * const Binary, char const * const Ver, unsigned long const Flags) :
pkgAcqMethod(Ver, Flags), Binary(Binary)
+ {
+ std::locale::global(std::locale(""));
+ }
// Include Files /*{{{*/
#include <config.h>
// 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>
#include <apt-pkg/cdrom.h>
#include <apt-pkg/cdromutl.h>
#include <apt-pkg/error.h>
#include <apt-pkg/strutl.h>
#include <apt-pkg/hashes.h>
#include <apt-pkg/strutl.h>
#include <apt-pkg/hashes.h>
+#include "aptmethod.h"
+
#include <string>
#include <vector>
#include <sys/stat.h>
#include <string>
#include <vector>
#include <sys/stat.h>
-class CDROMMethod : public pkgAcqMethod
+class CDROMMethod : public aptMethod
{
bool DatabaseLoaded;
bool Debug;
{
bool DatabaseLoaded;
bool Debug;
// CDROMMethod::CDROMethod - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
// CDROMMethod::CDROMethod - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
-CDROMMethod::CDROMMethod() : pkgAcqMethod("1.0",SingleInstance | LocalOnly |
+CDROMMethod::CDROMMethod() : aptMethod("cdrom", "1.0",SingleInstance | LocalOnly |
SendConfig | NeedsCleanup |
SendConfig | NeedsCleanup |
DatabaseLoaded(false),
Debug(false),
MountedByApt(false)
DatabaseLoaded(false),
Debug(false),
MountedByApt(false)
- setlocale(LC_ALL, "");
-
- CDROMMethod Mth;
- return Mth.Run();
+ _config->CndSet("Binary::cdrom::Debug::NoDropPrivs", true);
+ return CDROMMethod().Run();
#include <apt-pkg/fileutl.h>
#include <apt-pkg/strutl.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/strutl.h>
-#include <apt-pkg/acquire-method.h>
#include <apt-pkg/error.h>
#include <apt-pkg/hashes.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
#include <apt-pkg/hashes.h>
#include <apt-pkg/configuration.h>
- setlocale(LC_ALL, "");
-
- CopyMethod Mth;
-
- return Mth.Run();
+ return CopyMethod().Run();
// Include Files /*{{{*/
#include <config.h>
// Include Files /*{{{*/
#include <config.h>
-#include <apt-pkg/acquire-method.h>
#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/error.h>
#include <apt-pkg/hashes.h>
#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/error.h>
#include <apt-pkg/hashes.h>
- setlocale(LC_ALL, "");
-
- FileMethod Mth;
- return Mth.Run();
+ return FileMethod().Run();
#include <config.h>
#include <apt-pkg/fileutl.h>
#include <config.h>
#include <apt-pkg/fileutl.h>
-#include <apt-pkg/acquire-method.h>
#include <apt-pkg/error.h>
#include <apt-pkg/hashes.h>
#include <apt-pkg/netrc.h>
#include <apt-pkg/error.h>
#include <apt-pkg/hashes.h>
#include <apt-pkg/netrc.h>
/*}}}*/
int main(int, const char *argv[])
/*}}}*/
int main(int, const char *argv[])
-{
- setlocale(LC_ALL, "");
-
/* See if we should be come the http client - we do this for http
proxy urls */
if (getenv("ftp_proxy") != 0)
/* See if we should be come the http client - we do this for http
proxy urls */
if (getenv("ftp_proxy") != 0)
-
- FtpMethod Mth;
-
- return Mth.Run();
+ return FtpMethod().Run();
#ifndef APT_FTP_H
#define APT_FTP_H
#ifndef APT_FTP_H
#define APT_FTP_H
-#include <apt-pkg/acquire-method.h>
#include <apt-pkg/strutl.h>
#include "aptmethod.h"
#include <apt-pkg/strutl.h>
#include "aptmethod.h"
-#include <apt-pkg/acquire-method.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
#include <apt-pkg/gpgv.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
#include <apt-pkg/gpgv.h>
- setlocale(LC_ALL, "");
-
- GPGVMethod Mth;
-
- return Mth.Run();
+ return GPGVMethod().Run();
#include <config.h>
#include <apt-pkg/fileutl.h>
#include <config.h>
#include <apt-pkg/fileutl.h>
-#include <apt-pkg/acquire-method.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
#include <apt-pkg/hashes.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
#include <apt-pkg/hashes.h>
#define APT_HTTP_H
#include <apt-pkg/strutl.h>
#define APT_HTTP_H
#include <apt-pkg/strutl.h>
-#include <apt-pkg/acquire-method.h>
#include <string>
#include <sys/time.h>
#include <string>
#include <sys/time.h>
- setlocale(LC_ALL, "");
-
// ignore SIGPIPE, this can happen on write() if the socket
// closes the connection (this is dealt with via ServerDie())
signal(SIGPIPE, SIG_IGN);
// ignore SIGPIPE, this can happen on write() if the socket
// closes the connection (this is dealt with via ServerDie())
signal(SIGPIPE, SIG_IGN);
- HttpMethod Mth;
-
- return Mth.Loop();
+ return HttpMethod().Loop();
#include <config.h>
#include <apt-pkg/fileutl.h>
#include <config.h>
#include <apt-pkg/fileutl.h>
-#include <apt-pkg/acquire-method.h>
#include <apt-pkg/error.h>
#include <apt-pkg/hashes.h>
#include <apt-pkg/netrc.h>
#include <apt-pkg/error.h>
#include <apt-pkg/hashes.h>
#include <apt-pkg/netrc.h>
- setlocale(LC_ALL, "");
-
- HttpsMethod Mth;
- curl_global_init(CURL_GLOBAL_SSL) ;
-
- return Mth.Run();
+ return HttpsMethod().Run();
#ifndef APT_HTTPS_H
#define APT_HTTPS_H
#ifndef APT_HTTPS_H
#define APT_HTTPS_H
-#include <apt-pkg/acquire-method.h>
-
#include <curl/curl.h>
#include <iostream>
#include <stddef.h>
#include <curl/curl.h>
#include <iostream>
#include <stddef.h>
HttpsMethod() : ServerMethod("https","1.2",Pipeline | SendConfig)
{
HttpsMethod() : ServerMethod("https","1.2",Pipeline | SendConfig)
{
+ curl_global_init(CURL_GLOBAL_SSL);
curl = curl_easy_init();
};
curl = curl_easy_init();
};
#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/fileutl.h>
-#include <apt-pkg/acquire-method.h>
#include <apt-pkg/acquire-item.h>
#include <apt-pkg/acquire.h>
#include <apt-pkg/error.h>
#include <apt-pkg/acquire-item.h>
#include <apt-pkg/acquire.h>
#include <apt-pkg/error.h>
- setlocale(LC_ALL, "");
-
- MirrorMethod Mth;
-
- return Mth.Loop();
+ return MirrorMethod().Loop();
// -*- mode: cpp; mode: fold -*-
// -*- mode: cpp; mode: fold -*-
-// Description /*{{{*/// $Id: http.h,v 1.12 2002/04/18 05:09:38 jgg Exp $
-// $Id: http.h,v 1.12 2002/04/18 05:09:38 jgg Exp $
/* ######################################################################
MIRROR Acquire Method - This is the MIRROR acquire method for APT.
/* ######################################################################
MIRROR Acquire Method - This is the MIRROR acquire method for APT.
#ifndef APT_MIRROR_H
#define APT_MIRROR_H
#ifndef APT_MIRROR_H
#define APT_MIRROR_H
-#include <apt-pkg/acquire-method.h>
-
#include <iostream>
#include <string>
#include <vector>
#include <iostream>
#include <string>
#include <vector>
#include <apt-pkg/init.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/error.h>
#include <apt-pkg/init.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/error.h>
-#include <apt-pkg/acquire-method.h>
#include <apt-pkg/strutl.h>
#include <apt-pkg/hashes.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/strutl.h>
#include <apt-pkg/hashes.h>
#include <apt-pkg/configuration.h>
Patch patch;
if (argc <= 1) {
Patch patch;
if (argc <= 1) {
- RredMethod Mth;
- return Mth.Run();
+ return RredMethod().Run();
}
// Usage: rred -t input output diff ...
}
// Usage: rred -t input output diff ...
#include <apt-pkg/fileutl.h>
#include <apt-pkg/hashes.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/hashes.h>
#include <apt-pkg/configuration.h>
-#include <apt-pkg/acquire-method.h>
#include <apt-pkg/strutl.h>
#include <stdlib.h>
#include <apt-pkg/strutl.h>
#include <stdlib.h>
int main(int, const char *argv[])
{
int main(int, const char *argv[])
{
- setlocale(LC_ALL, "");
-
- RSHMethod Mth(flNotDir(argv[0]));
- return Mth.Run();
+ return RSHMethod(flNotDir(argv[0])).Run();
-#include <apt-pkg/acquire-method.h>
#include "aptmethod.h"
class RSHMethod : public aptMethod
#include "aptmethod.h"
class RSHMethod : public aptMethod
// Include Files /*{{{*/
#include <config.h>
// Include Files /*{{{*/
#include <config.h>
-#include <apt-pkg/acquire-method.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/configuration.h>
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#define APT_SERVER_H
#include <apt-pkg/strutl.h>
#define APT_SERVER_H
#include <apt-pkg/strutl.h>
-#include <apt-pkg/acquire-method.h>
#include "aptmethod.h"
#include <time.h>
#include "aptmethod.h"
#include <time.h>
#include <config.h>
#include <apt-pkg/configuration.h>
#include <config.h>
#include <apt-pkg/configuration.h>
-#include <apt-pkg/acquire-method.h>
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/hashes.h>
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/hashes.h>
int main(int, char *argv[])
{
int main(int, char *argv[])
{
- setlocale(LC_ALL, "");
-
- StoreMethod Mth(flNotDir(argv[0]));
- return Mth.Run();
+ return StoreMethod(flNotDir(argv[0])).Run();