CI image builder: fix profile loading for gentoo

We need to load various environment variables from /etc/profile. We
cannot unconditionally load it, because opensuse sources env_vars and
their /etc/profile has a fatal bug in it that causes it to return
nonzero and abort under `set -e` (which is *amazing* as a thing to have
in /etc/profile specifically -- just saying).

Alas, even /etc/profile.env is not enough since Java support depends on
profile.d logic. Re-conditionalize this check to only be added to
env_vars.sh for the image named "gentoo".
pull/9611/merge
Eli Schwartz 10 months ago
parent c166b136a6
commit 3c7bc8cac3
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 1
      .github/workflows/images.yml
  2. 7
      ci/ciimage/build.py

@ -7,7 +7,6 @@ concurrency:
on: on:
push: push:
branches: branches:
- master
paths: paths:
- 'ci/ciimage/**' - 'ci/ciimage/**'
- '.github/workflows/images.yml' - '.github/workflows/images.yml'

@ -78,10 +78,11 @@ class Builder(BuilderBase):
if [ -f "$HOME/.cargo/env" ]; then if [ -f "$HOME/.cargo/env" ]; then
source "$HOME/.cargo/env" source "$HOME/.cargo/env"
fi fi
'''
if [ -f /etc/profile.env ]; then if self.data_dir.name == 'gentoo':
source /etc/profile.env out_data += '''
fi source /etc/profile
''' '''
out_file.write_text(out_data, encoding='utf-8') out_file.write_text(out_data, encoding='utf-8')

Loading…
Cancel
Save