From 0e8fc18fbde4c57742cc844a73bc280b8929b781 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Dec 02 2023 08:50:58 +0000 Subject: 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] --- diff --git a/split-files.py b/split-files.py index ad0d920..d978886 100644 --- a/split-files.py +++ b/split-files.py @@ -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)