Skip to content

Commit 9bfb437

Browse files
committed
Fix CI systemd dependency detection
1 parent 0b2b17e commit 9bfb437

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,19 @@ jobs:
5656
- name: Install dependencies (for .deb)
5757
run: |
5858
. ./retry_apt_update.sh
59-
sudo apt-get update || retry_apt_get_update && \
60-
sudo apt-get install -y \
61-
build-essential debhelper devscripts fakeroot git \
62-
libpci-dev libusb-1.0-0-dev libfuse-dev pkg-config
59+
if sudo apt-get update || retry_apt_get_update; then
60+
systemd_dep="systemd"
61+
if apt-cache show systemd-dev >/dev/null 2>&1; then
62+
systemd_dep="systemd-dev"
63+
fi
64+
sudo apt-get install -y \
65+
build-essential debhelper devscripts fakeroot git \
66+
libpci-dev libusb-1.0-0-dev libfuse-dev pkg-config \
67+
"$systemd_dep"
68+
else
69+
echo "Unable to refresh apt cache"
70+
exit 1
71+
fi
6372
6473
- name: Prepare release body
6574
id: changelog
@@ -123,11 +132,15 @@ jobs:
123132
set -euo pipefail
124133
. /workspace/retry_apt_update.sh
125134
apt-get update || retry_apt_get_update
135+
systemd_dep="systemd"
136+
if apt-cache show systemd-dev >/dev/null 2>&1; then
137+
systemd_dep="systemd-dev"
138+
fi
126139
apt-get install -y \
127140
autoconf automake libtool build-essential debhelper \
128141
devscripts fakeroot gcc git libpci-dev libusb-1.0-0-dev \
129142
libfuse-dev libsystemd-dev libpci3 libusb-1.0-0 fuse \
130-
pkg-config
143+
pkg-config "$systemd_dep"
131144
git config --global --add safe.directory /workspace && \
132145
version=\$(/workspace/scripts/get-ver)
133146
sed -i \"1s/(\(.*\))/(\$version)/\" /workspace/debian/changelog

0 commit comments

Comments
 (0)