Merge ~kzapalowicz/snappy-hwe-snaps/+git/tpm2:fix/adopt-new-aliases into ~snappy-hwe-team/snappy-hwe-snaps/+git/tpm2:master

Proposed by Konrad Zapałowicz
Status: Merged
Approved by: Simon Fels
Approved revision: b7476952465c508f16a6acf81a9fbc4f2f1f16d5
Merged at revision: 09cb4ab803218f6a6920501db07e2e18f1b6ef97
Proposed branch: ~kzapalowicz/snappy-hwe-snaps/+git/tpm2:fix/adopt-new-aliases
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/tpm2:master
Diff against target: 33 lines (+9/-1)
2 files modified
snapcraft.yaml (+3/-0)
tests/lib/utilities.sh (+6/-1)
Reviewer Review Type Date Requested Status
Simon Fels Approve
System Enablement Bot continuous-integration Approve
Review via email: mp+323981@code.launchpad.net

Description of the change

Adopt for new aliases coming with 2.25

To post a comment you must log in.
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Simon Fels (morphis) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/snapcraft.yaml b/snapcraft.yaml
2index 3013b9b..7764654 100644
3--- a/snapcraft.yaml
4+++ b/snapcraft.yaml
5@@ -8,6 +8,9 @@ description: |
6 confinement: strict
7 grade: stable
8
9+# NOTE: the alias syntax is depreciated with snapd 2.25 however it needs to
10+# stay to guarantee that all clients are updated correctly.
11+
12 apps:
13 resourcemgr:
14 command: sbin/resourcemgr
15diff --git a/tests/lib/utilities.sh b/tests/lib/utilities.sh
16index 03e29dc..0427c0d 100644
17--- a/tests/lib/utilities.sh
18+++ b/tests/lib/utilities.sh
19@@ -32,8 +32,13 @@ install_snap_under_test() {
20 snap connect ${SNAP_NAME}:${plug} core
21 done
22 # Setup all necessary aliases
23+ snapd_version=$(snap version | awk '/^snapd / {print $2; exit}')
24 for alias in $SNAP_AUTO_ALIASES ; do
25- snap alias $SNAP_NAME $alias
26+ target=$SNAP_NAME.$alias
27+ if dpkg --compare-versions $snapd_version lt 2.25 ; then
28+ target=$SNAP_NAME
29+ fi
30+ snap alias $target $alias
31 done
32 fi
33 }

Subscribers

People subscribed via source and target branches