summaryrefslogtreecommitdiff
path: root/depcheck.py
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2020-10-08 22:13:57 +0200
committerHelmut Grohne <helmut@subdivi.de>2020-10-08 22:13:57 +0200
commitf6d219e1a4fddc0abb11b2235866d072789d1a13 (patch)
tree0711dd8948bb355093d2754d594994951647b2b6 /depcheck.py
parent3ee1cd729ef5dd6f1fcce76c4c27d7f50823b124 (diff)
downloadcrossqa-f6d219e1a4fddc0abb11b2235866d072789d1a13.tar.gz
add build architecture to schema of depcheck table
Diffstat (limited to 'depcheck.py')
-rwxr-xr-xdepcheck.py27
1 files changed, 14 insertions, 13 deletions
diff --git a/depcheck.py b/depcheck.py
index b1f7458..e3f3815 100755
--- a/depcheck.py
+++ b/depcheck.py
@@ -23,7 +23,6 @@ import requests
from common import decompress_stream, yield_lines
-BUILD_ARCH = "amd64"
PROFILES = frozenset(("cross", "nocheck"))
CPUEntry = collections.namedtuple('CPUEntry',
@@ -441,13 +440,13 @@ def update_depcheck(mirror, db, updatetime, buildarch, hostarch, state):
for source, (version, reason) in state.items()))
cur.execute("""
UPDATE depcheck SET releasetime = ?, updatetime = ?, giveback = 0
- WHERE architecture = ?""",
- (mirror.releasetime, updatetime, hostarch))
+ WHERE buildarch = ? AND hostarch = ?""",
+ (mirror.releasetime, updatetime, buildarch, hostarch))
db.commit()
-def main_docheck(mirror, architecture):
- return (architecture, check_bdsat(mirror, BUILD_ARCH, architecture))
+def main_docheck(mirror, archpair):
+ return (*archpair, check_bdsat(mirror, *archpair))
class SequentialPool:
@@ -474,20 +473,22 @@ def main():
mirror.update_release()
db = sqlite3.connect("db")
cur = db.cursor()
- cur.execute("SELECT architecture FROM depcheck WHERE releasetime < ?;",
+ cur.execute("""
+ SELECT buildarch, hostarch FROM depcheck WHERE releasetime < ?;""",
(mirror.releasetime,))
- archs = set(row[0] for row in cur.fetchall())
- if not archs:
+ archpairs = set(cur.fetchall())
+ if not archpairs:
return
- print("checking %s" % " ".join(sorted(archs)))
+ print("checking %s" %
+ ", ".join(sorted(map("%s -> %s".__mod__, archpairs))))
now = datetime.datetime.utcnow().replace(microsecond=0)
with multiprocessing.Pool() if args.parallel else SequentialPool() as pool:
docheck = functools.partial(main_docheck, mirror)
try:
- for architecture, state in pool.imap_unordered(docheck, archs):
- print("update %s" % architecture)
- update_depcheck(mirror, db, now, BUILD_ARCH, architecture,
- state)
+ for buildarch, hostarch, state in pool.imap_unordered(docheck,
+ archpairs):
+ print("update %s -> %s" % (buildarch, hostarch))
+ update_depcheck(mirror, db, now, buildarch, hostarch, state)
finally:
pool.close()
pool.join()