diff -ur synaptic-0.31/common/rpackagecache.cc synaptic-0.31.my/common/rpackagecache.cc --- synaptic-0.31/common/rpackagecache.cc 2002-07-26 00:47:20 +0400 +++ synaptic-0.31.my/common/rpackagecache.cc 2003-01-13 20:56:01 +0300 @@ -43,11 +43,12 @@ return false; // Read the source list - pkgSourceList list; - if (!list.ReadMainList()) + //pkgSourceList list; + assert(_list!=NULL); + if (!_list->ReadMainList()) return _error->Error(_("The list of sources could not be read.")); - pkgMakeStatusCache(list, progress); + pkgMakeStatusCache(*_list, progress); if (_error->PendingError()) return _error->Error(_("The package lists or status file could not be parsed or opened.")); diff -ur synaptic-0.31/common/rpackagecache.h synaptic-0.31.my/common/rpackagecache.h --- synaptic-0.31/common/rpackagecache.h 2002-07-26 00:47:20 +0400 +++ synaptic-0.31.my/common/rpackagecache.h 2003-01-14 14:56:19 +0300 @@ -27,7 +27,7 @@ #include - +#include class OpProgress; @@ -41,11 +41,13 @@ pkgPolicy *_policy; pkgDepCache *_dcache; + pkgSourceList *_list; bool _locked; public: inline pkgDepCache *deps() { return _dcache; }; + inline pkgSourceList *list() { return _list; }; bool open(OpProgress &progress); bool reset(OpProgress &progress); @@ -53,7 +55,8 @@ bool lock(); void releaseLock(); - RPackageCache() : _map(0), _cache(0), _policy(0), _dcache(0) {}; + RPackageCache() : _map(0), _cache(0), _policy(0), _dcache(0) { _list = new pkgSourceList(); }; + ~RPackageCache() { delete _list; }; }; diff -ur synaptic-0.31/common/rpackagelister.cc synaptic-0.31.my/common/rpackagelister.cc --- synaptic-0.31/common/rpackagelister.cc 2003-01-04 19:08:35 +0300 +++ synaptic-0.31.my/common/rpackagelister.cc 2003-01-14 14:28:16 +0300 @@ -777,9 +777,12 @@ bool RPackageLister::updateCache(pkgAcquireStatus *status) { + assert(_cache->list() != NULL); // Get the source list - pkgSourceList List; - if (List.ReadMainList() == false) + //pkgSourceList List; + //if (_cache->list()->ReadMainList() == false) + //return false; + if (_cache->list()->Read(_config->FindFile("Dir::Etc::sourcelist")) == false) return false; // Lock the list directory @@ -799,7 +802,7 @@ bool Failed = false; #if HAVE_RPM - if (List.GetReleases(&Fetcher) == false) + if (_cache->list()->GetReleases(&Fetcher) == false) return false; Fetcher.Run(); for (pkgAcquire::ItemIterator I = Fetcher.ItemsBegin(); I != Fetcher.ItemsEnd(); I++) @@ -813,7 +816,7 @@ _error->Warning(_("Release files for some repositories could not be retrieved or authenticated. Such repositories are being ignored.")); #endif /* HAVE_RPM */ - if (!List.GetIndexes(&Fetcher)) + if (!_cache->list()->GetIndexes(&Fetcher)) return false; // Run it @@ -861,14 +864,18 @@ pkgAcquire fetcher(status); + assert(_cache->list() != NULL); // Read the source list - pkgSourceList list; - if (list.ReadMainList() == false) { + //pkgSourceList list; + //if (_cache->list()->ReadMainList() == false) { + //return _error->Error(_("The list of sources could not be read.")); + //} + if (_cache->list()->Read(_config->FindFile("Dir::Etc::sourcelist")) == false) { return _error->Error(_("The list of sources could not be read.")); } _packMan = _system->CreatePM(_cache->deps()); - if (!_packMan->GetArchives(&fetcher, &list, _records) || + if (!_packMan->GetArchives(&fetcher, _cache->list(), _records) || _error->PendingError()) goto gave_wood; @@ -949,7 +956,7 @@ // Reload the fetcher object and loop again for media swapping fetcher.Shutdown(); - if (!_packMan->GetArchives(&fetcher, &list, _records)) + if (!_packMan->GetArchives(&fetcher, _cache->list(), _records)) goto gave_wood; }