Replace suite name with alias in sources.list

This keeps the image at the same major release even in case of later
stable releases.
This commit is contained in:
Olaf Meeuwissen 2017-08-28 20:28:25 +09:00
parent 7c5dee0139
commit d7a45d22af
2 changed files with 23 additions and 1 deletions

View File

@ -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

22
scripts/tweak-apt-sources Normal file
View File

@ -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