Blob Blame History Raw
commit abdc5d04ca75357f7e2cf9852c4b6d3486cf8dd5
Author: Valentina Mukhamedzhanova <vmukhame@redhat.com>
Date:   Wed Sep 10 09:45:26 2014 +0200

    reposync: preserve directory structure. BZ 1139032

diff --git a/reposync.py b/reposync.py
index bb4c59d..eb8ab21 100755
--- a/reposync.py
+++ b/reposync.py
@@ -291,10 +291,13 @@ def main():
 
         # set localpaths
         for pkg in download_list:
-            rpmfn = os.path.basename(pkg.remote_path)
+            rpmfn = pkg.remote_path
             pkg.localpath = os.path.join(local_repo_path, rpmfn)
             pkg.repo.copy_local = True
             pkg.repo.cache = 0
+            localdir = os.path.dirname(pkg.localpath)
+            if not os.path.exists(localdir):
+                os.makedirs(localdir)
 
         # use downloader from YumBase
         probs = my.downloadPkgs(download_list)