From fc53809803cd2bc2434e312b19a18fa36776da12 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 05:50:40 +0200 Subject: Adding upstream version 256. Signed-off-by: Daniel Baumann --- .../system/mkosi.conf.d/10-arch/mkosi.prepare | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 mkosi.images/system/mkosi.conf.d/10-arch/mkosi.prepare (limited to 'mkosi.images/system/mkosi.conf.d/10-arch/mkosi.prepare') diff --git a/mkosi.images/system/mkosi.conf.d/10-arch/mkosi.prepare b/mkosi.images/system/mkosi.conf.d/10-arch/mkosi.prepare new file mode 100755 index 0000000..fd78e81 --- /dev/null +++ b/mkosi.images/system/mkosi.conf.d/10-arch/mkosi.prepare @@ -0,0 +1,29 @@ +#!/bin/bash +# SPDX-License-Identifier: LGPL-2.1-or-later +set -e + +if [ "$1" = "build" ] || ((NO_BUILD)); then + exit 0 +fi + +# shellcheck source=/dev/null +. "$BUILDROOT/usr/lib/os-release" + +if [ ! -f "pkg/$ID/PKGBUILD" ]; then + echo "PKGBUILD not found at pkg/$ID/PKGBUILD, run mkosi once with -ff to make sure the PKGBUILD is cloned" >&2 + exit 1 +fi + +# We get depends and optdepends from .SRCINFO as getting them from the PKGBUILD is rather complex. +sed --expression 's/^[ \t]*//' "pkg/$ID/.SRCINFO" | + grep --regexp '^depends =' --regexp '^optdepends =' | + sed --expression 's/^depends = //' --expression 's/^optdepends = //' --expression 's/:.*//' --expression 's/=.*//' | + xargs --delimiter '\n' mkosi-install + +# We get makedepends from the PKGBUILD as .SRCINFO can't encode conditional dependencies depending on +# whether some environment variable is set or not. +# shellcheck source=/dev/null +_systemd_UPSTREAM=1 . "pkg/$ID/PKGBUILD" + +# shellcheck disable=SC2154 +mkosi-install "${makedepends[@]}" -- cgit v1.2.3