From 453bbcb4233717f8e5ad5213882582484da8b7b1 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Dec 02 2023 08:50:58 +0000 Subject: split-files: also handle conditional packages This is a bit annoying, but meh. [skip changelog] --- diff --git a/split-files.py b/split-files.py index d978886..e03484f 100644 --- a/split-files.py +++ b/split-files.py @@ -1,6 +1,7 @@ import re, sys, os, collections buildroot = sys.argv[1] +no_bootloader = '--no-bootloader' in sys.argv known_files = ''' %ghost %config(noreplace) /etc/crypttab @@ -251,6 +252,8 @@ for file in files(buildroot): 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]: + for name, o in outputs.items() + if (o.tell() == 0 and + not (no_bootloader and name in ('ukify', 'boot-unsigned'))) + ]: sys.exit(1) diff --git a/systemd.spec b/systemd.spec index a70d85e..ba7f6cb 100644 --- a/systemd.spec +++ b/systemd.spec @@ -850,7 +850,7 @@ ln -s --relative %{buildroot}%{_bindir}/kernel-install %{buildroot}%{_sbindir}/i %find_lang %{name} # Split files in build root into rpms -python3 %{SOURCE2} %buildroot +python3 %{SOURCE2} %buildroot %{!?want_bootloader:--no-bootloader} %check %if %{with tests}