diff options
author | Eric Wong <e@80x24.org> | 2019-05-07 09:09:54 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-05-09 03:06:36 +0000 |
commit | 364398b5cec0de55de30ab26ea9b71fe4160f37d (patch) | |
tree | c4e1f35442e08da36de298fabe299126bda37ed9 /ci/profiles.sh | |
parent | 441a1bc6292c9286adc591ef71e307c5d9f8e274 (diff) | |
download | public-inbox-ci-WIP.tar.gz |
This should make it easier to test a bunch of package installation profiles across whatever OS isolation one chooses (chroots, containers, jails, VMs)
Diffstat (limited to 'ci/profiles.sh')
-rwxr-xr-x | ci/profiles.sh | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/ci/profiles.sh b/ci/profiles.sh new file mode 100755 index 00000000..f5638dad --- /dev/null +++ b/ci/profiles.sh @@ -0,0 +1,58 @@ +#!/bin/sh +# Copyright (C) 2019 all contributors <meta@public-inbox.org> +# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt> + +# Prints OS-specific package profiles to stdout (one per-newline) to use +# as command-line args for ci/deps.perl. Called automatically by ci/run.sh + +# set by os-release(5) or similar +ID= VERSION_ID= +case $(uname -o) in +GNU/Linux) + for f in /etc/os-release /usr/lib/os-release + do + test -f $f || continue + . $f + case $ID--$VERSION_ID in + -|*--|--*) continue ;; + *--*) break ;; + esac + done + ;; +FreeBSD) + ID=freebsd + VERSION_ID=$(uname -r | cut -d . -f 1) + test "$VERSION_ID" -lt 11 && { + echo >&2 "ID=$ID $(uname -r) too old to support"; + exit 1 + } +esac + +case $ID in +freebsd) PKG_FMT=pkg ;; +debian|ubuntu) PKG_FMT=deb ;; +centos|redhat|fedora) PKG_FMT=rpm ;; +*) echo >&2 "PKG_FMT undefined for ID=$ID in $0" +esac + +case $ID-$VERSION_ID in +freebsd-11) sed "s/^/$PKG_FMT /" <<EOF +all devtest- +all devtest IO::KQueue- +all IO::KQueue +v2essential +v2common +essential +essential devtest- +EOF + ;; +debian-9|debian-10) sed "s/^/$PKG_FMT /" <<EOF +all devtest- +all devtest +v2essential +v2common +essential +essential devtest- +EOF + ;; +esac |