Skip to content

Commit 3c7bc8c

Browse files
committed
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".
1 parent c166b13 commit 3c7bc8c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

.github/workflows/images.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ concurrency:
77
on:
88
push:
99
branches:
10-
- master
1110
paths:
1211
- 'ci/ciimage/**'
1312
- '.github/workflows/images.yml'

ci/ciimage/build.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,13 @@ def gen_bashrc(self) -> None:
7878
if [ -f "$HOME/.cargo/env" ]; then
7979
source "$HOME/.cargo/env"
8080
fi
81-
82-
if [ -f /etc/profile.env ]; then
83-
source /etc/profile.env
84-
fi
8581
'''
8682

83+
if self.data_dir.name == 'gentoo':
84+
out_data += '''
85+
source /etc/profile
86+
'''
87+
8788
out_file.write_text(out_data, encoding='utf-8')
8889

8990
# make it executable

0 commit comments

Comments
 (0)