diff --git a/debian/changelog b/debian/changelog index aafbf887..a19fc295 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +livecd-rootfs (2.573) UNRELEASED; urgency=medium + + * When the "snap-tool" script encounters a core snap it will switch to + the "stable" channel if the channel was set to "stable/ubuntu-X.X". This + ensures that core snaps always come from one canonical source. + + -- Tobias Koch Wed, 20 Mar 2019 14:33:34 +0100 + livecd-rootfs (2.572) disco; urgency=medium * Revert "subiquity: fix name of mdoules.squashfs to mount", debian-cd diff --git a/snap-tool b/snap-tool index 7f0323a5..0c964c86 100755 --- a/snap-tool +++ b/snap-tool @@ -24,6 +24,7 @@ import getopt import hashlib import json import os +import re import shutil import subprocess import sys @@ -150,6 +151,14 @@ class Snap: if self._details and not cohort_create: return self._details + if re.match(r"^core\d*$", self._name) and \ + self._channel.startswith("stable/ubuntu-"): + sys.stderr.write( + "WARNING: switching channel from '{}' to 'stable' for '{}' " + "snap.\n".format(self._channel, self._name) + ) + self._channel = "stable" + path = "/v2/snaps/refresh" data = {