add build architecture to schema of building table
authorHelmut Grohne <helmut@subdivi.de>
Wed, 7 Oct 2020 16:02:42 +0000 (18:02 +0200)
committerHelmut Grohne <helmut@subdivi.de>
Wed, 7 Oct 2020 16:02:42 +0000 (18:02 +0200)
build.py
schema.sql

index e7eea33..e095db2 100755 (executable)
--- a/build.py
+++ b/build.py
@@ -63,7 +63,8 @@ def main():
                 WHERE d.satisfiable = 1 AND depcheck.giveback = 0
                     AND NOT EXISTS (SELECT 1 FROM building
                         WHERE d.source = building.source
-                            OR d.architecture = building.architecture)
+                            OR ('amd64' = building.buildarch AND
+                                d.architecture = building.hostarch)
                 ORDER BY r.priority DESC, r.requesttime ASC, random()
                 LIMIT 1;""")
         row = cur.fetchone()
@@ -81,9 +82,9 @@ def main():
             time.sleep(60)
             return
         source, version, architecture, requestid = row
-        cur.execute("""INSERT INTO building (source, architecture, pid)
-                           VALUES (?, ?, ?);""",
-                    (source, architecture, os.getpid()))
+        cur.execute("""INSERT INTO building (source, buildarch, hostarch, pid)
+                           VALUES (?, ?, ?, ?);""",
+                    (source, 'amd64', architecture, os.getpid()))
         cur.execute("COMMIT;")
     try:
         print("building %s_%s for %s%s" %
index 3569eac..872b7db 100644 (file)
@@ -50,5 +50,6 @@ CREATE INDEX bugs_affects_index ON bugs(affects);
 
 CREATE TABLE building (
        source TEXT NOT NULL,
-       architecture TEXT NOT NULL,
+       buildarch TEXT NOT NULL,
+       hostarch TEXT NOT NULL,
        pid INTEGER NOT NULL);