mirror of
https://git.launchpad.net/livecd-rootfs
synced 2025-05-07 17:02:30 +00:00
Imported 2.576
No reason for CPC update specified.
This commit is contained in:
parent
fc4dabac82
commit
92d9485e1f
10
debian/changelog
vendored
10
debian/changelog
vendored
@ -1,3 +1,13 @@
|
|||||||
|
livecd-rootfs (2.576) disco; 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.
|
||||||
|
* Running `snap-tool info <snap_name>` will now also print out the base of
|
||||||
|
the snap.
|
||||||
|
|
||||||
|
-- Tobias Koch <tobias.koch@canonical.com> Tue, 09 Apr 2019 17:33:34 +0100
|
||||||
|
|
||||||
livecd-rootfs (2.575) disco; urgency=medium
|
livecd-rootfs (2.575) disco; urgency=medium
|
||||||
|
|
||||||
[ Robert C Jennings ]
|
[ Robert C Jennings ]
|
||||||
|
36
snap-tool
36
snap-tool
@ -24,6 +24,7 @@ import getopt
|
|||||||
import hashlib
|
import hashlib
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
@ -150,6 +151,13 @@ class Snap:
|
|||||||
if self._details and not cohort_create:
|
if self._details and not cohort_create:
|
||||||
return self._details
|
return self._details
|
||||||
|
|
||||||
|
if self.is_core_snap() 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"
|
path = "/v2/snaps/refresh"
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
@ -161,7 +169,22 @@ class Snap:
|
|||||||
"name": self._name,
|
"name": self._name,
|
||||||
"channel": self._channel,
|
"channel": self._channel,
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"fields": [
|
||||||
|
"base",
|
||||||
|
"created-at",
|
||||||
|
"download",
|
||||||
|
"license",
|
||||||
|
"name",
|
||||||
|
"prices",
|
||||||
|
"publisher",
|
||||||
|
"revision",
|
||||||
|
"snap-id",
|
||||||
|
"summary",
|
||||||
|
"title",
|
||||||
|
"type",
|
||||||
|
"version",
|
||||||
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
# These are mutually exclusive.
|
# These are mutually exclusive.
|
||||||
@ -180,6 +203,12 @@ class Snap:
|
|||||||
|
|
||||||
snap_data = response_dict["results"][0]
|
snap_data = response_dict["results"][0]
|
||||||
|
|
||||||
|
# Have "base" initialized to something meaningful.
|
||||||
|
if self.is_core_snap():
|
||||||
|
snap_data["snap"]["base"] = ""
|
||||||
|
elif snap_data["snap"].get("base") is None:
|
||||||
|
snap_data["snap"]["base"] = "core"
|
||||||
|
|
||||||
# Copy the key into the snap details.
|
# Copy the key into the snap details.
|
||||||
if "cohort-key" in snap_data:
|
if "cohort-key" in snap_data:
|
||||||
snap_data["snap"]["cohort-key"] = snap_data["cohort-key"]
|
snap_data["snap"]["cohort-key"] = snap_data["cohort-key"]
|
||||||
@ -257,6 +286,9 @@ class Snap:
|
|||||||
self._assertions["account-key"] = data
|
self._assertions["account-key"] = data
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
def is_core_snap(self):
|
||||||
|
return re.match(r"^core\d*$", self._name) != None
|
||||||
|
|
||||||
def _do_assertion_request(self, path):
|
def _do_assertion_request(self, path):
|
||||||
url = self._assertion_url + path
|
url = self._assertion_url + path
|
||||||
|
|
||||||
@ -372,6 +404,7 @@ class SnapCli:
|
|||||||
name: {}
|
name: {}
|
||||||
summary: {}
|
summary: {}
|
||||||
arch: {}
|
arch: {}
|
||||||
|
base: {}
|
||||||
channel: {}
|
channel: {}
|
||||||
publisher: {}
|
publisher: {}
|
||||||
license: {}
|
license: {}
|
||||||
@ -381,6 +414,7 @@ class SnapCli:
|
|||||||
snap_name,
|
snap_name,
|
||||||
info.get("summary", ""),
|
info.get("summary", ""),
|
||||||
snap._arch,
|
snap._arch,
|
||||||
|
info.get("base"),
|
||||||
snap._channel,
|
snap._channel,
|
||||||
info.get("publisher", {}).get("display-name", ""),
|
info.get("publisher", {}).get("display-name", ""),
|
||||||
info.get("license", ""),
|
info.get("license", ""),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user