[yum-cvs] yum-utils reposync.py, 1.11, 1.12 repotrack.py, 1.10, 1.11 yumdownloader.py, 1.13, 1.14

Seth Vidal skvidal at linux.duke.edu
Wed Oct 25 05:27:17 UTC 2006


Update of /home/groups/yum/cvs/yum-utils
In directory login1.linux.duke.edu:/tmp/cvs-serv3232

Modified Files:
	reposync.py repotrack.py yumdownloader.py 
Log Message:

check in patch from Mark McLoughlin to fix handling of local repos in
reposync, repotrack and yumdownloader.


Index: reposync.py
===================================================================
RCS file: /home/groups/yum/cvs/yum-utils/reposync.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- reposync.py	25 Sep 2006 13:42:49 -0000	1.11
+++ reposync.py	25 Oct 2006 05:27:15 -0000	1.12
@@ -34,6 +34,7 @@
 
 import os
 import sys
+import shutil
 
 from optparse import OptionParser
 from urlparse import urljoin
@@ -186,9 +187,10 @@
             if not opts.quiet:
                 my.logger.info( 'Downloading %s' % os.path.basename(remote))
             pkg.localpath = local # Hack: to set the localpath we want.
-            repo.getPackage(pkg)
-            
+            path = repo.getPackage(pkg)
 
+            if not os.path.exists(local) or not os.path.samefile(path, local):
+                shutil.copy2(path, local)
 
 if __name__ == "__main__":
     main()

Index: repotrack.py
===================================================================
RCS file: /home/groups/yum/cvs/yum-utils/repotrack.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- repotrack.py	18 Sep 2006 16:06:13 -0000	1.10
+++ repotrack.py	25 Oct 2006 05:27:15 -0000	1.11
@@ -23,6 +23,7 @@
 
 import os
 import sys
+import shutil
 from optparse import OptionParser
 from urlparse import urljoin
 import logging
@@ -235,8 +236,10 @@
         if not opts.quiet:        
             my.logger.info('Downloading %s' % os.path.basename(remote))
         pkg.localpath = local # Hack: to set the localpath to what we want.
-        repo.getPackage(pkg)
+        path = repo.getPackage(pkg)
 
+        if not os.path.exists(local) or not os.path.samefile(path, local):
+            shutil.copy2(path, local)
 
 if __name__ == "__main__":
     main()

Index: yumdownloader.py
===================================================================
RCS file: /home/groups/yum/cvs/yum-utils/yumdownloader.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- yumdownloader.py	30 Sep 2006 05:29:59 -0000	1.13
+++ yumdownloader.py	25 Oct 2006 05:27:15 -0000	1.14
@@ -21,6 +21,7 @@
 import yum
 import yum.Errors
 import os
+import shutil
 import output
 import rpmUtils.arch
 from urlgrabber.progress import TextMeter
@@ -174,7 +175,14 @@
             # Disable cache otherwise things won't download
             repo.cache = 0
             download.localpath = local # Hack: to set the localpath we want.
-            repo.getPackage(download)
+            path = repo.getPackage(download)
+
+            if not os.path.exists(local) or not os.path.samefile(path, local):
+                progress = TextMeter()
+                progress.start(basename=os.path.basename(local),
+                               size=os.stat(path).st_size)
+                shutil.copy2(path, local)
+                progress.end(progress.size)
 
 if __name__ == '__main__':
     main()




More information about the Yum-cvs-commits mailing list