On Wed, 2007-02-14 at 15:41 -0500, Seth Vidal wrote:
> Update of /home/groups/yum/cvs/yum/yum
> In directory login1.linux.duke.edu:/tmp/cvs-serv20763/yum
> 
> Modified Files:
>       depsolve.py packages.py 
> Log Message:
> remove the need for .hdr files for the transaction run.
> - add 'noheaders' option to DepSolve.populateTs(). Defaults to False for
>   backward api compat. When True it will not attempt to retrieve the .hdr
>   via byteranges but will read it out of the rpm

Can't we be smarter here and just see that the file is already present
and not download in that case and otherwise do the download?  Something
like the attached...

Jeremy
Index: yum/depsolve.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/depsolve.py,v
retrieving revision 1.116
diff -u -u -r1.116 depsolve.py
--- yum/depsolve.py	14 Feb 2007 20:41:36 -0000	1.116
+++ yum/depsolve.py	14 Feb 2007 21:54:53 -0000
@@ -120,7 +120,7 @@
         
         return 0
 
-    def populateTs(self, test=0, keepold=1, noheaders=False):
+    def populateTs(self, test=0, keepold=1):
         """take transactionData class and populate transaction set"""
 
         if self.dsCallback: self.dsCallback.transactionPopulation()
@@ -148,14 +148,11 @@
                 if ts_elem.has_key((txmbr.pkgtup, 'i')):
                     continue
                 rpmfile = txmbr.po.localPkg()
-                if not noheaders:
+                if os.path.exists(rpmfile):
+                    hdr = txmbr.po.returnHeaderFromPackage(self.ts)
+                else:
                     self.downloadHeader(txmbr.po)
                     hdr = txmbr.po.returnLocalHeader()
-                else:
-                    # get header from the rpm itself
-                    # maybe we should check to see if the file exists, first?
-
-                    hdr = txmbr.po.returnHeaderFromPackage(self.ts)
                 
                 if txmbr.ts_state == 'u':
                     if self.allowedMultipleInstalls(txmbr.po):
_______________________________________________
Yum-devel mailing list
[email protected]
https://lists.dulug.duke.edu/mailman/listinfo/yum-devel

Reply via email to