Skip to content

Commit 987333f

Browse files
vegcomtwangboy
authored andcommitted
removed localls, addressed missing func install_arch_linux_stable
earlier mixup at witching hour sorry for noise
1 parent 57ffaac commit 987333f

1 file changed

Lines changed: 42 additions & 44 deletions

File tree

bootstrap-salt.sh

Lines changed: 42 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -6114,15 +6114,52 @@ install_arch_linux_onedir_deps() {
61146114

61156115
# Reuse stable deps for python-yaml etc. if you want config_salt() parity
61166116
install_arch_linux_stable_deps || return 1
6117+
return 0
6118+
}
6119+
6120+
install_arch_linux_stable() {
6121+
# Pacman does not resolve dependencies on outdated versions
6122+
# They always need to be updated
6123+
pacman -Syy --noconfirm
6124+
6125+
pacman -Su --noconfirm --needed pacman || return 1
6126+
# See https://mailman.archlinux.org/pipermail/arch-dev-public/2013-June/025043.html
6127+
# to know why we're ignoring below.
6128+
pacman -Syu --noconfirm --ignore filesystem,bash || return 1
6129+
pacman -S --noconfirm --needed bash || return 1
6130+
pacman -Su --noconfirm || return 1
6131+
# We can now resume regular salt update
6132+
# Except that this hasn't been in arch repos for years;
6133+
# so we have to build from AUR
6134+
# We use "buildgirl" because Eve demanded it.
6135+
build_user=${build_user:-buildgirl}
6136+
userdel "$build_user" || true
6137+
useradd -M -r -s /usr/bin/nologin "$build_user"
6138+
echo "$build_user ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/"$build_user"
6139+
rm -rf /tmp/yay-bin || true
61176140

6141+
git clone https://aur.archlinux.org/salt.git /tmp/yay-bin
6142+
chown -R "$build_user":"$build_user" /tmp/yay-bin
6143+
sudo -u "$build_user" env -i \
6144+
HOME=/tmp \
6145+
PATH=/usr/bin:/bin:/usr/sbin:/sbin \
6146+
MAKEFLAGS="-j$(nproc)" \
6147+
LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 \
6148+
makepkg -CcsiD /tmp/yay-bin \
6149+
--noconfirm --needed \
6150+
--noprogressbar || return 1
6151+
6152+
rm -f /etc/sudoers.d/"$build_user"
6153+
rm -rf /tmp/yay-bin
6154+
userdel "$build_user"
61186155
return 0
61196156
}
61206157

61216158
install_arch_linux_onedir() {
61226159
echodebug "install_arch_linux_onedir() entry"
61236160

6124-
local version="${ONEDIR_REV:-latest}"
6125-
local arch="x86_64"
6161+
version="${ONEDIR_REV:-latest}"
6162+
arch="x86_64"
61266163
[ "$(uname -m)" = "aarch64" ] && arch="aarch64"
61276164

61286165
# Resolve "latest" to actual version
@@ -6132,9 +6169,9 @@ install_arch_linux_onedir() {
61326169
| sed 's/"tag_name": *"v//;s/"//') || return 1
61336170
fi
61346171

6135-
local tarball="salt-${version}-onedir-linux-${arch}.tar.xz"
6136-
local url="https://github.com/saltstack/salt/releases/download/v${version}/${tarball}"
6137-
local extractdir="/tmp/salt-${version}-onedir-linux-${arch}"
6172+
tarball="salt-${version}-onedir-linux-${arch}.tar.xz"
6173+
url="https://github.com/saltstack/salt/releases/download/v${version}/${tarball}"
6174+
extractdir="/tmp/salt-${version}-onedir-linux-${arch}"
61386175

61396176
echoinfo "Downloading Salt onedir: $url"
61406177
wget -q "$url" -O "/tmp/${tarball}" || return 1
@@ -6248,45 +6285,6 @@ install_arch_linux_git_post() {
62486285
done
62496286
}
62506287

6251-
install_arch_linux_stable() {
6252-
# Pacman does not resolve dependencies on outdated versions
6253-
# They always need to be updated
6254-
pacman -Syy --noconfirm
6255-
6256-
pacman -Su --noconfirm --needed pacman || return 1
6257-
# See https://mailman.archlinux.org/pipermail/arch-dev-public/2013-June/025043.html
6258-
# to know why we're ignoring below.
6259-
pacman -Syu --noconfirm --ignore filesystem,bash || return 1
6260-
pacman -S --noconfirm --needed bash || return 1
6261-
pacman -Su --noconfirm || return 1
6262-
# We can now resume regular salt update
6263-
# Except that this hasn't been in arch repos for years;
6264-
# so we have to build from AUR
6265-
# We use "buildgirl" because Eve demanded it.
6266-
build_user=${build_user:-buildgirl}
6267-
userdel "$build_user" || true
6268-
useradd -M -r -s /usr/bin/nologin "$build_user"
6269-
echo "$build_user ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/"$build_user"
6270-
rm -rf /tmp/yay-bin || true
6271-
6272-
git clone https://aur.archlinux.org/salt.git /tmp/yay-bin
6273-
chown -R "$build_user":"$build_user" /tmp/yay-bin
6274-
sudo -u "$build_user" env -i \
6275-
HOME=/tmp \
6276-
PATH=/usr/bin:/bin:/usr/sbin:/sbin \
6277-
MAKEFLAGS="-j$(nproc)" \
6278-
LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 \
6279-
makepkg -CcsiD /tmp/yay-bin \
6280-
--noconfirm --needed \
6281-
--noprogressbar || return 1
6282-
6283-
rm -f /etc/sudoers.d/"$build_user"
6284-
rm -rf /tmp/yay-bin
6285-
userdel "$build_user"
6286-
return 0
6287-
}
6288-
6289-
62906288
install_arch_linux_restart_daemons() {
62916289
[ "$_START_DAEMONS" -eq $BS_FALSE ] && return
62926290

0 commit comments

Comments
 (0)