Skip to content

Commit cb9a58e

Browse files
committed
Make INPUT_EXTRA_REPOS conditional
Only create extra APT sources if any are actually given This avoids unexpectedly and unnecessarily mixing .list and .sources files which older APT versions, e.g. in Ubuntu Bionic, did not yet accept.
1 parent 77e660b commit cb9a58e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

scripts/install_build_deps

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,15 @@ fi
2424
# essential packages. It is reasonably safe to blindly assume it is installed.
2525
printf "man-db man-db/auto-update boolean false\n" | debconf-set-selections
2626

27-
if printf "%s\n" "$INPUT_EXTRA_REPOS" | grep -q '^deb'; then
28-
extra_repos_ext=.list
29-
else
30-
extra_repos_ext=.sources
27+
if [ -n "$INPUT_EXTRA_REPOS" ]; then
28+
if printf "%s\n" "$INPUT_EXTRA_REPOS" | grep -q '^deb'; then
29+
extra_repos_ext=.list
30+
else
31+
extra_repos_ext=.sources
32+
fi
33+
printf "%s\n" "$INPUT_EXTRA_REPOS" >"/etc/apt/sources.list.d/build-deb-action${extra_repos_ext}"
3134
fi
32-
printf "%s\n" "$INPUT_EXTRA_REPOS" >"/etc/apt/sources.list.d/build-deb-action${extra_repos_ext}"
35+
3336

3437
apt-get update
3538

0 commit comments

Comments
 (0)