Skip to content

Commit

Permalink
refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
kiorky committed Oct 22, 2024
1 parent 4a3af84 commit 75bf3aa
Show file tree
Hide file tree
Showing 72 changed files with 1,892 additions and 297 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,14 @@ jobs:
fail-fast: false
matrix:
IMAGES:
- "library/fedora/31 library/fedora/32 library/fedora/33 library/fedora/34 library/fedora/latest library/fedora/rawhide"
- "library/fedora/rawhide"
- "library/fedora/latest"
- "library/fedora/42 library/fedora/41"
- "library/fedora/40 library/fedora/39 library/fedora/38 library/fedora/37"
- "library/fedora/36 library/fedora/35 library/fedora/34 library/fedora/33"
- "library/fedora/32 library/fedora/31 library/fedora/30 library/fedora/29"
- "library/fedora/28 library/fedora/27 library/fedora/26 library/fedora/25"
- "library/fedora/24 library/fedora/23 library/fedora/22 library/fedora/20"
#- "corpusops/test/a corpusops/test/b corpusops/test/c"
# all images that werent explicitly told to be built would be built in the next batches
# we span them onto N jobs
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile.args
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
ARG DO_UPDATE=y
ARG NONINTERACTIVE=y
ARG DEBIAN_FRONTEND=noninteractive
ARG INSTALL_DEFAULT_LOCALE="fr_FR.UTF-8"
ARG EXTRA_FILES_LIST=""
ARG COPS_SYSTEM=${_cops_SYSTEM}
ARG COPS_SYSTEM=${_cops_SYSTEM-}
ARG FOREGO_RELEASE=latest
ARG REMCO_RELEASE=latest
ARG GOSU_RELEASE=latest
ARG DOCKERIZE_RELEASE=latest
ARG CURL_SSL_OPTS=--tlsv1
ARG DOCKER_IMAGES_COMMIT=master
ARG COPS_HELPERS=/cops_helpers
7 changes: 4 additions & 3 deletions Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ RUN sh -c 'set -ex \
&& cd /tmp/corpusopssteroids \
&& : \
&& chmod +x *sh \
&& if [ ! -e $COPS_HELPERS ];then mkdir -p "$COPS_HELPERS";fi \
&& export PATH=$(pwd):$PATH \
&& _cops_SYSTEM=$(./system_detect.sh) \
&& cat ${_cops_SYSTEM}_optional_packages*.txt optional_packages*.txt > optional_packages.txt \
Expand All @@ -16,14 +17,14 @@ RUN sh -c 'set -ex \
&& ./add_dockerize.sh \
&& ./add_gosu.sh \
&& ./add_forego.sh \
&& ln -sfv ${COPS_HELPERS}/supervisord-go /bin/supervisord-go \
&& DEBUG=1 ./setup_locales.sh \
&& sed -i -re "/var\\/log\\/messages \\{\\}/d" /etc/logrotate.conf\
&& sed -i -re "s/ dateext/nodateext/g" /etc/logrotate.conf\
&& if ! (grep -q /var/log/messages /etc/logrotate.conf);then\
printf "\\n/var/log/messages {\\nmissingok\\n}\\n\\n" >>/etc/logrotate.conf;fi\
&& cp -v bin/* system_detect.sh setup_locales.sh \
cops_pkgmgr_install.sh /bin \
&& for i in bin/* system_detect.sh setup_locales.sh cops_pkgmgr_install.sh;do j=$(basename $i);cp -v $i /cops_helpers && ln -sfv /cops_helpers/$j /bin/$j;done\
&& ./${_cops_SYSTEM}_clean.sh \
'
COPY --from=ochinchina/supervisord:latest \
/usr/local/bin/supervisord /bin/supervisord-go
/usr/local/bin/supervisord ${COPS_HELPERS}/supervisord-go
8 changes: 6 additions & 2 deletions Dockerfile.clean
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
ADD helpers/*_clean.sh /tmp/corpusopssteroids/
ADD helpers/system_detect.sh helpers/*_clean.sh /tmp/corpusopssteroids/
RUN sh -c 'set -ex \
&& echo fixperms >&2 \
&& ( chmod -vf g-wx,o-wx /etc/logrotate.d/* /etc/logrotate.conf || true ) \
&& echo cleanup >&2 \
&& cd /tmp/corpusopssteroids \
&& chmod +x *sh \
&& _cops_SYSTEM=$(./system_detect.sh) \
&& ./${_cops_SYSTEM}_clean.sh \
&& cd / && rm -rf /tmp/corpusopssteroids'
&& ./common_clean.sh \
&& cd / && rm -rf /tmp/corpusopssteroids /var/cache/apk/* /var/lib/apt/lists/*'
1 change: 1 addition & 0 deletions Dockerfile.labels
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
ARG DOCKER_IMAGES_COMMIT="$DOCKER_IMAGES_COMMIT"
LABEL com.github.corpusops.docker-images-commit="$DOCKER_IMAGES_COMMIT"
4 changes: 4 additions & 0 deletions Dockerfile.squash
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM $RSYNC AS squashed-rsync
FROM $ANCESTOR AS squashed-ancestor
ARG ROOTFS="/BASE_ROOTFS_TO_COPY_THAT_WONT_COLLIDE_1234567890"
ARG PATH="${ROOTFS}_rsync/bin:$PATH"
4 changes: 4 additions & 0 deletions Dockerfile.squashexec
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SHELL ["busybox", "sh", "-c"]
RUN --mount=type=bind,from=final,target=$ROOTFS --mount=type=bind,from=squashed-rsync,target=${ROOTFS}_rsync \
rsync -Aaz --delete ${ROOTFS}/ / --exclude=/proc --exclude=/sys --exclude=/etc/resolv.conf --exclude=/etc/hosts --exclude=$ROOTFS* --exclude=dev/shm --exclude=dev/pts --exclude=dev/mqueue
SHELL ["/bin/sh", "-c"]
2 changes: 2 additions & 0 deletions Dockerfile.squashpre
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ARG ANCESTOR=${_cops_BASE}:${_cops_VERSION}
ARG RSYNC=corpusops/rsync
7 changes: 5 additions & 2 deletions helpers/add_confd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ SDEBUG=${SDEBUG-}
GITHUB_PAT="${GITHUB_PAT:-$(echo 'OGUzNjkwMDZlMzNhYmNmMGRiNmE5Yjg1NWViMmJkNWVlNjcwYTExZg=='|base64 -d)}"
CONFD_RELEASE="${CONFD_RELEASE:-latest}"
CURL_SSL_OPTS="${CURL_SSL_OPTS:-"--tlsv1"}"
COPS_HELPERS=${COPS_HELPERS:-/cops_helpers}
do_curl() { if ! ( curl "$@" );then curl $CURL_SSL_OPTS "$@";fi; }
install() {
if [ "x${SDEBUG}" != "x" ];then set -x;fi
Expand All @@ -18,8 +19,10 @@ install() {
| grep -E -i "($(uname -s).*$arch|sha)" )" \
&& : :: confd: download and unpack artefacts \
&& for u in $urls;do do_curl -sLO $u;done \
&& mv -vf confd* /usr/bin/confd \
&& chmod +x /usr/bin/confd && cd / && rm -rf /tmp/confd
&& if [ ! -e $COPS_HELPERS ];then mkdir -p "$COPS_HELPERS";fi \
&& ln -sfv $COPS_HELPERS/confd /usr/bin \
&& mv -vf confd* $COPS_HELPERS/confd \
&& chmod +x $COPS_HELPERS/confd && cd / && rm -rf /tmp/confd
}
install;ret=$?;if [ "x$ret" != "x0" ];then SDEBUG=1 install;fi;exit $ret
# vim:set et sts=4 ts=4 tw=80:
7 changes: 5 additions & 2 deletions helpers/add_dockerize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ SDEBUG=${SDEBUG-}
GITHUB_PAT="${GITHUB_PAT:-$(echo 'OGUzNjkwMDZlMzNhYmNmMGRiNmE5Yjg1NWViMmJkNWVlNjcwYTExZg=='|base64 -d)}"
DOCKERIZE_RELEASE="${DOCKERIZE_RELEASE:-latest}"
CURL_SSL_OPTS="${CURL_SSL_OPTS:-"--tlsv1"}"
COPS_HELPERS=${COPS_HELPERS:-/cops_helpers}
do_curl() { if ! ( curl "$@" );then curl $CURL_SSL_OPTS "$@";fi; }
install() {
if [ "x${SDEBUG}" != "x" ];then set -x;fi
Expand All @@ -19,8 +20,10 @@ install() {
| grep -E -i "($(uname -s).*$arch|sha)" )" \
&& : :: dockerize: download and unpack artefacts \
&& for u in $urls;do do_curl -sLO $u && tar -xzf $(basename $u);done \
&& mv -vf dockerize /usr/bin/dockerize \
&& chmod +x /usr/bin/dockerize && cd / && rm -rf /tmp/dockerize
&& if [ ! -e $COPS_HELPERS ];then mkdir -p "$COPS_HELPERS";fi \
&& ln -sfv $COPS_HELPERS/dockerize /usr/bin \
&& mv -vf dockerize $COPS_HELPERS/dockerize \
&& chmod +x $COPS_HELPERS/dockerize && cd / && rm -rf /tmp/dockerize
}
install;ret=$?;if [ "x$ret" != "x0" ];then SDEBUG=1 install;fi;exit $ret
# vim:set et sts=4 ts=4 tw=80:
8 changes: 6 additions & 2 deletions helpers/add_forego.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ SDEBUG=${SDEBUG-}
GITHUB_PAT="${GITHUB_PAT:-$(echo 'OGUzNjkwMDZlMzNhYmNmMGRiNmE5Yjg1NWViMmJkNWVlNjcwYTExZg=='|base64 -d)}"
FOREGO_RELEASE="${FOREGO_RELEASE:-latest}"
CURL_SSL_OPTS="${CURL_SSL_OPTS:-"--tlsv1"}"
COPS_HELPERS=${COPS_HELPERS:-/cops_helpers}
do_curl() { if ! ( curl "$@" );then curl $CURL_SSL_OPTS "$@";fi; }
install () {
if [ "x${SDEBUG}" != "x" ];then set -x;fi
Expand All @@ -19,8 +20,11 @@ install () {
&& : :: forego: integrity check \
&& grep forego.gz forego.gz.sha | sha256sum -c - >/dev/null \
&& : :: forego: filesystem install \
&& gunzip forego.gz && mv -vf forego /usr/bin/forego \
&& chmod +x /usr/bin/forego && cd / && rm -rf /tmp/forego
&& gunzip forego.gz \
&& if [ ! -e $COPS_HELPERS ];then mkdir -p "$COPS_HELPERS";fi \
&& ln -sfv $COPS_HELPERS/forego /usr/bin \
&& mv -vf forego $COPS_HELPERS/forego \
&& chmod +x $COPS_HELPERS/forego && cd / && rm -rf /tmp/forego
}
install;ret=$?;if [ "x$ret" != "x0" ];then SDEBUG=1 install;fi;exit $ret
# vim:set et sts=4 ts=4 tw=80:
12 changes: 8 additions & 4 deletions helpers/add_frep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ CURL_SSL_OPTS="${CURL_SSL_OPTS:-"--tlsv1"}"
# original but does not work on alpine
PKG="corpusops/frep"
PKG="subchen/frep"
COPS_HELPERS=${COPS_HELPERS:-/cops_helpers}
do_curl() { if ! ( curl "$@" );then curl $CURL_SSL_OPTS "$@";fi; }
install() {
if [ "x${SDEBUG}" != "x" ];then set -x;fi
Expand All @@ -21,9 +22,12 @@ install() {
| grep -E -i "($(uname -s).*$arch|sha)" )" \
&& : :: frep: download and unpack artefacts \
&& for u in $urls;do do_curl -sLO $u;done \
&& sha256sum -c frep-*-linux-$arch.sha256 >/dev/nulm 2>&1 \
&& mv -vf frep*-linux*$arch /usr/bin/frep \
&& chmod +x /usr/bin/frep && cd / && rm -rf /tmp/frep
&& echo $(cat frep-*-linux-$arch.sha256|awk '{print $1}'; ls frep-*-linux-$arch )|sed "s/ / /g" > frep-*-linux-$arch.sha256.v \
&& sha256sum -wc frep-*-linux-$arch.sha256.v >/dev/null 2>&1 \
&& if [ ! -e $COPS_HELPERS ];then mkdir -p "$COPS_HELPERS";fi \
&& ln -sfv $COPS_HELPERS/frep /usr/bin \
&& mv -vf frep*-linux*$arch $COPS_HELPERS/frep \
&& chmod +x $COPS_HELPERS/frep && cd / && rm -rf /tmp/frep
}
install;ret=$?;if [ "x$ret" != "x0" ];then SDEBUG=1 install;fi;exit $ret
# vim:set et sts=4 ts=4 tw=80:
# vim:set et sts=4 ts=4 tw=0:
7 changes: 5 additions & 2 deletions helpers/add_gosu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ GOSU_RELEASE="${GOSU_RELEASE:-latest}"
CURL_SSL_OPTS="${CURL_SSL_OPTS:-"--tlsv1"}"
GOSU_GPG_KEYS="${GOSU_GPG_KEYS:-B42F6819007F00F88E364FD4036A9C25BF357DD4}"
GPG_KEYS_SERVERS="${GPG_KEYS_SERVERS:-"hkp://p80.pool.sks-keyservers.net:80 hkp://ipv4.pool.sks-keyservers.net hkp://keyserver.ubuntu.com:80 hkp://pgp.mit.edu:80"}"
COPS_HELPERS=${COPS_HELPERS:-/cops_helpers}
do_curl() { if ! ( curl "$@" );then curl $CURL_SSL_OPTS "$@";fi; }
install() {
if [ "x${SDEBUG}" != "x" ];then set -x;fi
Expand All @@ -23,8 +24,10 @@ install() {
&& : :: gosu: integrity check \
&& grep gosu-$arch SHA256SUMS | sha256sum -c - >/dev/null \
&& : :: gosu: filesystem install \
&& mv -vf gosu-$arch /usr/bin/gosu \
&& chmod +x /usr/bin/gosu && cd / && rm -rf /tmp/gosu
&& if [ ! -e $COPS_HELPERS ];then mkdir -p "$COPS_HELPERS";fi \
&& ln -sfv $COPS_HELPERS/gosu /usr/bin \
&& mv -vf gosu-$arch $COPS_HELPERS/gosu \
&& chmod +x $COPS_HELPERS/gosu && cd / && rm -rf /tmp/gosu
}
install;ret=$?;if [ "x$ret" != "x0" ];then SDEBUG=1 install;fi;exit $ret
# vim:set et sts=4 ts=4 tw=0:
1 change: 0 additions & 1 deletion helpers/add_opt_pkgs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ export FORCE_INSTALL=y
WANTED_PACKAGES="" \
WANTED_EXTRA_PACKAGES="$pkgs" \
./cops_pkgmgr_install.sh
wait
# vim:set et sts=4 ts=4 tw=0:
7 changes: 5 additions & 2 deletions helpers/add_remco.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ GITHUB_PAT="${GITHUB_PAT:-$(echo 'OGUzNjkwMDZlMzNhYmNmMGRiNmE5Yjg1NWViMmJkNWVlNj
REMCO_RELEASE="${REMCO_RELEASE:-latest}"
CURL_SSL_OPTS="${CURL_SSL_OPTS:-"--tlsv1"}"
PKG="HeavyHorst/remco"
COPS_HELPERS=${COPS_HELPERS:-/cops_helpers}
do_curl() { if ! ( curl "$@" );then curl $CURL_SSL_OPTS "$@";fi; }
install() {
if [ "x${SDEBUG}" != "x" ];then set -x;fi
Expand All @@ -20,8 +21,10 @@ install() {
&& : :: remco: download and unpack artefacts \
&& for u in $urls;do do_curl -sLO $u;done \
&& 7z x -y remco_*_linux_amd64.zip >/dev/null \
&& mv -vf remco_linux /usr/bin/remco \
&& chmod +x /usr/bin/remco && cd / && rm -rf /tmp/remco
&& if [ ! -e $COPS_HELPERS ];then mkdir -p "$COPS_HELPERS";fi \
&& ln -sfv $COPS_HELPERS/remco /usr/bin \
&& mv -vf remco_linux $COPS_HELPERS/remco \
&& chmod +x $COPS_HELPERS/remco && cd / && rm -rf /tmp/remco
}
install;ret=$?;if [ "x$ret" != "x0" ];then SDEBUG=1 install;fi;exit $ret
# vim:set et sts=4 ts=4 tw=80:
7 changes: 7 additions & 0 deletions helpers/common_clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -exo pipefail
: "cleanup packages"
rm -rf /var/cache/apk/*
# misc
find /etc/rsyslog.d -name "*.conf" -not -type d|while read f;do mv -vf "$f" "$f.sample";done
# vim:set et sts=4 ts=4 tw=80:
53 changes: 41 additions & 12 deletions helpers/cops_pkgmgr_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,17 @@ SYSTEM_COPS_ROOT=${SYSTEM_COPS_ROOT-$DEFAULT_COPS_ROOT}
DOCKER_COPS_ROOT=${DOCKER_COPS_ROOT-$SYSTEM_COPS_ROOT}
COPS_URL=${COPS_URL-$DEFAULT_COPS_URL}
BASE_PREPROVISION_IMAGES="ubuntu:latest_preprovision"
BASE_PREPROVISION_IMAGES="$BASE_PREPROVISION_IMAGES corpusops/ubuntu:24.04_preprovision"
BASE_PREPROVISION_IMAGES="$BASE_PREPROVISION_IMAGES corpusops/ubuntu:22.04_preprovision"
BASE_PREPROVISION_IMAGES="$BASE_PREPROVISION_IMAGES corpusops/ubuntu:20.04_preprovision"
BASE_PREPROVISION_IMAGES="$BASE_PREPROVISION_IMAGES corpusops/ubuntu:18.04_preprovision"
BASE_PREPROVISION_IMAGES="$BASE_PREPROVISION_IMAGES corpusops/ubuntu:16.04_preprovision"
BASE_PREPROVISION_IMAGES="$BASE_PREPROVISION_IMAGES corpusops/ubuntu:14.04_preprovision"
BASE_PREPROVISION_IMAGES="$BASE_PREPROVISION_IMAGES corpusops/centos:7_preprovision"
BASE_CORE_IMAGES="$BASE_CORE_IMAGES corpusops/ubuntu:latest"

BASE_CORE_IMAGES="$BASE_CORE_IMAGES corpusops/ubuntu:latest"
BASE_CORE_IMAGES="$BASE_CORE_IMAGES corpusops/ubuntu:24.04"
BASE_CORE_IMAGES="$BASE_CORE_IMAGES corpusops/ubuntu:22.04"
BASE_CORE_IMAGES="$BASE_CORE_IMAGES corpusops/ubuntu:20.04"
BASE_CORE_IMAGES="$BASE_CORE_IMAGES corpusops/ubuntu:18.04"
BASE_CORE_IMAGES="$BASE_CORE_IMAGES corpusops/ubuntu:16.04"
Expand All @@ -53,14 +56,18 @@ BASE_IMAGES="$BASE_PREPROVISION_IMAGES $BASE_CORE_IMAGES"
EXP_PREPROVISION_IMAGES=""
EXP_PREPROVISION_IMAGES="$EXP_PREPROVISION_IMAGES archlinux:latest_preprovision"
EXP_PREPROVISION_IMAGES="$EXP_PREPROVISION_IMAGES debian:latest_preprovision"
EXP_PREPROVISION_IMAGES="$EXP_PREPROVISION_IMAGES debian:stretch_preprovision"
#EXP_PREPROVISION_IMAGES="$EXP_PREPROVISION_IMAGES debian:stretch_preprovision"
EXP_PREPROVISION_IMAGES="$EXP_PREPROVISION_IMAGES debian:bookworm_preprovision"
EXP_PREPROVISION_IMAGES="$EXP_PREPROVISION_IMAGES debian:bullseye_preprovision"
EXP_PREPROVISION_IMAGES="$EXP_PREPROVISION_IMAGES debian:buster_preprovision"
EXP_PREPROVISION_IMAGES="$EXP_PREPROVISION_IMAGES debian:sid_preprovision"
EXP_CORE_IMAGES=""
EXP_CORE_IMAGES="$EXP_CORE_IMAGES corpusops/archlinux:latest"
EXP_CORE_IMAGES="$EXP_CORE_IMAGES corpusops/debian:latest"
EXP_CORE_IMAGES="$EXP_CORE_IMAGES corpusops/debian:stretch"
#EXP_CORE_IMAGES="$EXP_CORE_IMAGES corpusops/debian:stretch"
EXP_CORE_IMAGES="$EXP_CORE_IMAGES corpusops/debian:bullseye"
EXP_CORE_IMAGES="$EXP_CORE_IMAGES corpusops/debian:buster"
EXP_CORE_IMAGES="$EXP_CORE_IMAGES corpusops/debian:bookworm"
EXP_CORE_IMAGES="$EXP_CORE_IMAGES corpusops/debian:sid"
EXP_IMAGES="$EXP_PREPROVISION_IMAGES $EXP_CORE_IMAGES"
# ansible related
Expand All @@ -74,6 +81,14 @@ NORMAL="\\e[0;0m"
NO_COLOR=${NO_COLORS-${NO_COLORS-${NOCOLOR-${NOCOLORS-}}}}
LOGGER_NAME=${LOGGER_NAME:-corpusops_build}
ERROR_MSG="There were errors"
is_container() {
if ( grep -q container= /proc/1/environ 2>/dev/null ) \
|| ( grep -E -q 'docker|lxc' /proc/1/cgroup 2>/dev/null ) \
|| [ -e /.dockerenv ];then
return 0
fi
return 1
}
uniquify_string() {
local pattern=$1
shift
Expand Down Expand Up @@ -262,7 +277,7 @@ is_debian_like() { echo $DISTRIB_ID | grep -E -iq "debian|ubuntu|mint"; }
is_suse_like() { echo $DISTRIB_ID | grep -E -iq "suse"; }
is_alpine_like() { echo $DISTRIB_ID | grep -E -iq "alpine" || test -e /etc/alpine-release; }
is_redhat_like() { echo $DISTRIB_ID \
| grep -E -iq "((^ol$)|rhel|redhat|red-hat|centos|fedora)"; }
| grep -E -iq "((^ol$)|rhel|redhat|red-hat|centos|fedora|amzn)"; }
set_lang() { locale=${1:-C};export LANG=${locale};export LC_ALL=${locale}; }
is_darwin () {
if [ "x${FORCE_DARWIN-}" != "x" ];then return 0;fi
Expand Down Expand Up @@ -311,6 +326,10 @@ detect_os() {
if [ $DISTRIB_MAJOR -eq 7 ];then DISTRIB_CODENAME="wheezy";fi
if [ $DISTRIB_MAJOR -eq 8 ];then DISTRIB_CODENAME="jessie";fi
if [ $DISTRIB_MAJOR -eq 9 ];then DISTRIB_CODENAME="stretch";fi
if [ $DISTRIB_MAJOR -eq 10 ];then DISTRIB_CODENAME="buster";fi
if [ $DISTRIB_MAJOR -eq 11 ];then DISTRIB_CODENAME="bullseye";fi
if [ $DISTRIB_MAJOR -eq 12 ];then DISTRIB_CODENAME="bookworm";fi
if [ $DISTRIB_MAJOR -eq 13 ];then DISTRIB_CODENAME="trixie";fi
elif [ -e /etc/SuSE-brand ] || [ -e /etc/SuSE-release ];then
for i in /etc/SuSE-brand /etc/SuSE-release;do
if [ -e $i ];then
Expand Down Expand Up @@ -503,8 +522,8 @@ get_python2() {
get_python3() {
local py_ver=3
get_python_ $py_ver \
python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 \
python-3.9 python-3.8 python-3.7 python-3.6 python-3.5 python-3.4 \
python3.12 python3.11 python3.10 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 \
python-3.12 python-3.11 python-3.10 python-3.9 python-3.8 python-3.7 python-3.6 python-3.5 python-3.4 \
python-${py_ver} python${py_ver} python
}
has_python_module() {
Expand All @@ -523,9 +542,19 @@ pymod_ver() {
get_setuptools() {
local py=${1:-python}
local setuptoolsreq="setuptools"
if ( is_python2 $py );then setuptoolsreq="setuptools<=45"; else setuptoolsreq="setuptools<50"; fi
local cpyver=$($py -c "import sys;print(sys.version.split()[0])")
if ( is_python2 $py );then
setuptoolsreq="setuptools<=45"
elif ( version_lt $cpyver 3.12.0 );then
setuptoolsreq="setuptools<66"
else
setuptoolsreq="setuptools>=75"
fi
echo "$setuptoolsreq"
}
setup_setuptools_requirement() {
sed -i -re "s/^setuptools\s*(>|<|=|$)/$(get_setuptools $py)/g" requirements/python_requirements.txt
}
install_pip() {
local py="${1:-python}"
local DEFAULT_PIP_URL="https://bootstrap.pypa.io/get-pip.py"
Expand Down Expand Up @@ -745,8 +774,8 @@ ensure_command() {
### archlinux (pacman)
is_pacman_available() {
for i in $@;do
if ! ( pacman -Si $(i_y) "$i" >/devnull 2>&1 ||\
pacman -Sg $(i_y) "$i" >/devnull 2>&1; );then
if ! ( pacman -Si $(i_y) "$i" >/dev/null 2>&1 ||\
pacman -Sg $(i_y) "$i" >/dev/null 2>&1; );then
return 1
fi
done
Expand All @@ -755,7 +784,7 @@ is_pacman_available() {

is_pacman_installed() {
for i in $@;do
if ! ( pacman -Qi $(i_y) "$i" >/devnull 2>&1; ); then
if ! ( pacman -Qi $(i_y) "$i" >/dev/null 2>&1; ); then
return 1
fi
done
Expand Down Expand Up @@ -790,7 +819,7 @@ microdnf_repoquery() {
is_microdnf_available() {
pkgs="$(microdnf repoquery --available)"
for i in $@;do
if ! ( echo "$pkgs" | grep -E -iq "${i}" ; ); then
if ! ( echo "$pkgs" | grep -E -iq "^${i}" ; ); then
return 1
fi
done
Expand All @@ -799,7 +828,7 @@ is_microdnf_available() {
is_microdnf_installed() {
pkgs="$(microdnf repoquery --installed)"
for i in $@;do
if ! ( echo "$pkgs" | grep -E -iq "${i}" ; ); then
if ! ( echo "$pkgs" | grep -E -iq "^${i}" ; ); then
return 1
fi
done
Expand Down
6 changes: 4 additions & 2 deletions helpers/redhat_clean.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env bash
: "cleanup packages" \
&& yum clean all
set -ex
: "cleanup packages"
if (yum --help &> /dev/null );then yum clean all;fi
if (microdnf --help &> /dev/null );then microdnf clean all;fi
# vim:set et sts=4 ts=4 tw=80:
2 changes: 1 addition & 1 deletion helpers/setup_locales.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ if [ "x${INSTALL_DEFAULT_LOCALE}" != "x" ];then
| awk '{print tolower($0)}' \
|sed -re "s/([-_.])/\1?/g" )$" \
|head -n1)
if [[ -n "$AUTODETECTED_LOCALE" ]];then
if [ "x$AUTODETECTED_LOCALE" != "x" ];then
log "Installing autodetected locale: $AUTODETECTED_LOCALE"
INSTALL_DEFAULT_LOCALE="$AUTODETECTED_LOCALE"
fi
Expand Down
Loading

0 comments on commit 75bf3aa

Please sign in to comment.