summaryrefslogtreecommitdiffstats
path: root/mkosi.clangd
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2024-11-24 23:19:01 +0100
committerDaan De Meyer <daan.j.demeyer@gmail.com>2024-11-25 00:21:10 +0100
commit0e44a351ea8a6ebb63acaa9c6663656b16499ec6 (patch)
tree6dcc5c58ed5e3ddfebf826a2cd9ddd5843456d0a /mkosi.clangd
parentVarious mkosi and integration test fixes (#35336) (diff)
downloadsystemd-0e44a351ea8a6ebb63acaa9c6663656b16499ec6.tar.xz
systemd-0e44a351ea8a6ebb63acaa9c6663656b16499ec6.zip
mkosi: Make sure mkosi.clangd always runs on the host
If the editor that invokes mkosi.clangd is a flatpak, let's make sure that mkosi is run on the host and not in the flatpak sandbox since it won't be installed there.
Diffstat (limited to 'mkosi.clangd')
-rwxr-xr-xmkosi.clangd10
1 files changed, 8 insertions, 2 deletions
diff --git a/mkosi.clangd b/mkosi.clangd
index 8e54e44f70..7cd447c4ee 100755
--- a/mkosi.clangd
+++ b/mkosi.clangd
@@ -1,12 +1,18 @@
#!/bin/bash
# SPDX-License-Identifier: LGPL-2.1-or-later
-MKOSI_CONFIG="$(mkosi --json summary | jq -r .Images[-1])"
+if command -v flatpak-spawn >/dev/null; then
+ SPAWN=(flatpak-spawn --host)
+else
+ SPAWN=()
+fi
+
+MKOSI_CONFIG="$("${SPAWN[@]}" --host mkosi --json summary | jq -r .Images[-1])"
DISTRIBUTION="$(jq -r .Distribution <<< "$MKOSI_CONFIG")"
RELEASE="$(jq -r .Release <<< "$MKOSI_CONFIG")"
ARCH="$(jq -r .Architecture <<< "$MKOSI_CONFIG")"
-exec mkosi \
+exec "${SPAWN[@]}" mkosi \
--incremental=strict \
--build-sources-ephemeral=no \
--format=none \