summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2019-02-10 14:49:23 +0100
committerHelmut Grohne <helmut@subdivi.de>2019-02-10 14:49:23 +0100
commit7d5267b27dc0fa24369e7dc6d3368578051a5ea2 (patch)
treedb46fcfeeedec4bc6b1597f47aeba7735f49b66e
parentc70ed9aa4c8664b0cb41f85469b62daab69eb3f6 (diff)
downloadcrossqa-7d5267b27dc0fa24369e7dc6d3368578051a5ea2.tar.gz
build.py: handle the case of no satisfiable packages
-rwxr-xr-xbuild.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/build.py b/build.py
index 37a585a..ca04796 100755
--- a/build.py
+++ b/build.py
@@ -7,6 +7,7 @@ import lzma
import os.path
import sqlite3
import subprocess
+import time
from common import decompress_stream, yield_lines, yield_chunks
@@ -39,7 +40,12 @@ def main():
db = sqlite3.connect("db", detect_types=sqlite3.PARSE_DECLTYPES)
with contextlib.closing(db.cursor()) as cur:
cur.execute("SELECT source, version, depstate.architecture FROM depstate JOIN depcheck ON depstate.architecture = depcheck.architecture WHERE satisfiable = 1 AND giveback = 0 ORDER BY random() LIMIT 1;")
- source, version, architecture = cur.fetchone()
+ row = cur.fetchone()
+ if not row:
+ print("no package satisfiable")
+ time.sleep(60)
+ return
+ source, version, architecture = row
print("building %s_%s for %s" % (source, version, architecture))
timestamp, success, filename, giveback = do_build(source, version, architecture)
with contextlib.closing(db.cursor()) as cur: