*)
CHR="schroot -c $CHROOT --";;
esac
- $CHR apt-get update --allow-releaseinfo-change > $TMPFILE 2>&1
+
+ # Work out a simple version number for comparisons, using the major
+ # and minor versions. Ignore the third component, as we might see
+ # things like "1.8.0~rc3"
+ APT_VER=$($CHR apt-get --version | awk \
+ '/^apt/ {
+ FULL=$2
+ split(FULL, VERS, ".")
+ printf("%d\n", VERS[1]*100 + VERS[2]*1);
+ }')
+
+ APT_OPTIONS=""
+ if [ $APT_VER -gt 105 ]; then
+ APT_OPTIONS="--allow-releaseinfo-change"
+ fi
+
+ $CHR apt-get update $APT_OPTIONS > $TMPFILE 2>&1
error=$?
if [ $error -ne 0 ] ; then
echo $CHR update failed with error $error
+apt-update (0.13) stable; urgency=low
+
+ * Work out the version of apt, and only add
+ --allow-releaseinfo-change if apt is new enough to need/support
+ it.
+
+ -- Steve McIntyre <steve@einval.com> Mon, 08 Jul 2019 13:05:40 +0100
+
apt-update (0.12) stable; urgency=low
* Add --allow-releaseinfo-change to apt-get update calls