summaryrefslogtreecommitdiff
path: root/methods/gpgv.cc
diff options
context:
space:
mode:
authorChristian Perrier <bubulle@debian.org>2005-07-28 18:52:39 +0000
committerChristian Perrier <bubulle@debian.org>2005-07-28 18:52:39 +0000
commitbe9b936074e8dc8fb82f36dee9029594a5f82532 (patch)
treed465d3e7b00226453c2f659e1e5d7867b9b5299e /methods/gpgv.cc
parentbab3080e7efc218a53118609ddf6bde14899b497 (diff)
Merge with Matt
Patches applied: * apt@packages.debian.org/apt--main--0--patch-97 Update priority of apt-utils to important, to match the override file * apt@packages.debian.org/apt--main--0--patch-98 Install only one keyring on each branch (Closes: #316119) * apt@packages.debian.org/apt--main--0--patch-99 Finalize 0.6.39 * apt@packages.debian.org/apt--main--0--patch-100 Use debian.org address in mainline * apt@packages.debian.org/apt--main--0--patch-101 Update pot file * apt@packages.debian.org/apt--main--0--patch-102 Open 0.6.40 * apt@packages.debian.org/apt--main--0--patch-103 Patch from Jordi Mallach to mark some additional strings for translation * apt@packages.debian.org/apt--main--0--patch-104 Updated Catalan translation from Jordi Mallach
Diffstat (limited to 'methods/gpgv.cc')
-rw-r--r--methods/gpgv.cc30
1 files changed, 17 insertions, 13 deletions
diff --git a/methods/gpgv.cc b/methods/gpgv.cc
index 24e945b2c..5cb154f66 100644
--- a/methods/gpgv.cc
+++ b/methods/gpgv.cc
@@ -1,6 +1,7 @@
#include <apt-pkg/error.h>
#include <apt-pkg/acquire-method.h>
#include <apt-pkg/strutl.h>
+#include <apti18n.h>
#include <sys/stat.h>
#include <unistd.h>
@@ -88,7 +89,7 @@ const char *GPGVMethod::VerifyGetSigners(const char *file, const char *outfile,
continue;
Args[i++] = Opts->Value.c_str();
if(i >= 395) {
- std::cerr << "E: Argument list from Acquire::gpgv::Options too long. Exiting." << std::endl;
+ std::cerr << _("E: Argument list from Acquire::gpgv::Options too long. Exiting.") << std::endl;
exit(111);
}
}
@@ -181,27 +182,28 @@ const char *GPGVMethod::VerifyGetSigners(const char *file, const char *outfile,
waitpid(pid, &status, 0);
if (_config->FindB("Debug::Acquire::gpgv", false))
{
- std::cerr <<"gpgv exited\n";
+ std::cerr << "gpgv exited\n";
}
if (WEXITSTATUS(status) == 0)
{
if (GoodSigners.empty())
- return "Internal error: Good signature, but could not determine key fingerprint?!";
+ return _("Internal error: Good signature, but could not determine key fingerprint?!");
return NULL;
}
else if (WEXITSTATUS(status) == 1)
{
- return "At least one invalid signature was encountered.";
+ return _("At least one invalid signature was encountered.");
}
else if (WEXITSTATUS(status) == 111)
{
- return (string("Could not execute ") + gpgvpath +
- string(" to verify signature (is gnupg installed?)")).c_str();
+ // FIXME String concatenation considered harmful.
+ return (string(_("Could not execute ")) + gpgvpath +
+ string(_(" to verify signature (is gnupg installed?)"))).c_str();
}
else
{
- return "Unknown error executing gpgv";
+ return _("Unknown error executing gpgv");
}
}
@@ -232,14 +234,14 @@ bool GPGVMethod::Fetch(FetchItem *Itm)
{
if (!BadSigners.empty())
{
- errmsg += "The following signatures were invalid:\n";
+ errmsg += _("The following signatures were invalid:\n");
for (vector<string>::iterator I = BadSigners.begin();
I != BadSigners.end(); I++)
errmsg += (*I + "\n");
}
if (!NoPubKeySigners.empty())
{
- errmsg += "The following signatures couldn't be verified because the public key is not available:\n";
+ errmsg += _("The following signatures couldn't be verified because the public key is not available:\n");
for (vector<string>::iterator I = NoPubKeySigners.begin();
I != NoPubKeySigners.end(); I++)
errmsg += (*I + "\n");
@@ -251,16 +253,16 @@ bool GPGVMethod::Fetch(FetchItem *Itm)
// Transfer the modification times
struct stat Buf;
if (stat(Path.c_str(),&Buf) != 0)
- return _error->Errno("stat","Failed to stat %s", Path.c_str());
+ return _error->Errno("stat",_("Failed to stat %s"), Path.c_str());
struct utimbuf TimeBuf;
TimeBuf.actime = Buf.st_atime;
TimeBuf.modtime = Buf.st_mtime;
if (utime(Itm->DestFile.c_str(),&TimeBuf) != 0)
- return _error->Errno("utime","Failed to set modification time");
+ return _error->Errno("utime",_("Failed to set modification time"));
if (stat(Itm->DestFile.c_str(),&Buf) != 0)
- return _error->Errno("stat","Failed to stat");
+ return _error->Errno("stat",_("Failed to stat"));
// Return a Done response
Res.LastModified = Buf.st_mtime;
@@ -275,7 +277,7 @@ bool GPGVMethod::Fetch(FetchItem *Itm)
if (_config->FindB("Debug::Acquire::gpgv", false))
{
- std::cerr <<"gpgv suceeded\n";
+ std::cerr << "gpgv succeeded\n";
}
return true;
@@ -284,6 +286,8 @@ bool GPGVMethod::Fetch(FetchItem *Itm)
int main()
{
+ setlocale(LC_ALL, "");
+
GPGVMethod Mth;
return Mth.Run();