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

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