From 053ffb197e57c477bc21c0c4aa71bb3a741cff9a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 8 Sep 2023 13:09:08 +0000 Subject: ci: updates for OpenBSD Still a work-in-progress, but OpenBSD's pkg_add/pkg_delete seem to be working somewhat. The dependency system seems to need some extra help to ensure leaf packages with their own dependencies (e.g. `xapian-bindings-perl') get uninstalled before their dependencies (`xapian-core'). Deduplicating the command-line is also required since both pkg_add and pkg_delete will repeat the installation/removal if a package is specified multiple times in the same invocation. --- ci/profiles.sh | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'ci/profiles.sh') diff --git a/ci/profiles.sh b/ci/profiles.sh index 55b998d7..04cefa15 100755 --- a/ci/profiles.sh +++ b/ci/profiles.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 2019-2021 all contributors +# Copyright (C) all contributors # License: AGPL-3.0+ # Prints OS-specific package profiles to stdout (one per line) to use @@ -7,7 +7,7 @@ # set by os-release(5) or similar ID= VERSION_ID= -case $(uname -o) in +case $(uname -o 2>/dev/null || uname -s) in GNU/Linux) for f in /etc/os-release /usr/lib/os-release do @@ -42,12 +42,22 @@ FreeBSD) echo >&2 "ID=$ID $(uname -r) too old to support"; exit 1 } + ;; +OpenBSD) + ID=openbsd + VERSION_ID=$(uname -r | cut -d . -f 1) + test "$VERSION_ID" -lt 7 && { + 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 ;; +openbsd) PKG_FMT=pkg_add ;; # unsure about name, but it's not FreeBSD `pkg' *) echo >&2 "PKG_FMT undefined for ID=$ID in $0" esac @@ -74,6 +84,15 @@ centos-7) sed "s/^/$PKG_FMT /" <