Skip to content

Commit cbe69cf

Browse files
committed
elbepack: cdroms: use source name of pkgs with on_src_cd attribute
Resolve the corresponding source name of the binary packages where the XML attribute on_src_cd="False" is set. Until now the binary name was used, which doesn't work when the source name differs to the binary name of the package. The forbiddenPackages list, containing the binary package names will be resolved and the corresponding source package names are stored in the forbiddenSrcPackages list which is then used for the comparison inside the add_source_pkg function. Signed-off-by: Martin Hoehn <[email protected]>
1 parent fd48f02 commit cbe69cf

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

elbepack/cdroms.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
def add_source_pkg(repo, component, cache, pkg, version, forbid):
2424
if pkg in forbid:
25+
logging.info("Ignoring source package %s", pkg)
2526
return
2627
pkg_id = f'{pkg}-{version}'
2728
try:
@@ -56,6 +57,12 @@ def mk_source_cdrom(components, codename,
5657
for component in components.keys():
5758
rfs, cache, pkg_lst = components[component]
5859
logging.info('Adding %s component', component)
60+
61+
forbiddenSrcPackages = []
62+
for name, _ in cache.get_corresponding_source_packages(forbiddenPackages):
63+
if name not in forbiddenSrcPackages:
64+
forbiddenSrcPackages.append(name)
65+
5966
rfs.mkdir_p('/var/cache/elbe/sources')
6067
repo = CdromSrcRepo(codename, init_codename,
6168
os.path.join(target, f'srcrepo-{component}'),
@@ -64,14 +71,14 @@ def mk_source_cdrom(components, codename,
6471
for pkg, version in pkg_lst:
6572
add_source_pkg(repo, component,
6673
cache, pkg, version,
67-
forbiddenPackages)
74+
forbiddenSrcPackages)
6875

6976
if component == 'main' and xml is not None:
7077
for p in xml.node('debootstrappkgs'):
7178
pkg = XMLPackage(p)
7279
srcpkgs = cache.get_corresponding_source_packages([pkg])
7380
for srcpkg, srcpkg_ver in srcpkgs:
74-
add_source_pkg(repo, component, cache, srcpkg, srcpkg_ver, forbiddenPackages)
81+
add_source_pkg(repo, component, cache, srcpkg, srcpkg_ver, forbiddenSrcPackages)
7582

7683
# elbe fetch_initvm_pkgs has downloaded all sources to
7784
# /var/cache/elbe/sources

0 commit comments

Comments
 (0)