[PATCH] additional yum-utils scripts with invalid package size check

Perry Myers <[email protected]>
Newsgroups gmane.linux.rpm.yum
Message-ID <[email protected]>
Similar to my patch posted on 05/31/07, this patch fixes repotrack and
yumdownloader so that they properly skip packages that have already been downloaded.

Perry Myers

-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 703 362 9622 -=|

_______________________________________________
Yum mailing list
[email protected]
https://lists.dulug.duke.edu/mailman/listinfo/yum
yum-utils-invalid_filesize_check.patch (text/x-patch, 1.5 KB)
diff -Naur --exclude=CVS yum-utils/repotrack.py yum-utils-mod/repotrack.py
--- yum-utils/repotrack.py	2007-06-05 11:41:11.000000000 -0400
+++ yum-utils-mod/repotrack.py	2007-06-05 12:01:47.000000000 -0400
@@ -220,7 +220,7 @@
         local = os.path.basename(remote)
         local = os.path.join(opts.destdir, local)
         if (os.path.exists(local) and 
-            str(os.path.getsize(local)) == pkg.returnSimple('packagesize')):
+            os.path.getsize(local) == int(pkg.returnSimple('packagesize'))):
             
             if not opts.quiet:
                 my.logger.info("%s already exists and appears to be complete" % local)
diff -Naur --exclude=CVS yum-utils/yumdownloader.py yum-utils-mod/yumdownloader.py
--- yum-utils/yumdownloader.py	2007-06-05 11:41:11.000000000 -0400
+++ yum-utils-mod/yumdownloader.py	2007-06-05 12:02:07.000000000 -0400
@@ -159,7 +159,7 @@
                     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')):
+                    os.path.getsize(local) == int(download.returnSimple('packagesize'))):
                     self.logger.error("%s already exists and appears to be complete" % local)
                     continue
                 # Disable cache otherwise things won't download
@@ -188,4 +188,4 @@
         
 if __name__ == '__main__':
     util = YumDownloader()
-        
\ No newline at end of file
+
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.