From d7a45d22af4ccc6cc387da78b6b72b5d1dd6c5da Mon Sep 17 00:00:00 2001 From: Olaf Meeuwissen Date: Mon, 28 Aug 2017 20:28:25 +0900 Subject: [PATCH] Replace suite name with alias in sources.list This keeps the image at the same major release even in case of later stable releases. --- bootstrap.sh | 2 +- scripts/tweak-apt-sources | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 scripts/tweak-apt-sources diff --git a/bootstrap.sh b/bootstrap.sh index 3533d5b..2bc6155 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -34,7 +34,7 @@ install -m 0755 -o root -g root scripts/* $rootfs/$bindir for script in $(ls $rootfs/$bindir); do echo "+ /$bindir/$script" - chroot $rootfs /$bindir/$script + chroot $rootfs /$bindir/$script $suite done chroot $rootfs apt-get --purge autoremove -q -y diff --git a/scripts/tweak-apt-sources b/scripts/tweak-apt-sources new file mode 100644 index 0000000..71eaa3d --- /dev/null +++ b/scripts/tweak-apt-sources @@ -0,0 +1,22 @@ +#!/bin/sh -eu +# tweak-apt-sources -- to use alias instead of suite name +# Copyright (C) 2017 Olaf Meeuwissen +# +# License: GPL-3.0+ + +DIR=/ +ETC=etc/apt +SOURCES=sources.list + +eval $(apt-config shell DIR Dir) +eval $(apt-config shell ETC Dir::Etc) +eval $(apt-config shell SOURCES Dir::Etc::sourcelist) + +cfg=$DIR$ETC$SOURCES + +suite=$1 +alias=$(cat /etc/devuan_version) + +sed -i "s/$suite/$alias/" $cfg + +rm $0