[projects/pld-ftp-admin] pfa-mvpkg, pfa-testmvpkg: refuse a build whose rpms have not arrived
arekm
arekm at pld-linux.org
Thu Nov 12 00:28:26 CET 2026
commit 13d447ba9e20095a66bdf9b1ea8dd759be551727
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Wed Nov 11 22:48:43 2026 +0100
pfa-mvpkg, pfa-testmvpkg: refuse a build whose rpms have not arrived
A builder marks its build done in the queue before it sends the rpms,
and pfa-from-incoming takes them into the tree only later. A package
moved in between goes without that arch: when the destination has no
version of it, only a "not built for archs" warning shows, and
pfa-from-incoming never takes the late rpms, as their package is no
longer in its tree.
The build check now also refuses a package with no files for an arch
whose builder reports the build done, by the batches of the request
that build the package's src.rpm; two batches may build the same one.
A noarch only package is left out: its rpms are kept from one arch
only, so the tree cannot show which arrived.
modules/ftptree.py | 31 ++++++++++++++++++++++---------
1 file changed, 22 insertions(+), 9 deletions(-)
---
diff --git a/modules/ftptree.py b/modules/ftptree.py
index ae4ab82..a9f006e 100644
--- a/modules/ftptree.py
+++ b/modules/ftptree.py
@@ -432,7 +432,7 @@ class FtpTree(BaseFtpTree):
def __checkbuild(self, marked):
"""
- Checks queue file if all arches are built
+ Checks queue file if all arches are built, and their files are in the tree
Reads config.builderqueue to grab the info
"""
@@ -442,21 +442,34 @@ class FtpTree(BaseFtpTree):
pwarning(f"Unable to open: {config.builderqueue} {e}")
return
+ # request id -> (src.rpm, builder -> status) of each of its batches; two batches may build one src.rpm
requests = {}
reid = re.compile(r'^.*id=(.*) pri.*$')
- regb = re.compile(r'^group:.*$|builders:.*$', re.MULTILINE)
- for i in re.findall(regb, f.read().decode('utf-8')):
- if i[0] == 'g':
- id = reid.sub(r'\1', i)
- requests[id] = ""
- elif i[0]=='b':
- requests[id] = requests[id] + i
+ for line in f.read().decode('utf-8').splitlines():
+ key, _, value = line.strip().partition(':')
+ if key == 'group':
+ batches = requests[reid.sub(r'\1', value)] = []
+ elif key == 'batch':
+ srpm = value.strip().split('/')[0]
+ elif key == 'builders':
+ batches.append((srpm, dict(b.rsplit(':', 1) for b in value.split())))
f.close()
for pkg in marked:
for bid in pkg.build:
- if bid in requests and '?' in requests[bid]:
+ batches = requests.get(bid, [])
+ if any('?' in s for _, status in batches for s in status.values()):
pkg.error(f"(buildid {bid}) building not finished")
+ continue
+ # a builder reports a build done before it sends the rpms; the rpms of a noarch
+ # only package are kept from one arch, so no arch of it shows which arrived
+ if 'noarch' in pkg.files and not any(arch in pkg.files for arch in config.ftp_archs):
+ continue
+ built = [status for srpm, status in batches if srpm == f'{pkg.nvr}.src.rpm']
+ for arch in config.ftp_archs:
+ builder = f'{config.ftp_dist}-{arch}'
+ if arch not in pkg.files and any(status.get(builder, '').startswith('OK') for status in built):
+ pkg.error(f"(buildid {bid}) built on {builder}, its files are not here yet")
def __checkarchs(self, dsttree, marked):
"""
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/pld-ftp-admin.git/commitdiff/f0f51b4f65cdffd92042e4d10e359be0a751e080
More information about the pld-cvs-commit
mailing list