From 243a05542994b2b39d8d2fd521be748ece734eab Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Nov 26 2024 10:08:20 +0000 Subject: Make systemd-network-generator co-owned by -udev and -networkd ... (rhbz#2328723) The files systemd-networkd-generator generates are read by udev (.link files) and by networkd (.netdev, .netdev files). We can't move it to systemd-networkd subpackage only, because that would potentially break the corner case of people having systemd-udev installed and using the generator, but not systemd-networkd. And there is no dependency from systemd-networkd to systemd-udev. I think this is correct, because networkd can be used in containers without udev. But the generator is not useful without either of those two daemons, so let's move it to make the core package a bit lighter. --- diff --git a/split-files.py b/split-files.py index 51400fd..b08c2bd 100644 --- a/split-files.py +++ b/split-files.py @@ -154,6 +154,9 @@ for file in files(buildroot): and os.path.exists(f'./{n}.example')): o = outputs['networkd-defaults'] + # Files that are "consumed" by systemd-networkd go into the -networkd + # subpackage. As a special case, network-generator is co-owned also by + # the -udev subpackage because systemd-udevd reads .link files. elif re.search(r'''/usr/lib/systemd/network/.*\.network| networkd| networkctl| @@ -164,6 +167,8 @@ for file in files(buildroot): systemd\.netdev ''', n, re.X): o = outputs['networkd'] + elif 'network-generator' in n: + o = (outputs['networkd'], outputs['udev']) elif '.so.' in n: o = outputs['libs'] @@ -255,7 +260,10 @@ for file in files(buildroot): suffix = '*' if '/man/' in n else '' - print(f'{prefix}{n}{suffix}', file=o) + if not isinstance(o, tuple): + o = (o,) + for file in o: + print(f'{prefix}{n}{suffix}', file=file) if [print(f'ERROR: no file names were written to {o.name}') for name, o in outputs.items()