diff options
author | Helmut Grohne <helmut@subdivi.de> | 2019-02-10 14:49:23 +0100 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2019-02-10 14:49:23 +0100 |
commit | 7d5267b27dc0fa24369e7dc6d3368578051a5ea2 (patch) | |
tree | db46fcfeeedec4bc6b1597f47aeba7735f49b66e | |
parent | c70ed9aa4c8664b0cb41f85469b62daab69eb3f6 (diff) | |
download | crossqa-7d5267b27dc0fa24369e7dc6d3368578051a5ea2.tar.gz |
build.py: handle the case of no satisfiable packages
-rwxr-xr-x | build.py | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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: |