]> git.saurik.com Git - apt.git/commitdiff
* merged from the laptop branch (smallish fixes)
authorMichael Vogt <michael.vogt@ubuntu.com>
Tue, 2 May 2006 08:52:24 +0000 (10:52 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Tue, 2 May 2006 08:52:24 +0000 (10:52 +0200)
apt-inst/deb/dpkgdb.cc
debian/changelog
debian/postinst
methods/gpgv.cc

index c6a0e80e6c3ffc416eab573b3aa151a997b26ec9..718e1ab985f5fb04e6d8d0dfe65f7c627a36ed81 100644 (file)
@@ -383,7 +383,7 @@ bool debDpkgDB::ReadyFileList(OpProgress &Progress)
       return _error->Error(_("The pkg cache must be initialized first"));
    if (FList != 0)
    {
-      Progress.OverallProgress(1,1,1,_("Reading file list"));
+      Progress.OverallProgress(1,1,1,_("Reading file listing"));
       return true;
    }
    
index ec3daf4453e13d9579c353ae74ebaaed7a7c1ab0..b104e9666748955e1b27bcc7a9f6e14c4ec43de3 100644 (file)
@@ -15,8 +15,12 @@ apt (0.6.44) unstable; urgency=low
       (thanks to Bart Martens for the patch, closes: #307756)
   * debian/libapt-pkg-doc.doc-base.cache:
     - remove broken charackter from description (closes: #361129)
-
- -- Michael Vogt <michael.vogt@ubuntu.com>  Tue, 25 Apr 2006 09:34:20 +0200
+  * apt-inst/deb/dpkgdb.cc, methods/gpgv.cc: 
+    - i18n fixes (closes: #349298)
+  * debian/postinst: dont fail on not available
+    /usr/share/doc/apt/examples/sources.list (closes: #361130)
+  
+ --
 
 apt (0.6.43.3) unstable; urgency=low
 
index 89179211137e16c7be20f5b6bb75deeee52334ba..1588f524123203701470750f6dac2e7678c67db4 100755 (executable)
@@ -12,7 +12,10 @@ set -e
 
 create_apt_conf ()
 {
- cp /usr/share/doc/apt/examples/sources.list /etc/apt/sources.list
+ EXAMPLE_SOURCE=/usr/share/doc/apt/examples/sources.list
+ if [ -f $EXAMPLE_SOURCE ]; then
+     cp $EXAMPLE_SOURCE /etc/apt/sources.list
+ fi
 }
  
 check_apt_conf ()
index a114ad797dd0967c19e87d83829d9e11e017d02e..ba7389cbaef5a6188cfff4f48bc32ceee12ec50a 100644 (file)
@@ -11,6 +11,7 @@
 #include <errno.h>
 #include <sys/wait.h>
 #include <iostream>
+#include <sstream>
 
 #define GNUPGPREFIX "[GNUPG:]"
 #define GNUPGBADSIG "[GNUPG:] BADSIG"
@@ -20,7 +21,7 @@
 class GPGVMethod : public pkgAcqMethod
 {
    private:
-   const char *VerifyGetSigners(const char *file, const char *outfile,
+   string VerifyGetSigners(const char *file, const char *outfile,
                                vector<string> &GoodSigners, vector<string> &BadSigners,
                                vector<string> &NoPubKeySigners);
    
@@ -32,11 +33,15 @@ class GPGVMethod : public pkgAcqMethod
    GPGVMethod() : pkgAcqMethod("1.0",SingleInstance | SendConfig) {};
 };
 
-const char *GPGVMethod::VerifyGetSigners(const char *file, const char *outfile,
+string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile,
                                         vector<string> &GoodSigners,
                                         vector<string> &BadSigners,
                                         vector<string> &NoPubKeySigners)
 {
+   // setup a (empty) stringstream for formating the return value
+   std::stringstream ret;
+   ret.str("");
+
    if (_config->FindB("Debug::Acquire::gpgv", false))
    {
       std::cerr << "inside VerifyGetSigners" << std::endl;
@@ -54,9 +59,11 @@ const char *GPGVMethod::VerifyGetSigners(const char *file, const char *outfile,
       std::cerr << "Keyring path: " << pubringpath << std::endl;
    }
 
-   if (stat(pubringpath.c_str(), &buff) != 0)
-      return (string("Couldn't access keyring: ") + strerror(errno)).c_str();
-
+   if (stat(pubringpath.c_str(), &buff) != 0) 
+   {
+      ioprintf(ret, _("Couldn't access keyring: '%s'"), strerror(errno)); 
+      return ret.str();
+   }
    if (pipe(fd) < 0)
    {
       return "Couldn't create pipe";
@@ -65,7 +72,7 @@ const char *GPGVMethod::VerifyGetSigners(const char *file, const char *outfile,
    pid = fork();
    if (pid < 0)
    {
-      return (string("Couldn't spawn new process") + strerror(errno)).c_str();
+      return string("Couldn't spawn new process") + strerror(errno);
    }
    else if (pid == 0)
    {
@@ -189,7 +196,7 @@ const char *GPGVMethod::VerifyGetSigners(const char *file, const char *outfile,
    {
       if (GoodSigners.empty())
          return _("Internal error: Good signature, but could not determine key fingerprint?!");
-      return NULL;
+      return "";
    }
    else if (WEXITSTATUS(status) == 1)
    {
@@ -197,9 +204,8 @@ const char *GPGVMethod::VerifyGetSigners(const char *file, const char *outfile,
    }
    else if (WEXITSTATUS(status) == 111)
    {
-      // FIXME String concatenation considered harmful.
-      return (string(_("Could not execute ")) + gpgvpath +
-             string(_(" to verify signature (is gnupg installed?)"))).c_str();
+      ioprintf(ret, _("Could not execute '%s' to verify signature (is gnupg installed?)"), gpgvpath.c_str());
+      return ret.str();
    }
    else
    {
@@ -221,8 +227,8 @@ bool GPGVMethod::Fetch(FetchItem *Itm)
    URIStart(Res);
 
    // Run gpgv on file, extract contents and get the key ID of the signer
-   const char *msg = VerifyGetSigners(Path.c_str(), Itm->DestFile.c_str(),
-                                     GoodSigners, BadSigners, NoPubKeySigners);
+   string msg = VerifyGetSigners(Path.c_str(), Itm->DestFile.c_str(),
+                             GoodSigners, BadSigners, NoPubKeySigners);
    if (GoodSigners.empty() || !BadSigners.empty() || !NoPubKeySigners.empty())
    {
       string errmsg;