Skip to content

Commit

Permalink
python: setup: arch: Make is_hetzner() work on non-Arch distros
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Chancellor <[email protected]>
  • Loading branch information
nathanchance committed Dec 10, 2024
1 parent 43eb1f8 commit b6c4447
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions python/setup/arch.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,11 @@ def installimage_adjustments(mkinitcpio_conf, conf='linux.conf', dryrun=False):


def is_hetzner():
# pacman_settings() ensures this is a permanent addition
return HETZNER_MIRROR in PACMAN_CONF.read_text(encoding='utf-8')
# While this lives in arch.py because that is the only place within setup
# where it is relevant, it might be called on any platform from fish, so
# ensure it works when /etc/pacman.conf does not exists.
# pacman_settings() ensures that HETZNER_MIRROR is a permanent addition.
return PACMAN_CONF.exists() and HETZNER_MIRROR in PACMAN_CONF.read_text(encoding='utf-8')


def pacman_install(subargs):
Expand Down

0 comments on commit b6c4447

Please sign in to comment.