[Pkg-debile-commits] [debile-slave] 28/100: nice

Sylvestre Ledru sylvestre at alioth.debian.org
Mon Aug 19 14:53:03 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 45ca7e4337ed2f57c490eb6dc41cd220a19f406e
Author: Paul Tagliamonte <tag at pault.ag>
Date:   Sun May 26 17:36:22 2013 -0400

    nice
---
 ethel/client.py |   34 +++++++++++++++++++++++++++++++---
 ethel/utils.py  |   10 ++++++++++
 2 files changed, 41 insertions(+), 3 deletions(-)

diff --git a/ethel/client.py b/ethel/client.py
index d8a03db..e835f9a 100644
--- a/ethel/client.py
+++ b/ethel/client.py
@@ -1,8 +1,12 @@
+from ethel.utils import tdir, cd, dget, upload
 from ethel.config import load
+from ethel.commands.sbuild import sbuild
 
-from storz.decompress import digest_firehose_tree
-from firehose.model import Analysis
+# from storz.decompress import digest_firehose_tree
+# from firehose.model import Analysis
 import xmlrpc.client
+import time
+import glob
 
 
 def get_proxy():
@@ -17,5 +21,29 @@ def get_proxy():
     return proxy
 
 
+def build_next():
+    proxy = get_proxy()
+    job = proxy.get_next_job('amd64')
+    url = proxy.get_dsc_url(job['package'])
+    info = proxy.get_source(job['package'])
+    dsc = "{source}_{version}.dsc".format(**info)
+    # fluxbox_1.3.5-1_amd64.changes
+    build = "{source}_{version}_{arch}.changes".format(source=info['source'],
+                                                       version=info['version'],
+                                                       arch='amd64')
+    with tdir() as where:
+        with cd(where):
+            dget(url)
+            ftbfs, out, info = sbuild(dsc, 'unstable', 'unstable-amd64')
+            upload(build, job['_id'])
+            proxy.close_job(job['_id'])
+
+
 def buildd():
-    pass
+    while True:
+        try:
+            print("next build.")
+            build_next()
+        except Exception as e:
+            print("Fallthrough. %s" % (e))
+            time.sleep(10)
diff --git a/ethel/utils.py b/ethel/utils.py
index 3615c07..8525724 100644
--- a/ethel/utils.py
+++ b/ethel/utils.py
@@ -7,6 +7,7 @@ import subprocess
 import tempfile
 import shutil
 import shlex
+import os
 
 
 @contextmanager
@@ -18,6 +19,15 @@ def tdir():
         shutil.rmtree(fp)
 
 
+ at contextmanager
+def cd(where):
+    ncwd = os.getcwd()
+    try:
+        yield os.chdir(where)
+    finally:
+        os.chdir(ncwd)
+
+
 def run_command(command, stdin=None):
     if not isinstance(command, list):
         command = shlex.split(command)

-- 
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