[Piuparts-commits] [piuparts] 02/02: piuparts-reports: Add sources.yaml and section.yaml exports.

Holger Levsen holger at alioth.debian.org
Sat Aug 24 13:59:20 UTC 2013


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch bikeshed
in repository piuparts.

commit 8b82722187166f4f28e5ee69ae61864580efcb59
Author: Ivo De Decker <ivo.dedecker at ugent.be>
Date:   Sat Aug 24 15:30:02 2013 +0200

    piuparts-reports: Add sources.yaml and section.yaml exports.
---
 debian/changelog   |    6 ++++++
 debian/control     |    1 +
 piuparts-report.py |   13 +++++++++++++
 3 files changed, 20 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index d97f9c6..85ac438 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+piuparts (0.55) UNRELEASED; urgency=low
+
+  * piuparts-reports: Add sources.yaml and section.yaml exports.
+
+ -- Ivo De Decker <ivo.dedecker at ugent.be>  Sat, 24 Aug 2013 15:35:59 +0200
+
 piuparts (0.54) unstable; urgency=low
 
   [ Holger Levsen ]
diff --git a/debian/control b/debian/control
index 348a932..9d766d9 100644
--- a/debian/control
+++ b/debian/control
@@ -54,6 +54,7 @@ Depends:
  python-debianbts,
  tango-icon-theme,
  xz-utils,
+ python-yaml,
  ${misc:Depends},
  ${python:Depends}
 Recommends:
diff --git a/piuparts-report.py b/piuparts-report.py
index 34fae14..91851e7 100644
--- a/piuparts-report.py
+++ b/piuparts-report.py
@@ -35,6 +35,7 @@ import urllib
 import shutil
 import re
 import string
+import yaml
 
 # if python-rpy2 ain't installed, we don't draw fancy graphs
 try:
@@ -1078,11 +1079,19 @@ class Section:
         maintainers = {}
         source_binary_rows = {}
         sources = ""
+        sources_data = []
         for source in self._source_db.get_all_package_names():
             (sourcerows, binaryrows, source_state, maintainer, uploaders) = \
                                self.create_source_summary(source, logs_by_dir)
 
             if source_state != "udeb":
+                source_version = self._source_db.get_control_header(source, "Version")
+                source_data = {};
+                source_data["source"] = source
+                source_data["state"] = source_state
+                source_data["version"] = source_version
+                sources_data.append(source_data)
+
                 sources += "%s: %s\n" % (source, source_state)
                 source_binary_rows[source] = (source_state, sourcerows, binaryrows)
                 for maint in [maintainer] + uploaders.split(","):
@@ -1094,6 +1103,8 @@ class Section:
                             maintainers[email].append(source)
 
         write_file(os.path.join(self._output_directory, "sources.txt"), sources)
+        write_file(os.path.join(self._output_directory, "sources.yaml"),
+            yaml.dump(sources_data, default_flow_style=False))
 
         self.create_maintainer_summaries(maintainers, source_binary_rows)
 
@@ -1398,6 +1409,8 @@ def main():
 
     if os.path.exists(master_directory):
         packagedb_cache = {}
+        write_file(os.path.join(output_directory, "sections.yaml"),
+            yaml.dump(section_names, default_flow_style=False))
         for section_name in section_names:
             try:
                 section = Section(section_name, master_directory, doc_root, packagedb_cache=packagedb_cache)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/piuparts/piuparts.git



More information about the Piuparts-commits mailing list