1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
#!/usr/bin/python3
# generate dependencies for debian/control, so packages we need are not removed from testing
# this is not yet used
import pathlib
import sys
class_exclude = {
'BUSTER', # Ignore buster-specific dependencies as we're not packaged for buster.
'DEVEL',
'GCE',
'GCE_SDK',
'TIME_SYSTEMD', # chrony and systemd-timesyncd conflict
}
class_arch = {
'AMD64': 'amd64',
'ARM64': 'arm64',
'AZURE': 'amd64 arm64',
'EC2': 'amd64 arm64',
'GCE': 'amd64 arm64',
'PPC64EL': 'ppc64el',
'RISCV64': 'riscv64',
}
packages = set()
for i in pathlib.Path('../config_space/sid/package_config').glob('*'):
if '.' in i.name or i.name in class_exclude:
continue
arch = class_arch.get(i.name)
with i.open() as f:
for line in f.readlines():
line = line.strip()
# Ignore empty lines and comments
if not line or line.startswith('#'):
pass
elif line.startswith('PACKAGES'):
l = line.split()
# Ignore unknown commands
if l[1] in ('install', 'install-norec'):
classes = frozenset(l[2:])
ignore = False
# Ignore entries if all of the extra classes are excluded
if classes and not (classes - class_exclude):
ignore = True
elif not ignore:
for package in line.split():
# Ignore to be removed packages
if package.endswith('-'):
continue
# https://piuparts.debian.org/sid/fail/debian-cloud-images-packages_0.0.5.log
if package == 'init':
continue
if arch:
packages.add(f'{package} [{arch}]')
else:
packages.add(package)
print('debian-cloud-images-packages:Depends=' + ', '.join(sorted(packages)))
|