[28750] in Source-Commits

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

build-system commit: dacopy: Delay export to end; suppress notification for missing releases

daemon@ATHENA.MIT.EDU (System T. Builder)
Sat May 6 17:16:10 2017

Date: Sat, 6 May 2017 17:16:05 -0400
From: "System T. Builder" <builder@mit.edu>
Message-Id: <201705062116.v46LG514013587@drugstore.mit.edu>
To: source-commits@mit.edu

https://github.com/mit-athena/build-system/commit/4ff084f9508e87dad029a5680e0bf6068670d1d4
commit 4ff084f9508e87dad029a5680e0bf6068670d1d4
Author: Anders Kaseorg <andersk@mit.edu>
Date:   Thu Nov 24 22:15:17 2016 -0500

    dacopy: Delay export to end; suppress notification for missing releases
    
    Signed-off-by: Anders Kaseorg <andersk@mit.edu>

 dareprepro |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/dareprepro b/dareprepro
index 53235f5..9f98f18 100755
--- a/dareprepro
+++ b/dareprepro
@@ -111,16 +111,27 @@ def dacopy(moving=False):
                 "         (Ensure the source and destination are not reversed.)"
         if not (args.override and yesreally()):
             sys.exit(1)
+    to_export = []
     for package in args.packages:
         success, fail = [], []
         for r in config.releases:
-            if run_reprepro('copysrc', distro(dst, r),
-                            distro(src, r), package):
+            try:
+                out = reprepro.call('--export=never', 'copysrc', distro(dst, r), distro(src, r),
+                                    package)
+                if distro(dst, r) not in to_export:
+                    to_export.append(distro(dst, r))
+                print out
+                if out.startswith('Nothing to do'):
+                    continue
                 if (not moving) or \
                         (moving and
-                         run_reprepro('removesrc', distro(src, r), package)):
+                         run_reprepro('--export=never', 'removesrc', distro(src, r), package)):
+                    if moving and distro(src, r) not in to_export:
+                        to_export.append(distro(src, r))
                     success.append(r)
                     continue
+            except subprocess.CalledProcessError as e:
+                print >>sys.stderr, e.output
             fail.append(r)
         if len(fail) > 0:
             print >>sys.stderr, "FAILED to {verb} {pkg} for: {suites}".format(
@@ -132,6 +143,7 @@ def dacopy(moving=False):
             notify("Moved {0} from {1} to {2} for\n{3}".format(package,
                                                                src, dst,
                                                                success))
+    print reprepro.call('export', *to_export)
 
 def damove():
     dacopy(moving=True)

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