[28790] in Source-Commits

home help back first fref pref prev next nref lref last post

build-system commit: dapopulate: Delay export to end

daemon@ATHENA.MIT.EDU (Anders Kaseorg)
Sun May 7 06:29:49 2017

Date: Sun, 7 May 2017 06:29:45 -0400
From: Anders Kaseorg <andersk@mit.edu>
Message-Id: <201705071029.v47ATjeQ002646@drugstore.mit.edu>
To: source-commits@mit.edu

https://github.com/mit-athena/build-system/commit/2d3b59d5df618f094cad79e630bd2571966297fd
commit 2d3b59d5df618f094cad79e630bd2571966297fd
Author: Anders Kaseorg <andersk@mit.edu>
Date:   Sun May 7 00:56:22 2017 -0400

    dapopulate: Delay export to end
    
    Signed-off-by: Anders Kaseorg <andersk@mit.edu>

 dabuildsys/reprepro.py |    5 +++--
 dapopulate             |   11 +++++++----
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/dabuildsys/reprepro.py b/dabuildsys/reprepro.py
index fe7a631..f112526 100644
--- a/dabuildsys/reprepro.py
+++ b/dabuildsys/reprepro.py
@@ -64,8 +64,9 @@ def include_package(distro, pkg, dver):
     changes = "%s_%s_source.changes" % (pkg.name, dver)
     include_changes(distro, os.path.join(config.source_package_dir, changes))
 
-def copy_package(pkg, from_dist, to_dist):
+def copy_package(pkg, from_dist, to_dist, export=True):
     """Copy a specific version of package (APTSourcePackage) from
     one distribution to another."""
 
-    call('-A', 'source', 'copysrc', to_dist, from_dist, pkg.name, str(pkg.version))
+    print call(*([] if export else ['--export=never']) +
+               ['-A', 'source', 'copysrc', to_dist, from_dist, pkg.name, str(pkg.version)])
diff --git a/dapopulate b/dapopulate
index 49ed723..90c03e6 100755
--- a/dapopulate
+++ b/dapopulate
@@ -81,10 +81,13 @@ def main():
 
     # Actually populate the repository
     print "Populating %s with %i packages from %s" % (repo.name, len(packages), donor_repo.name)
-    for package_name, git_version in packages:
-        pkg = donor_repo.sources[package_name]
-        print "Copying %s from %s to %s" % (package_name, pkg.origin, repo.name)
-        reprepro.copy_package(pkg, pkg.origin, repo.name)
+    try:
+        for package_name, git_version in packages:
+            pkg = donor_repo.sources[package_name]
+            print "Copying %s from %s to %s" % (package_name, pkg.origin, repo.name)
+            reprepro.copy_package(pkg, pkg.origin, repo.name, export=False)
+    finally:
+        print reprepro.call('export')
 
 if __name__ == '__main__':
     if not dabuildsys.claim_lock():

home help back first fref pref prev next nref lref last post