From 0beae6436784db12cddc4130d84edc24f8b9d59e Mon Sep 17 00:00:00 2001 From: Ed Morley <501702+edmorley@users.noreply.github.com> Date: Mon, 10 Jun 2019 18:02:09 +0100 Subject: [PATCH 1/2] Prevent APT using source lists from /etc/apt/sources.list.d/ Previously the buildpack only passed `-o dir::etc::sourcelist` to APT, which meant that APT still used the default `sourceparts` location of `/etc/apt/sources.list.d/`. This meant on cedar-14 this buildpack would use esm.ubuntu.com as an APT source (as of heroku/stack-images/pull/140), which results in errors if the requested packages happened to have ESM-only updates available (since the ESM repository requires credentials since it's a paid Ubuntu offering). Fixes #45 / W-6224944. --- bin/compile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index c3fd679..fd8c1fd 100755 --- a/bin/compile +++ b/bin/compile @@ -54,7 +54,8 @@ else fi APT_OPTIONS="-o debug::nolocking=true -o dir::cache=$APT_CACHE_DIR -o dir::state=$APT_STATE_DIR" -APT_OPTIONS="$APT_OPTIONS -o dir::etc::sourcelist=$APT_SOURCES" +# Override the use of /etc/apt/sources.list (sourcelist) and /etc/apt/sources.list.d/* (sourceparts). +APT_OPTIONS="$APT_OPTIONS -o dir::etc::sourcelist=$APT_SOURCES -o dir::etc::sourceparts=-" topic "Updating apt caches" apt-get $APT_OPTIONS update | indent From 723318efb95c52f593e792f7ceacd92667e68202 Mon Sep 17 00:00:00 2001 From: Ed Morley <501702+edmorley@users.noreply.github.com> Date: Mon, 10 Jun 2019 20:19:01 +0100 Subject: [PATCH 2/2] Use /dev/null instead Since whilst `-` appears to work, `/dev/null` is what is referenced here: https://salsa.debian.org/apt-team/apt/blob/f15e090301e0744471d0fbf86ea0d494f6c08215/apt-pkg/sourcelist.cc#L313 --- bin/compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index fd8c1fd..037dfe0 100755 --- a/bin/compile +++ b/bin/compile @@ -55,7 +55,7 @@ fi APT_OPTIONS="-o debug::nolocking=true -o dir::cache=$APT_CACHE_DIR -o dir::state=$APT_STATE_DIR" # Override the use of /etc/apt/sources.list (sourcelist) and /etc/apt/sources.list.d/* (sourceparts). -APT_OPTIONS="$APT_OPTIONS -o dir::etc::sourcelist=$APT_SOURCES -o dir::etc::sourceparts=-" +APT_OPTIONS="$APT_OPTIONS -o dir::etc::sourcelist=$APT_SOURCES -o dir::etc::sourceparts=/dev/null" topic "Updating apt caches" apt-get $APT_OPTIONS update | indent