[yum-commits] yum/__init__.py

zpavlas at osuosl.org zpavlas at osuosl.org
Tue Aug 6 15:36:45 UTC 2013


 yum/__init__.py |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 8377ea2a5fcfb244fbca0538033fa21903090a0c
Author: Zdenek Pavlas <zpavlas at redhat.com>
Date:   Tue Aug 6 17:31:46 2013 +0200

    fix file:// repository && downloadonly. BZ 903294, BZ 993567

diff --git a/yum/__init__.py b/yum/__init__.py
index dabb0d6..7a5332b 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -2460,17 +2460,17 @@ much more problems).
 
             if downloadonly:
                 for po in remote_pkgs:
-                    rpmfile = po.localpath.rsplit('.', 2)[0]
+                    if not po.localpath.endswith('.tmp'):
+                        # file:// repos don't "download"
+                        continue
                     if po in errors:
                         # we may throw away partial file here- but we don't lock,
                         # so can't rename tempfile to rpmfile safely
                         misc.unlink_f(po.localpath)
-
-                    #  Note that for file:// repos. urlgrabber won't "download"
-                    # so we have to check that po.localpath exists.
-                    elif os.path.exists(po.localpath):
+                    else:
                         # verifyPkg() didn't complain, so (potentially)
                         # overwriting another copy should not be a problem
+                        rpmfile = po.localpath.rsplit('.', 2)[0]
                         os.rename(po.localpath, rpmfile)
                         po.localpath = rpmfile
                     


More information about the Yum-commits mailing list