[Pkg-debile-commits] [debile-slave] 47/100: meh

Sylvestre Ledru sylvestre at alioth.debian.org
Mon Aug 19 14:53:07 UTC 2013


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

sylvestre pushed a commit to branch master
in repository debile-slave.

commit cdea20c0fb903dae84eda573d53a12509fecf903
Author: Paul Tagliamonte <tag at pault.ag>
Date:   Thu May 30 20:54:37 2013 -0400

    meh
---
 ethel/commands/__init__.py |    1 +
 ethel/commands/piuparts.py |    9 ++++++++
 ethel/daemon.py            |    1 +
 ethel/runners/piuparts.py  |   52 ++++++++++++++++++++------------------------
 4 files changed, 35 insertions(+), 28 deletions(-)

diff --git a/ethel/commands/__init__.py b/ethel/commands/__init__.py
index d1bd031..0d20b81 100644
--- a/ethel/commands/__init__.py
+++ b/ethel/commands/__init__.py
@@ -4,6 +4,7 @@ import importlib
 PLUGINS = {
     "build": "ethel.commands.build",
     "adequate": "ethel.commands.adequate",
+    "piuparts": "ethel.commands.piuparts",
 }
 
 
diff --git a/ethel/commands/piuparts.py b/ethel/commands/piuparts.py
new file mode 100644
index 0000000..2ab19e0
--- /dev/null
+++ b/ethel/commands/piuparts.py
@@ -0,0 +1,9 @@
+from ethel.runners.piuparts import piuparts
+
+
+def run(debs, package, job, firehose):
+    if any((not x.endswith(".deb") for x in debs)):
+        raise Exception("Non-deb given")
+
+    chroot_name = "{suite}-{arch}".format(**package)
+    return piuparts(chroot_name, debs, firehose)
diff --git a/ethel/daemon.py b/ethel/daemon.py
index 180b0af..39d061b 100644
--- a/ethel/daemon.py
+++ b/ethel/daemon.py
@@ -99,6 +99,7 @@ def iterate():
                     type_ = {"sources": "source",
                              "binaries": "binary"}[package['_type']]
 
+                    print("[ethel] - filing report")
                     proxy.submit_report(firehose, log, job['_id'], err)
 
 iterate()
diff --git a/ethel/runners/piuparts.py b/ethel/runners/piuparts.py
index baa1bb7..4de86e2 100644
--- a/ethel/runners/piuparts.py
+++ b/ethel/runners/piuparts.py
@@ -1,9 +1,11 @@
-from ethel.chroot import schroot, copy, scmd, get_tarball
 from ethel.utils import EthelSubprocessError
 from ethel.wrappers.piuparts import parse_piuparts
-
 from firehose.model import Issue, Message, File, Location
-from storz.wrapper import generate_analysis
+
+from schroot.chroot import SchrootCommandError
+from schroot import schroot
+
+import configparser
 
 import sys
 import os
@@ -14,49 +16,43 @@ LINE_INFO = re.compile(
     r"(?P<minutes>\d+)m(?P<sec>(\d(\.?))+)s (?P<severity>\w+): (?P<info>.*)")
 
 
-def piuparts(chroot, package):  # packages
-    analysis = generate_analysis("piuparts", "unstable", package)
-    tarball = get_tarball(chroot)
+def piuparts(chroot, packages, analysis):
+    cfg = configparser.ConfigParser()
+    if cfg.read("/etc/schroot/chroot.d/%s" % (chroot)) == []:
+        raise Exception("Shit. No such tarball")
 
-    name = os.path.basename(tarball)
-    internal_path = "/tmp/%s" % (name)
+    block = cfg[chroot]
 
-    package_name = os.path.basename(package)
-    internal_package = "/tmp/%s" % (package_name)
+    if "file" not in block:
+        raise Exception("Chroot type isn't of tarball")
 
-    with schroot(chroot) as session:
+    location = block['file']
+    copy_location = os.path.join("/tmp", os.path.basename(location))
 
-        copy(session, tarball, internal_path)
-        copy(session, package, internal_package)
+    with schroot(chroot) as chroot:
+        chroot.copy(location, copy_location)
+        for package in packages:
+            chroot.copy(package, "/tmp")
 
         print("Installing...")
-        scmd(session, [
-            'apt-get', 'install', '-y', 'piuparts'
-        ], user='root')
-
+        chroot.run(['apt-get', 'install', '-y', 'piuparts'], user='root')
         print("Piuparts installed.")
 
         failed = False
         try:
             print("Running Piuparts..")
-            out, err = scmd(session, [
+            ret, out, err = chroot.run([
                 'piuparts',
-                    '-b', internal_path,
-                    internal_package,
+                    '-b', copy_location,
+            ] + [ "/tmp/%s" % (x) for x in packages ] + [
                     '--warn-on-debsums-errors',
                     '--pedantic-purge-test',
             ], user='root')
-        except EthelSubprocessError as e:
+        except SchrootCommandError as e:
             out, err = e.out, e.err
             failed = True
 
         for x in parse_piuparts(out.splitlines(), package):
             analysis.results.append(x)
 
-        return failed, out, analysis
-
-
-def main():
-    output = open(sys.argv[3], 'wb')
-    failed, out, report = piuparts(sys.argv[1], sys.argv[2])
-    output.write(report.to_xml_bytes())
+        return out, analysis, failed

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



More information about the Pkg-debile-commits mailing list