On Wed, 2012-03-28 at 17:06 +0200, Zdeněk Pavlas wrote: > Add _commonRetrieveDataMD_list() that returns the list of metadata > objects to be downloaded. > > Add _commonRetrieveDataMD_done() to unpack and commit new files > after they have been succesfully downloaded. > --- > yum/yumRepo.py | 47 +++++++++++++++++------------------------------ > 1 files changed, 17 insertions(+), 30 deletions(-) > > diff --git a/yum/yumRepo.py b/yum/yumRepo.py > index 5a91fcd..9441cf6 100644 > --- a/yum/yumRepo.py > +++ b/yum/yumRepo.py > @@ -1324,6 +1324,17 @@ Insufficient space in download directory %s > into the delete list, this means metadata can change filename > without us leaking it. """ > > + downloading = self._commonRetrieveDataMD_list(mdtypes) > + for (ndata, nmdtype) in downloading: > + if not self._retrieveMD(nmdtype, retrieve_can_fail=True): > + self._revertOldRepoXML() > + return False > + self._commonRetrieveDataMD_done(downloading) > + return True > + > + def _commonRetrieveDataMD_list(self, mdtypes): > + """ Return a list of metadata to be retrieved """ > + > def _mdtype_eq(omdtype, odata, nmdtype, ndata): > """ Check if two returns from _get_mdtype_data() are equal. """ > if ndata is None: > @@ -1355,8 +1366,7 @@ Insufficient space in download directory %s > > # Inited twice atm. ... sue me > self._oldRepoMDData['new_MD_files'] = [] > - downloading_with_size = [] > - downloading_no_size = [] > + downloading = []
The reason I split this is because if you are downloading N objects and 1 of them has no size information, then you can't give a total size for all N objects (and thus. no "when will it finish progress" etc.) This will only look much worse if we async objects from multiple repos. and N gets much bigger. Can we not do two passes? Apart from that ACK. _______________________________________________ Yum-devel mailing list [email protected] http://lists.baseurl.org/mailman/listinfo/yum-devel
