5 Commits

Author SHA1 Message Date
John R. Lenton
986060709a cmd/snap, tests: refactor info to unify handling of 'direct' snaps
Before this change, info's handling of 'direct' snaps (i.e. `snap info
foo.snap` and `snap info ./foo`) used a separate codepath from the
handling of locally-installed snaps and remote snaps. This led to the
output for direct snaps to diverge more than necessary from the output
of snaps that snapd knew about, as well as to some code duplication.

This change fixes that: before,
```
~$ snap info basic-desktop_1.0_all.snap
path:    "basic-desktop_1.0_all.snap"
name:    basic-desktop
summary: ""
version: 1.0 -
```
and now,
```
~$ snap info basic-desktop_1.0_all.snap
path:       "basic-desktop_1.0_all.snap"
name:       basic-desktop
summary:    ""
version:    1.0 -
build-date: today at 11:24 GMT
license:    GPL-3.0
description: |
  A basic snap with desktop apps
commands:
  - basic-desktop.echo
  - basic-desktop.echoecho
```

Furthermore, in verbose mode, this change adds errors for each of the
methods that were tried and failed, when they all failed:

```
$ snap info potato --verbose
error: treating "potato" as a path to a snap: cannot open snap: open potato: no such file or directory
error: treating "potato" as a locally-installed snap name: cannot retrieve snap "potato": snap not installed
error: treating "potato" as a snap name in the store: cannot find snap "potato": snap not found
error: no snap found for "potato"
```
2019-03-05 11:26:32 +00:00
Michael Vogt
acb5ba5d5c tests: address review feedback (thanks to mborzecki) 2018-11-19 11:06:03 +01:00
Michael Vogt
52d5aebdbe wrappers: remove all desktop files from a snap on removal
When we added support for parallel installs we broke removal of
some desktop files. This was reported in LP: 1791182. The problematic
commit is 84008e.

This PR changes the way we write and remove desktop files. One
problem here is that desktop files of a foo_instance will get
removed when "snap remove foo" happens. Given that parallel installs
are experimental this might be acceptable (or not).
2018-11-15 12:27:00 +01:00
Michael Vogt
dc1a95f77b tests: add integration for local snap licenses
Not all snaps have a "license: ..." field currently, but this
integration test ensures that we show it if we have it.
2018-01-31 17:26:50 +01:00
Federico Gimenez
4e69431704 moved snaps to lib 2016-06-22 09:28:54 +02:00