mirror of
https://gitlab.com/kupfer/kupferbootstrap.git
synced 2025-02-22 21:25:43 -05:00
chroot/abstract: clean up
This commit is contained in:
parent
4ab3d7ade1
commit
07a8c3c79a
1 changed files with 3 additions and 2 deletions
|
@ -129,6 +129,7 @@ class Chroot(AbstractChroot):
|
|||
|
||||
def get_path(self, *joins: str) -> str:
|
||||
if joins:
|
||||
# no need to check for len(joins) > 1 because [1:] will just return []
|
||||
joins = (joins[0].lstrip('/'),) + joins[1:]
|
||||
|
||||
return os.path.join(self.path, *joins)
|
||||
|
@ -385,7 +386,6 @@ class Chroot(AbstractChroot):
|
|||
results = {}
|
||||
logging.debug('Falling back to serial installation')
|
||||
for pkg in set(packages):
|
||||
# Don't check for errors here because there might be packages that are listed as dependencies but are not available on x86_64
|
||||
results[pkg] = self.run_cmd(f'{cmd} {pkg}')
|
||||
return results
|
||||
|
||||
|
@ -410,11 +410,12 @@ def get_chroot(
|
|||
if fail_if_exists:
|
||||
raise Exception(f'chroot {name} already exists: {existing.uuid}')
|
||||
logging.debug(f"returning existing chroot {name}: {existing.uuid}")
|
||||
assert isinstance(existing, chroot_class)
|
||||
chroot = chroots[name]
|
||||
if extra_repos is not None:
|
||||
chroot.extra_repos = dict(extra_repos) # copy to new dict
|
||||
if initialize:
|
||||
chroot.initialize()
|
||||
if activate:
|
||||
chroot.activate(fail_if_active=False)
|
||||
chroot.activate()
|
||||
return chroot
|
||||
|
|
Loading…
Add table
Reference in a new issue