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

Proposed by Konrad Zapałowicz
Status: Merged
Approved by: Simon Fels
Approved revision: 5c673076f851ee21cd960d447a101ec3a681d4ad
Merged at revision: c6b12dbf73b02899d47086875bece39841655442
Proposed branch: ~kzapalowicz/snappy-hwe-snaps/+git/tpm:fix/adopt-new-aliases
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/tpm: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+323974@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 bee4825..60aafae 100644
3--- a/snapcraft.yaml
4+++ b/snapcraft.yaml
5@@ -7,6 +7,9 @@ description: |
6 code at: https://code.launchpad.net/~snappy-hwe-team/snappy-hwe-snaps/+git/tpm
7 confinement: strict
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 tcsd:
14 command: sbin/tcsd -f -c $SNAP/etc/tcsd.conf
15diff --git a/tests/lib/utilities.sh b/tests/lib/utilities.sh
16index a9c015a..72da575 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 tpm:$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