split-files: fail early if we split-files produces an empty output

We would fail later anyway, because rpm refuses %files with an empty filelist
file. But this is much later, after %check, so let's fail already in %install.

[skip changelog]
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2023-11-23 14:57:31 +01:00
parent 0708112d48
commit 0e8fc18fbd
1 changed files with 5 additions and 0 deletions

View File

@ -249,3 +249,8 @@ for file in files(buildroot):
suffix = '*' if '/man/' in n else ''
print(f'{prefix}{n}{suffix}', file=o)
if [print(f'ERROR: no file names were written to {o.name}')
for o in outputs.values()
if o.tell() == 0]:
sys.exit(1)