Skip to content

Commit

Permalink
elbepack: cdroms: use source name of pkgs with on_src_cd attribute
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
martin-29 committed Nov 8, 2024
1 parent fd48f02 commit 6ca1810
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions elbepack/cdroms.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

def add_source_pkg(repo, component, cache, pkg, version, forbid):
if pkg in forbid:
logging.info("Ignoring source package %s", pkg)
return
pkg_id = f'{pkg}-{version}'
try:
Expand Down Expand Up @@ -56,6 +57,12 @@ def mk_source_cdrom(components, codename,
for component in components.keys():
rfs, cache, pkg_lst = components[component]
logging.info('Adding %s component', component)

forbiddenSrcPackages = []
for name, _ in cache.get_corresponding_source_packages(forbiddenPackages):
if name not in forbiddenSrcPackages:
forbiddenSrcPackages.append(name)

rfs.mkdir_p('/var/cache/elbe/sources')
repo = CdromSrcRepo(codename, init_codename,
os.path.join(target, f'srcrepo-{component}'),
Expand All @@ -64,14 +71,14 @@ def mk_source_cdrom(components, codename,
for pkg, version in pkg_lst:
add_source_pkg(repo, component,
cache, pkg, version,
forbiddenPackages)
forbiddenSrcPackages)

if component == 'main' and xml is not None:
for p in xml.node('debootstrappkgs'):
pkg = XMLPackage(p)
srcpkgs = cache.get_corresponding_source_packages([pkg])
for srcpkg, srcpkg_ver in srcpkgs:
add_source_pkg(repo, component, cache, srcpkg, srcpkg_ver, forbiddenPackages)
add_source_pkg(repo, component, cache, srcpkg, srcpkg_ver, forbiddenSrcPackages)

# elbe fetch_initvm_pkgs has downloaded all sources to
# /var/cache/elbe/sources
Expand Down

0 comments on commit 6ca1810

Please sign in to comment.