Skip to content

Commit

Permalink
Merge pull request #12 from AkihiroSuda/dev
Browse files Browse the repository at this point in the history
Allow setting KEEP_CACHE=0
  • Loading branch information
AkihiroSuda authored Jan 13, 2024
2 parents 1ddc967 + 9fb3fce commit 3748a0d
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -38,6 +38,7 @@ Examples:
| `WRITE_SOURCE_DATE_EPOCH` | Write the `SOURCE_DATE_EPOCH` value to a file | `/dev/null` |
| `SNAPSHOT_ARCHIVE_BASE` | Base URL of the snapshot | `http://snapshot-cloudflare.debian.org/archive/`, etc. (See below) |
| `BACKPORTS` | Enable Debian backports | `0` |
| `KEEP_CACHE` | Keep apt cache | `1` |

Distribution-specific default values:

6 changes: 4 additions & 2 deletions repro-sources-list.sh
Original file line number Diff line number Diff line change
@@ -34,6 +34,8 @@ set -eux -o pipefail

. /etc/os-release

: "${KEEP_CACHE:=1}"

keep_apt_cache() {
rm -f /etc/apt/apt.conf.d/docker-clean
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' >/etc/apt/apt.conf.d/keep-cache
@@ -59,7 +61,7 @@ case "${ID}" in
echo "deb [check-valid-until=no] ${SNAPSHOT_ARCHIVE_BASE}debian-security/${snapshot} ${VERSION_CODENAME}-security main" >>/etc/apt/sources.list
echo "deb [check-valid-until=no] ${SNAPSHOT_ARCHIVE_BASE}debian/${snapshot} ${VERSION_CODENAME}-updates main" >>/etc/apt/sources.list
if [ "${BACKPORTS}" = 1 ]; then echo "deb [check-valid-until=no] ${SNAPSHOT_ARCHIVE_BASE}debian/${snapshot} ${VERSION_CODENAME}-backports main" >>/etc/apt/sources.list; fi
keep_apt_cache
if [ "${KEEP_CACHE}" = 1 ]; then keep_apt_cache; fi
;;
"ubuntu")
: "${SNAPSHOT_ARCHIVE_BASE:=http://snapshot.ubuntu.com/}"
@@ -75,7 +77,7 @@ case "${ID}" in
echo "deb [check-valid-until=no] ${SNAPSHOT_ARCHIVE_BASE}ubuntu/${snapshot} ${VERSION_CODENAME}-security main restricted" >>/etc/apt/sources.list
echo "deb [check-valid-until=no] ${SNAPSHOT_ARCHIVE_BASE}ubuntu/${snapshot} ${VERSION_CODENAME}-security universe" >>/etc/apt/sources.list
echo "deb [check-valid-until=no] ${SNAPSHOT_ARCHIVE_BASE}ubuntu/${snapshot} ${VERSION_CODENAME}-security multiverse" >>/etc/apt/sources.list
keep_apt_cache
if [ "${KEEP_CACHE}" = 1 ]; then keep_apt_cache; fi
# http://snapshot.ubuntu.com is redirected to https, so we have to install ca-certificates
export DEBIAN_FRONTEND=noninteractive
apt-get -o Acquire::https::Verify-Peer=false update >&2

0 comments on commit 3748a0d

Please sign in to comment.