Skip to content

Commit

Permalink
debootstrap: fix root build if no packages are installed
Browse files Browse the repository at this point in the history
The current ebclfsa hi image does not install any packages (apart from the default ones).
Build fails, the implementation tries to unpack the non existing package_hash cache entry.
Instead the apt_hash entry has to eb unpacked
  • Loading branch information
MofX committed Feb 6, 2025
1 parent 9b10beb commit 7a31ce9
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions ebcl/tools/root/debootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,10 +489,12 @@ def build_debootstrap_image(self, name: str) -> Optional[str]:
apt_hash = self._get_apt_hash(debootstrap_hash)
package_hash = self._get_package_hash(apt_hash)

run_debootstrap = not (self._has_cache_archive(debootstrap_hash) or self._has_cache_archive(
apt_hash) or self._has_cache_archive(package_hash))
run_update = not (self._has_cache_archive(apt_hash)
or self._has_cache_archive(package_hash))
run_debootstrap = not (
self._has_cache_archive(debootstrap_hash)
or self._has_cache_archive(apt_hash)
or self._has_cache_archive(package_hash)
)
run_update = not (self._has_cache_archive(apt_hash) or self._has_cache_archive(package_hash))
run_packages = not self._has_cache_archive(package_hash)

if run_debootstrap:
Expand All @@ -504,10 +506,13 @@ def build_debootstrap_image(self, name: str) -> Optional[str]:
if not self._run_update(debootstrap_hash):
return None

if run_packages and self.config.packages:
self._extract_form_cache(apt_hash)
if not self._run_install_packages(apt_hash):
return None
if run_packages:
if self.config.packages:
self._extract_form_cache(apt_hash)
if not self._run_install_packages(apt_hash):
return None
else:
self._extract_form_cache(apt_hash)
else:
self._extract_form_cache(package_hash)

Expand Down

0 comments on commit 7a31ce9

Please sign in to comment.