Yeah! That really helped! But how does the pkgSourceList destructor gets
called before the lists are refreshed? Is there any way to eliminate the
memory leak as well?
Andrey, would you please be able to test the attached patch?
Thanks!
------------------------------------------------------------------------
Index: apt-pkg/rpm/rpmindexfile.cc
===================================================================
--- apt-pkg/rpm/rpmindexfile.cc (revision 320)
+++ apt-pkg/rpm/rpmindexfile.cc (working copy)
@@ -644,10 +644,8 @@
{
if ((*iter)->URI == URI && (*iter)->Dist == Dist)
{
- // The registered object has no vendor, but the new one does
- // so, we make the previous one have the vendor too.
- if ((*iter)->Vendor == NULL && Vendor != NULL)
- (*iter)->Vendor = Vendor;
+ if (Vendor != NULL)
+ (*iter)->FingerPrint = Vendor->FingerPrint;
return *iter;
}
}
Index: apt-pkg/repository.h
===================================================================
--- apt-pkg/repository.h (revision 320)
+++ apt-pkg/repository.h (working copy)
@@ -28,27 +28,29 @@
map<string,Checksum> IndexChecksums; // path -> checksum data
bool GotRelease;
-
+
public:
string URI;
string Dist;
- const pkgSourceList::Vendor *Vendor;
string RootURI;
bool Acquire;
-
+ string FingerPrint;
+
bool ParseRelease(string File);
bool HasRelease() const { return GotRelease; }
- bool IsAuthenticated() const { return Vendor != NULL; };
+ bool IsAuthenticated() const { return !FingerPrint.empty(); };
bool FindChecksums(string URI,unsigned long &Size, string &MD5);
pkgRepository(string URI,string Dist, const pkgSourceList::Vendor *Vendor,
string RootURI)
- : GotRelease(0), URI(URI), Dist(Dist), Vendor(Vendor), RootURI(RootURI),
+ : GotRelease(0), URI(URI), Dist(Dist), RootURI(RootURI),
Acquire(1)
- {};
+ {
+ if (Vendor) FingerPrint = Vendor->FingerPrint;
+ };
};
Index: apt-pkg/acquire-item.cc
===================================================================
--- apt-pkg/acquire-item.cc (revision 320)
+++ apt-pkg/acquire-item.cc (working copy)
@@ -477,11 +477,11 @@
}
// Match fingerprint of Release file
- if (Repository->Vendor->FingerPrint != FingerPrint)
+ if (Repository->FingerPrint != FingerPrint)
{
Status = StatError;
ErrorText = _("Signature fingerprint of Release file does not match
(expected ")
- +Repository->Vendor->FingerPrint+_(", got ")+FingerPrint+")";
+ +Repository->FingerPrint+_(", got ")+FingerPrint+")";
return;
}
}