]> git.saurik.com Git - apt.git/commitdiff
really move clearsign check into pkgAcqMetaClearSig::Done()
authorMichael Vogt <mvo@debian.org>
Sat, 2 Aug 2014 03:44:50 +0000 (05:44 +0200)
committerMichael Vogt <mvo@debian.org>
Sat, 2 Aug 2014 03:44:55 +0000 (05:44 +0200)
apt-pkg/acquire-item.cc
apt-pkg/acquire-item.h

index e98eaa445f85188b81f1f476d3612b170b089d47..7690ebb2ef9e9f9eb74bed7aa18893bb106c6ad9 100644 (file)
@@ -2000,21 +2000,28 @@ string pkgAcqMetaClearSig::Custom600Headers() const
    return "\nIndex-File: true\nFail-Ignore: true\nLast-Modified: " + TimeRFC1123(Buf.st_mtime);
 }
                                                                        /*}}}*/
-void pkgAcqMetaClearSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf) /*{{{*/
+// pkgAcqMetaClearSig::Done - We got a file                            /*{{{*/
+// ---------------------------------------------------------------------
+void pkgAcqMetaClearSig::Done(std::string Message,unsigned long long Size, 
+                              HashStringList const &Hashes,
+                              pkgAcquire::MethodConfig *Cnf)
 {
-   // we failed, we will not get additional items from this method
-   ExpectedAdditionalItems = 0;
-
    // if we expect a ClearTextSignature (InRelase), ensure that
    // this is what we get and if not fail to queue a 
    // Release/Release.gpg, see #346386
-   if (!StartsWithGPGClearTextSignature(DestFile))
+   if (FileExists(DestFile) && !StartsWithGPGClearTextSignature(DestFile))
    {
       //_error->Error(_("Does not start with a clear sign signature"));
       pkgAcquire::Item::Failed(Message, Cnf);
       return;
    }
-
+   pkgAcqMetaIndex::Done(Message, Size, Hashes, Cnf);
+}
+                                                                       /*}}}*/
+void pkgAcqMetaClearSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf) /*{{{*/
+{
+   // we failed, we will not get additional items from this method
+   ExpectedAdditionalItems = 0;
 
    if (AuthPass == false)
    {
index 31279f7dfdea5fffbc07cb631843b1d0f5dc7dd9..28577e9b843a2a45459dfaf6040d48d6751bf8fb 100644 (file)
@@ -507,8 +507,10 @@ class pkgAcqMetaClearSig : public pkgAcqMetaIndex
    std::string MetaSigShortDesc;
 
 public:
-   void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
+   virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
    virtual std::string Custom600Headers() const;
+   virtual void Done(std::string Message,unsigned long long Size, HashStringList const &Hashes,
+                    pkgAcquire::MethodConfig *Cnf);
 
    /** \brief Create a new pkgAcqMetaClearSig. */
    pkgAcqMetaClearSig(pkgAcquire *Owner,