From 106e674096a2c6da1e3fa44b88ec228a61ef7dfe Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 19 May 2005 08:26:28 +0000 Subject: * fix the cache-control header generation * methods/http.cc: a cache cache header can now be generated even if no proxy is specified to support "no-cache" for transparent proxies --- methods/http.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'methods') diff --git a/methods/http.cc b/methods/http.cc index 81a64d7a3..ba86aa6b6 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -635,9 +635,9 @@ void HttpMethod::SendReq(FetchItem *Itm,CircleBuf &Out) and a no-store directive for archives. */ sprintf(Buf,"GET %s HTTP/1.1\r\nHost: %s\r\n", Itm->Uri.c_str(),ProperHost.c_str()); - if (_config->FindB("Acquire::http::No-Cache",false) == true) - strcat(Buf,"Cache-Control: no-cache\r\nPragma: no-cache\r\n"); - else + // only generate a cache control header if we actually want to + // use a cache + if (_config->FindB("Acquire::http::No-Cache",false) == false) { if (Itm->IndexFile == true) sprintf(Buf+strlen(Buf),"Cache-Control: max-age=%u\r\n", @@ -649,6 +649,10 @@ void HttpMethod::SendReq(FetchItem *Itm,CircleBuf &Out) } } } + // generate a no-cache header if needed + if (_config->FindB("Acquire::http::No-Cache",false) == true) + strcat(Buf,"Cache-Control: no-cache\r\nPragma: no-cache\r\n"); + string Req = Buf; -- cgit v1.2.3 From 42ab8223d52672cf28c6e2e574bb364c438bd49a Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 23 May 2005 21:06:09 +0000 Subject: * merged with my apt--fixes--0 branch Patches applied: * apt@packages.debian.org/apt--misc-abi-changes--0--patch-4 Merge from mainline * apt@packages.debian.org/apt--misc-abi-changes--0--patch-5 Merge from mainline * apt@packages.debian.org/apt--misc-abi-changes--0--patch-6 Collapse both pkgAcquire::Run() methods into one, with a default value * michael.vogt@ubuntu.com--2005/apt--fixes--0--base-0 tag of apt@packages.debian.org/apt--main--0--patch-79 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-1 * merged obvious fixes into the tree to make it easy for matt to merge * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-2 * more merges from otavio that looks good/uncritical * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-3 * merged Matts misc-abi-changes tree * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-4 * finalized the changelog for a ubuntu build * otavio@debian.org--2005/apt--fixes--0--base-0 tag of apt@packages.debian.org/apt--main--0--patch-71 * otavio@debian.org--2005/apt--fixes--0--patch-1 Fix comments about the need of xmlto * otavio@debian.org--2005/apt--fixes--0--patch-2 Fix a compile warning * otavio@debian.org--2005/apt--fixes--0--patch-3 Sync with apt--main--0--patch-76 * otavio@debian.org--2005/apt--fixes--0--patch-4 Sync with apt--main--0--patch-78 * otavio@debian.org--2005/apt--fixes--0--patch-5 Add fixes that was wrongly included on DDTP changes. * otavio@debian.org--2005/apt--fixes--0--patch-8 Add information about the other fixes include on this branch now. * otavio@debian.org--2005/apt--fixes--0--patch-9 Merge last changes from apt--main--0. * otavio@debian.org--2005/apt--fixes--0--patch-10 Fix warnings about min/max change in gcc-4.0 * otavio@debian.org--2005/apt--fixes--0--patch-11 Fix remaning warnings while compiling gcc-4.0 * otavio@debian.org--2005/apt--fixes--0--patch-12 Add changelog entry about the fixes for warnings while compiling using GCC 4.0 compiler. --- methods/ftp.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'methods') diff --git a/methods/ftp.cc b/methods/ftp.cc index 8bf8a2ee6..f595e0ca4 100644 --- a/methods/ftp.cc +++ b/methods/ftp.cc @@ -1102,7 +1102,7 @@ int main(int argc,const char *argv[]) // Run the http method string Path = flNotFile(argv[0]) + "http"; - execl(Path.c_str(),Path.c_str(),0); + execl(Path.c_str(),Path.c_str(),(char *)NULL); cerr << _("Unable to invoke ") << Path << endl; exit(100); } -- cgit v1.2.3 From 8bdbcf67d5686ab823e466e6df7900aec8c21c1a Mon Sep 17 00:00:00 2001 From: Matt Zimmerman Date: Tue, 24 May 2005 21:33:29 +0000 Subject: Merge michael.vogt@ubuntu.com--2005/apt--fixes--0 Patches applied: * apt@packages.debian.org/apt--misc-abi-changes--0--patch-4 Merge from mainline * apt@packages.debian.org/apt--misc-abi-changes--0--patch-5 Merge from mainline * apt@packages.debian.org/apt--misc-abi-changes--0--patch-6 Collapse both pkgAcquire::Run() methods into one, with a default value * michael.vogt@ubuntu.com--2005/apt--fixes--0--base-0 tag of apt@packages.debian.org/apt--main--0--patch-79 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-1 * merged obvious fixes into the tree to make it easy for matt to merge * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-2 * more merges from otavio that looks good/uncritical * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-3 * merged Matts misc-abi-changes tree * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-4 * finalized the changelog for a ubuntu build * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-26 * fix the cache-control header generation * otavio@debian.org--2005/apt--fixes--0--base-0 tag of apt@packages.debian.org/apt--main--0--patch-71 * otavio@debian.org--2005/apt--fixes--0--patch-1 Fix comments about the need of xmlto * otavio@debian.org--2005/apt--fixes--0--patch-2 Fix a compile warning * otavio@debian.org--2005/apt--fixes--0--patch-3 Sync with apt--main--0--patch-76 * otavio@debian.org--2005/apt--fixes--0--patch-4 Sync with apt--main--0--patch-78 * otavio@debian.org--2005/apt--fixes--0--patch-5 Add fixes that was wrongly included on DDTP changes. * otavio@debian.org--2005/apt--fixes--0--patch-8 Add information about the other fixes include on this branch now. * otavio@debian.org--2005/apt--fixes--0--patch-9 Merge last changes from apt--main--0. * otavio@debian.org--2005/apt--fixes--0--patch-10 Fix warnings about min/max change in gcc-4.0 * otavio@debian.org--2005/apt--fixes--0--patch-11 Fix remaning warnings while compiling gcc-4.0 * otavio@debian.org--2005/apt--fixes--0--patch-12 Add changelog entry about the fixes for warnings while compiling using GCC 4.0 compiler. --- methods/ftp.cc | 2 +- methods/http.cc | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'methods') diff --git a/methods/ftp.cc b/methods/ftp.cc index 8bf8a2ee6..f595e0ca4 100644 --- a/methods/ftp.cc +++ b/methods/ftp.cc @@ -1102,7 +1102,7 @@ int main(int argc,const char *argv[]) // Run the http method string Path = flNotFile(argv[0]) + "http"; - execl(Path.c_str(),Path.c_str(),0); + execl(Path.c_str(),Path.c_str(),(char *)NULL); cerr << _("Unable to invoke ") << Path << endl; exit(100); } diff --git a/methods/http.cc b/methods/http.cc index 81a64d7a3..ba86aa6b6 100644 --- a/methods/http.cc +++ b/methods/http.cc @@ -635,9 +635,9 @@ void HttpMethod::SendReq(FetchItem *Itm,CircleBuf &Out) and a no-store directive for archives. */ sprintf(Buf,"GET %s HTTP/1.1\r\nHost: %s\r\n", Itm->Uri.c_str(),ProperHost.c_str()); - if (_config->FindB("Acquire::http::No-Cache",false) == true) - strcat(Buf,"Cache-Control: no-cache\r\nPragma: no-cache\r\n"); - else + // only generate a cache control header if we actually want to + // use a cache + if (_config->FindB("Acquire::http::No-Cache",false) == false) { if (Itm->IndexFile == true) sprintf(Buf+strlen(Buf),"Cache-Control: max-age=%u\r\n", @@ -649,6 +649,10 @@ void HttpMethod::SendReq(FetchItem *Itm,CircleBuf &Out) } } } + // generate a no-cache header if needed + if (_config->FindB("Acquire::http::No-Cache",false) == true) + strcat(Buf,"Cache-Control: no-cache\r\nPragma: no-cache\r\n"); + string Req = Buf; -- cgit v1.2.3 From 24057ad643f91253899a9cd66eaef0b2182f1230 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 7 Jun 2005 13:41:11 +0000 Subject: * report timeouts (from Connect) and fail if they happen in pkgAcqMetaSig --- methods/connect.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'methods') diff --git a/methods/connect.cc b/methods/connect.cc index 981ac1371..b85df6887 100644 --- a/methods/connect.cc +++ b/methods/connect.cc @@ -88,9 +88,11 @@ static bool DoConnect(struct addrinfo *Addr,string Host, /* This implements a timeout for connect by opening the connection nonblocking */ - if (WaitFd(Fd,true,TimeOut) == false) + if (WaitFd(Fd,true,TimeOut) == false) { + Owner->SetFailExtraMsg("\nFailReason: Timeout"); return _error->Error(_("Could not connect to %s:%s (%s), " "connection timed out"),Host.c_str(),Service,Name); + } // Check the socket for an error condition unsigned int Err; -- cgit v1.2.3 From 339690e4250de4d3eb8e98a91223420c01a5af96 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 1 Aug 2005 15:52:18 +0000 Subject: * merged with matts tree 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 * apt@packages.debian.org/apt--main--0--patch-105 Merge from bubulle@debian.org--2005/apt--main--0 * bubulle@debian.org--2005/apt--main--0--patch-90 Merge with Matt * bubulle@debian.org--2005/apt--main--0--patch-91 Updated Slovak translation * bubulle@debian.org--2005/apt--main--0--patch-92 Add apt-key French man page * bubulle@debian.org--2005/apt--main--0--patch-93 Update Greek translations * bubulle@debian.org--2005/apt--main--0--patch-94 Merge with Matt * bubulle@debian.org--2005/apt--main--0--patch-95 Sync PO files with the POT file/French translation update --- methods/gpgv.cc | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'methods') 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 #include #include +#include #include #include @@ -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::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::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(); -- cgit v1.2.3 From 7aee90b638490036b8f4244dcb3d14ba0bc6dd8a Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 8 Aug 2005 21:24:06 +0000 Subject: * merged with main Patches applied: * andrelop@debian.org/apt--translation--0--base-0 tag of apt@packages.debian.org/apt--main--0--patch-79 * andrelop@debian.org/apt--translation--0--patch-1 Sync with Matt version. * andrelop@debian.org/apt--translation--0--patch-2 Update pt_BR translation * andrelop@debian.org/apt--translation--0--patch-3 Sync with bubulle's branch. * apt@packages.debian.org/apt--main--0--patch-88 Change debian/bugscript to use #!/bin/bash (Closes: #313402) * apt@packages.debian.org/apt--main--0--patch-89 Branch for Debian * apt@packages.debian.org/apt--main--0--patch-90 Update version in configure * apt@packages.debian.org/apt--main--0--patch-91 Fix French man page build * apt@packages.debian.org/apt--main--0--patch-92 Add the current Debian archive signing key * apt@packages.debian.org/apt--main--0--patch-93 Merge with mvo * apt@packages.debian.org/apt--main--0--patch-94 Update changelog * apt@packages.debian.org/apt--main--0--patch-95 Merge Christian's branch * apt@packages.debian.org/apt--main--0--patch-96 Update changelog * 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 * apt@packages.debian.org/apt--main--0--patch-105 Merge from bubulle@debian.org--2005/apt--main--0 * apt@packages.debian.org/apt--main--0--patch-106 Restore lost changelog entries * apt@packages.debian.org/apt--main--0--patch-107 Merge michael.vogt@ubuntu.com--2005/apt--progress-reporting--0 * apt@packages.debian.org/apt--main--0--patch-108 Merge michael.vogt@ubuntu.com--2005/apt--progress-reporting--0 * bubulle@debian.org--2005/apt--main--0--patch-82 Fix permissions * bubulle@debian.org--2005/apt--main--0--patch-83 French translation spellchecked * bubulle@debian.org--2005/apt--main--0--patch-84 Spell corrections in German translations * bubulle@debian.org--2005/apt--main--0--patch-85 Correct some file permissions * bubulle@debian.org--2005/apt--main--0--patch-86 Correct Hebrew translation * bubulle@debian.org--2005/apt--main--0--patch-87 Sync Portuguese translation with the POT file * bubulle@debian.org--2005/apt--main--0--patch-88 Updated Danish translation (not yet complete) * bubulle@debian.org--2005/apt--main--0--patch-89 Sync with Andre Luis Lopes and Otavio branches * bubulle@debian.org--2005/apt--main--0--patch-90 Merge with Matt * bubulle@debian.org--2005/apt--main--0--patch-91 Updated Slovak translation * bubulle@debian.org--2005/apt--main--0--patch-92 Add apt-key French man page * bubulle@debian.org--2005/apt--main--0--patch-93 Update Greek translations * bubulle@debian.org--2005/apt--main--0--patch-94 Merge with Matt * bubulle@debian.org--2005/apt--main--0--patch-95 Sync PO files with the POT file/French translation update * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-22 * added myself to uploaders, changelog is signed with mvo@debian.org and in sync with the debian/experimental upload * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-23 * apt-cache show shows all virtual packages instead of nothing (thanks to otavio) * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-24 * changelog updated * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-25 * make pinning on component work again (we just use the section, as apt-0.6 don't use per-section Release files anymore) * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-27 * updated the changelog * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-28 * merged with my apt--fixes--0 branch * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-29 * added a missing OpProgress::Done() in depCache::Init(), removed the show-virtual-packages patch in apt-cache because matt does not like him :/ * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-30 * fix a stupid bug in the depcache::Init() code * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-31 * merged/removed conflicts with apt--main--0 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-32 * merged apt--main and make sure that the po files come from apt--main (because they are more recent) * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--base-0 tag of apt@packages.debian.org/apt--main--0--patch-85 * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-1 * inital proof of concept code, understands what dpkg tells it already * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-2 * progress reporting works now * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-3 * added "APT::Status-Fd" variable * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-4 * do i18n now too * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-5 * define N_(x) if it is not defined already * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-6 * PackageManager::DoInstall(int status_fd) added (does not break the ABI) * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-7 * merged with apt--fixes--0 to make it build again * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-8 * added support for "error" and "conffile-prompt" messages from dpkg * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-9 merge with main * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-10 * use sizeof() for all snprintf() uses; fix a potential line break problem in the status reading code; changed the N_() to _() calls * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-11 * added APT::KeepFDs configuration list for file descriptors that apt should leave open (needed for various frontends like debconf, synaptic) * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-12 * fixed a API breakage * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-13 * doc added, should be releasable now * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-14 * merged with apt--main--0 * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-15 * more source comments, added Debug::DpkgPM debug code to inspect the dpkg<->apt communication, broke the abi (ok with matt) * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-16 * the progress reporting has it's own "Debug::pkgDPkgProgressReporting" debug variable now * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-17 * merged PackageOps and TranslatedPackageOps into a single Map with the new DpkgState struct * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-18 * clear the APT::Keep-Fds configuration when it's no longer needed * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-19 * rewrote the reading from dpkg so that it never blocks * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-20 * merged the two status arrays into one * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-21 * added support for download progress reporting too (for Kamion and base-config) * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-22 * ABI break; added Configuration::Clear(string List, {int,string} value) added (to remove a single Value from a list); test/conf_clear.cc added --- methods/gpgv.cc | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'methods') 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 #include #include +#include #include #include @@ -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::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::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(); -- cgit v1.2.3 From 75ef8f14174f83a5f876a0d7414f4e6064a7d3e0 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 9 Aug 2005 08:38:26 +0000 Subject: * merged from main Patches applied: * apt@packages.debian.org/apt--main--0--patch-106 Restore lost changelog entries * apt@packages.debian.org/apt--main--0--patch-107 Merge michael.vogt@ubuntu.com--2005/apt--progress-reporting--0 * apt@packages.debian.org/apt--main--0--patch-108 Merge michael.vogt@ubuntu.com--2005/apt--progress-reporting--0 * apt@packages.debian.org/apt--main--0--patch-109 Merge michael.vogt@ubuntu.com--2005/apt--progress-reporting--0 * apt@packages.debian.org/apt--main--0--patch-110 Merge michael.vogt@ubuntu.com--2005/apt--progress-reporting--0 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-5 * merged with apt--main--0 * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--base-0 tag of apt@packages.debian.org/apt--main--0--patch-85 * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-1 * inital proof of concept code, understands what dpkg tells it already * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-2 * progress reporting works now * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-3 * added "APT::Status-Fd" variable * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-4 * do i18n now too * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-5 * define N_(x) if it is not defined already * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-6 * PackageManager::DoInstall(int status_fd) added (does not break the ABI) * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-7 * merged with apt--fixes--0 to make it build again * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-8 * added support for "error" and "conffile-prompt" messages from dpkg * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-9 merge with main * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-10 * use sizeof() for all snprintf() uses; fix a potential line break problem in the status reading code; changed the N_() to _() calls * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-11 * added APT::KeepFDs configuration list for file descriptors that apt should leave open (needed for various frontends like debconf, synaptic) * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-12 * fixed a API breakage * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-13 * doc added, should be releasable now * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-14 * merged with apt--main--0 * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-15 * more source comments, added Debug::DpkgPM debug code to inspect the dpkg<->apt communication, broke the abi (ok with matt) * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-16 * the progress reporting has it's own "Debug::pkgDPkgProgressReporting" debug variable now * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-17 * merged PackageOps and TranslatedPackageOps into a single Map with the new DpkgState struct * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-18 * clear the APT::Keep-Fds configuration when it's no longer needed * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-19 * rewrote the reading from dpkg so that it never blocks * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-20 * merged the two status arrays into one * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-21 * added support for download progress reporting too (for Kamion and base-config) * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-22 * ABI break; added Configuration::Clear(string List, {int,string} value) added (to remove a single Value from a list); test/conf_clear.cc added * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-23 * remvoed a debug string * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-24 * soname changed, fixed a bug in the parsing code when dpkg send the same state more than once (at the end) * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-25 * merged with apt@packages.debian.org/apt--main--0, added changelog entry for the 0.6.40.1 upload * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-26 * fix a bug when out-of-order states are send from dpkg * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-27 * changelog update * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-28 * a real changelog entry now * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-29 * changelog finalized * michael.vogt@ubuntu.com--2005/apt--progress-reporting--0--patch-30 * propper (and sane) support for pmerror and pmconffile added --- methods/makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'methods') diff --git a/methods/makefile b/methods/makefile index 089300570..06fd2a6fc 100644 --- a/methods/makefile +++ b/methods/makefile @@ -7,7 +7,7 @@ include ../buildlib/defaults.mak BIN := $(BIN)/methods # FIXME.. -LIB_APT_PKG_MAJOR = 3.5 +LIB_APT_PKG_MAJOR = 3.10 APT_DOMAIN := libapt-pkg$(LIB_APT_PKG_MAJOR) # The file method -- cgit v1.2.3 From 25182152bc7812fdd56fd40f8b9a04a140079585 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 22 Aug 2005 22:27:56 +0000 Subject: * improve the timeout handling (again) --- methods/connect.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'methods') diff --git a/methods/connect.cc b/methods/connect.cc index b85df6887..4e48927ed 100644 --- a/methods/connect.cc +++ b/methods/connect.cc @@ -166,8 +166,11 @@ bool Connect(string Host,int Port,const char *Service,int DefPort,int &Fd, } if (Res == EAI_AGAIN) + { + Owner->SetFailExtraMsg("\nFailReason: TmpResolveFailure"); return _error->Error(_("Temporary failure resolving '%s'"), Host.c_str()); + } return _error->Error(_("Something wicked happened resolving '%s:%s' (%i)"), Host.c_str(),ServStr,Res); } -- cgit v1.2.3 From 13e8426f800dd5e21e78fa6488b860e3f0467984 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 23 Aug 2005 08:03:51 +0000 Subject: * merged with apt--fixes--0 Patches applied: * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-7 * fixed incorrect man-page example * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-8 * changelog udpate * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-9 * we only need to check once for xmlto * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-10 * fix a bug in a man-page, fix a problem with overly long lines in apt-cdrom * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-11 * merged with apt--main--0 * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-12 * fix a incorrect error message (it always added .gz regardless what was downloaded) * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-13 * merged with main * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-14 * added Hashsum support for file and cdrom * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-15 * added README.arch * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-16 * merged with main * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-17 * move the changelog to the right place * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-18 * Change pkgPolicy::Pin from private to protected * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-19 * added a default constructor for PrvIterator * michael.vogt@ubuntu.com--2005/apt--fixes--0--patch-20 * applied otavios patch to reread the statusFile on debSystem::Initialize * otavio@debian.org--2005/apt--fixes--0--patch-28 Reread status configuration, needed for clients using independent apt ... --- methods/cdrom.cc | 7 +++++++ methods/file.cc | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'methods') diff --git a/methods/cdrom.cc b/methods/cdrom.cc index 7cc036814..41eb8a0ee 100644 --- a/methods/cdrom.cc +++ b/methods/cdrom.cc @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -180,6 +181,12 @@ bool CDROMMethod::Fetch(FetchItem *Itm) CurrentID = NewID; Res.LastModified = Buf.st_mtime; Res.Size = Buf.st_size; + + Hashes Hash; + FileFd Fd(Res.Filename, FileFd::ReadOnly); + Hash.AddFD(Fd.Fd(), Fd.Size()); + Res.TakeHashes(Hash); + URIDone(Res); return true; } diff --git a/methods/file.cc b/methods/file.cc index 3500de9f5..9cdd5bc2d 100644 --- a/methods/file.cc +++ b/methods/file.cc @@ -15,6 +15,8 @@ // Include Files /*{{{*/ #include #include +#include +#include #include #include @@ -75,7 +77,11 @@ bool FileMethod::Fetch(FetchItem *Itm) if (Res.Filename.empty() == true) return _error->Error(_("File not found")); - + + Hashes Hash; + FileFd Fd(Res.Filename, FileFd::ReadOnly); + Hash.AddFD(Fd.Fd(), Fd.Size()); + Res.TakeHashes(Hash); URIDone(Res); return true; } -- cgit v1.2.3 From 2a7497704e9dee1f1d987e7a2cd59e939d991909 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 13 Sep 2005 14:09:50 +0000 Subject: * merged from apt--cdrom-fallback--0 Patches applied: * michael.vogt@ubuntu.com--2005/apt--cdrom-fallback--0--base-0 tag of apt@packages.debian.org/apt--main--0--patch-110 * michael.vogt@ubuntu.com--2005/apt--cdrom-fallback--0--patch-1 * initial patch to make falling back from cdrom possible * michael.vogt@ubuntu.com--2005/apt--cdrom-fallback--0--patch-2 * fix in methods/cdrom.cc: don't call Fail() but return false so that apt can fallback to a differencent source --- methods/cdrom.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'methods') diff --git a/methods/cdrom.cc b/methods/cdrom.cc index 41eb8a0ee..d6b8eae75 100644 --- a/methods/cdrom.cc +++ b/methods/cdrom.cc @@ -166,8 +166,7 @@ bool CDROMMethod::Fetch(FetchItem *Itm) if (MediaFail(Get.Host,CDROM) == false) { CurrentID = "FAIL"; - Fail(_("Wrong CD-ROM"),true); - return true; + return _error->Error(_("Disk not found.")); } } -- cgit v1.2.3