ci: guard sources.list sed against missing file

Newer Ubuntu/Debian runners use /etc/apt/sources.list.d/ and don't have
/etc/apt/sources.list, causing the sed to fail with exit code 2.
This commit is contained in:
Graham McIntire 2026-04-29 14:34:27 -05:00
parent 0d961e887f
commit 45413095a9
3 changed files with 3 additions and 3 deletions

View file

@ -90,7 +90,7 @@ jobs:
- name: Install system dependencies
run: |
. /etc/os-release
if [ "$ID" = "debian" ]; then
if [ "$ID" = "debian" ] && [ -f /etc/apt/sources.list ]; then
sed -i 's/ main$/ main contrib non-free non-free-firmware/' /etc/apt/sources.list
fi
apt-get update

View file

@ -71,7 +71,7 @@ jobs:
- name: Install system dependencies
run: |
. /etc/os-release
if [ "$ID" = "debian" ]; then
if [ "$ID" = "debian" ] && [ -f /etc/apt/sources.list ]; then
sed -i 's/ main$/ main contrib non-free non-free-firmware/' /etc/apt/sources.list
fi
apt-get update

View file

@ -65,7 +65,7 @@ jobs:
- name: Install system dependencies
run: |
. /etc/os-release
if [ "$ID" = "debian" ]; then
if [ "$ID" = "debian" ] && [ -f /etc/apt/sources.list ]; then
sed -i 's/ main$/ main contrib non-free non-free-firmware/' /etc/apt/sources.list
fi
apt-get update