[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH] Archive .buildinfo files so we are at least collecting them now for future use.



Hi,

Attached is the following:

  commit 0d670db32f57ae1efa75fdc9eb3fa79efd660b88
  Author: Chris Lamb <lamby@debian.org>
  Date:   Thu Dec 15 20:17:05 2016 +0100
  
      Archive .buildinfo files so we are at least collecting them now for future use.
      
      Signed-off-by: Chris Lamb <lamby@debian.org>
  
   config/debian/dak.conf |  1 +
   dak/process_upload.py  | 19 +++++++++++++++++++
   2 files changed, 20 insertions(+)


You can also merge from the "archive-buildinfos" branch of
https://github.com/lamby/dak if that is more convenient.


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      lamby@debian.org / chris-lamb.co.uk
       `-
From 0d670db32f57ae1efa75fdc9eb3fa79efd660b88 Mon Sep 17 00:00:00 2001
From: Chris Lamb <lamby@debian.org>
Date: Thu, 15 Dec 2016 20:17:05 +0100
Subject: [PATCH] Archive .buildinfo files so we are at least collecting them
 now for future use.

Signed-off-by: Chris Lamb <lamby@debian.org>
---
 config/debian/dak.conf |  1 +
 dak/process_upload.py  | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/config/debian/dak.conf b/config/debian/dak.conf
index 10322cc4a..cd83b4430 100644
--- a/config/debian/dak.conf
+++ b/config/debian/dak.conf
@@ -223,6 +223,7 @@ Dir
   BTSVersionTrack "/srv/ftp-master.debian.org/queue/bts_version_track/";
   Done "/srv/ftp-master.debian.org/queue/done/";
   Reject "/srv/ftp-master.debian.org/queue/reject/";
+  BuildinfoArchive "/srv/ftp-master.debian.org/buildinfo/";
 };
 
 Queue-Report
diff --git a/dak/process_upload.py b/dak/process_upload.py
index d5425e058..3c055ba79 100755
--- a/dak/process_upload.py
+++ b/dak/process_upload.py
@@ -263,6 +263,7 @@ def accept(directory, upload):
     print "ACCEPT"
 
     upload.install()
+    process_buildinfos(upload)
 
     accepted_to_real_suite = False
     for suite in upload.final_suites:
@@ -493,6 +494,24 @@ def process_changes(changes_filenames):
     for directory, c in changes:
         process_it(directory, c, keyring_files)
 
+def process_buildinfos(upload):
+    cnf = Config()
+
+    target_dir = os.path.join(
+        cnf['Dir::BuildinfoArchive'],
+        datetime.datetime.now().strftime('%Y/%m/%d'),
+    )
+
+    for x in upload.changes.files.itervalues():
+        if not re_file_buildinfo.match(x.filename):
+            continue
+
+        src = os.path.join(upload.directory, x.filename)
+        dst = utils.find_next_free(os.path.join(target_dir, x.filename))
+
+        Logger.log(["Archiving", x.filename])
+        upload.transaction.fs.copy(src, dst, mode=0o644)
+
 ###############################################################################
 
 def main():
-- 
2.11.0


Reply to: