[yum-cvs] yum-utils yumdownloader.py,1.18,1.19

Tim Lauridsen timlau at linux.duke.edu
Fri Apr 13 13:07:54 UTC 2007


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

Modified Files:
	yumdownloader.py 
Log Message:
create destdir if it not exists

Index: yumdownloader.py
===================================================================
RCS file: /home/groups/yum/cvs/yum-utils/yumdownloader.py,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- yumdownloader.py	19 Feb 2007 11:20:12 -0000	1.18
+++ yumdownloader.py	13 Apr 2007 13:07:52 -0000	1.19
@@ -23,6 +23,9 @@
 from utils import YumUtilBase
 
 from urlparse import urljoin
+from urlgrabber.progress import TextMeter
+import shutil
+
 
 class YumDownloader(YumUtilBase):
     NAME = 'yumdownloader'
@@ -56,6 +59,7 @@
                 self.logger.error("Error: Could not make cachedir, exiting")
                 sys.exit(50)
             self.repos.setCacheDir(cachedir)
+
         
         # Setup yum (Ts, RPM db, Repo & Sack)
         self.doUtilYumSetup()
@@ -142,6 +146,8 @@
                     self.logger.info('%s' % url)
                     continue
                 local = os.path.basename(remote)
+                if not os.path.exists(opts.destdir):
+                    os.makedirs(opts.destdir)
                 local = os.path.join(opts.destdir, local)
                 if (os.path.exists(local) and 
                     str(os.path.getsize(local)) == download.returnSimple('packagesize')):




More information about the Yum-cvs-commits mailing list