-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
130 lines (93 loc) · 3.98 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
ifacetool provides tooling to work with snap interfaces, in
particular their policies as realized via snap-declarations.
One central feature of ifacetool is simulating what snapd will
do in terms of auto-connections for a group of snaps given snap
metadata and snap-declaration content.
Installation
=============
snap install --beta ifacetool
To operate ifacetool needs to retrieve information from the store, it
can do so using `snapcraft login` credentials. These can be made
available by:
* snap connect ifacetool:password-manager-service OR
* setting SNAPCRAFT_STORE_CREDENTIALS as per https://forum.snapcraft.io/t/snapcraft-authentication-options
Commands
=========
fetch
------
ifacetool fetch [--no-decls] [--no-meta] <snap-name>[@rev]...
fetch fetches snap metadata (at the given optional revisions) and snap
declaration content for a set of snaps.
For each snap it creates directories in the current working dir that
look like this:
<snap-name>/
.snap.json
revision
snap.yaml
plugs.json
slots.json
snap.yaml is the snap metadata, while plugs/slots.json are the content
of the snap declaration interface rule stanzas.
These directories named after the snaps are the input for all other
commands, they also allow to apply tentative modifications to the
metadata or the snap-declaration rules to test.
For convenience <snap-name> can also be a path pointing to a .snap file or
directly to a local snap.yaml file. The file extension is used to detect this
usage. Snap metadata will then come from those local sources. The snap overall
still needs to exist in the store for its snap-id etc.
auto-connections
-----------------
ifacetool auto-connections [--classic] [--store <store-id>] [--model <brand>/<model>] [-i|--interface <interface>] [--candidates] <target-snap> [<context snap>...]
auto-connections using the input from the corresponding snap directories (see fetch) does two things:
* checks whether all snaps mentioned on the command line can be installed
according to the rules
* simulates which auto-connections would be established when installing
target-snap, assuming the presence of the listed context snaps, and prints
the auto-connecting slot/plug pairs
The output report has two corresponding parts:
* installation report
* auto-connections reported with lines of the form:
other-snap:plug < target-snap-slot
other-snap:slot > target-snap-plug
: target-snap-plug for any plug that is still left unconnected
this part can be filtered to only show connections and plugs for a given
interface using -i|--interface <interface>
--candidates enables listing of candidates that were considered in the case were there was auto-connections but multiple candidates were in play or in the case that no auto-connection was established. For each candidate the result of checking whether it is allowed is displayed:
* `=> ok` allowed
* `=> ok slots-per-plug:*` allowed with `slots-per-plug: *`
* `=> <error>` not allowed with error
* `=> //` same error as the previous candidate
The notation `{<label>: <value>}` displays the label attribute usually
considered to allow auto-connection of interfaces like content, etc...
--store and --model values are used when processing on-store/on-model/on-brand
constraints in the rules.
--classic requests to simulate the behavior as on a classic system, the default is an Ubuntu Core system.
Changelog
==========
0.6
---
* support --candidates for further debugging
* based/for snapd 2.57.5+
0.5.1
------
* switch to craft-store 2.3.0 to enable final snapcraft v7 exported auth
0.5
----
* support filtering by interface with -i|--interface
* support --classic
0.4
----
* refined auto-connections output
* fetch now supports taking metadata from local .snap/.yaml files
* clarify license
Ideas
======
review-tools at tag for snap.yaml
can-install snap
can-connect snap-plug snap-slot
allow-installation slot-or-plug
allow-auto-connection plugs and/or slot
allow-connection plug and/or slot
explain snap-name
explain/lint snap-name
[attr matching code]