Blame SOURCES/BZ-1139032-reposync-directory-structure.patch

085af2
commit abdc5d04ca75357f7e2cf9852c4b6d3486cf8dd5
085af2
Author: Valentina Mukhamedzhanova <vmukhame@redhat.com>
085af2
Date:   Wed Sep 10 09:45:26 2014 +0200
085af2
085af2
    reposync: preserve directory structure. BZ 1139032
085af2
085af2
diff --git a/reposync.py b/reposync.py
085af2
index bb4c59d..eb8ab21 100755
085af2
--- a/reposync.py
085af2
+++ b/reposync.py
085af2
@@ -291,10 +291,13 @@ def main():
085af2
 
085af2
         # set localpaths
085af2
         for pkg in download_list:
085af2
-            rpmfn = os.path.basename(pkg.remote_path)
085af2
+            rpmfn = pkg.remote_path
085af2
             pkg.localpath = os.path.join(local_repo_path, rpmfn)
085af2
             pkg.repo.copy_local = True
085af2
             pkg.repo.cache = 0
085af2
+            localdir = os.path.dirname(pkg.localpath)
085af2
+            if not os.path.exists(localdir):
085af2
+                os.makedirs(localdir)
085af2
 
085af2
         # use downloader from YumBase
085af2
         probs = my.downloadPkgs(download_list)