Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrappers: remove all desktop files from a snap on removal #6156

Merged
merged 7 commits into from
Nov 21, 2018

Conversation

mvo5
Copy link
Contributor

@mvo5 mvo5 commented Nov 15, 2018

When we added support for parallel installs we broke removal of
some desktop files. This was reported in LP: 1791182. The problematic
commit is 84008ef.

This PR changes the way we write and remove desktop files for parallel installs. Regular snaps will still be installed as "snap_desktop-file-name.desktop" but instances will be installed as "snap+instance_desktop-file-name.desktop" so that there is a different separator between snapName and snapInstance from the separator between instanceName and desktopFile.

@mvo5 mvo5 requested a review from bboozzoo November 15, 2018 10:41
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).
@pedronis
Copy link
Collaborator

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).

Is that an interim problem or the final functionality? that doesn't seem reasonable or I'm missing something, or snap with desktop files are not well supported to start with?

Notice that plan was in 2.37 for parallel installs not to be experimental anymore if I remember correctly?

ping @bboozzoo

@zyga
Copy link
Collaborator

zyga commented Nov 15, 2018

I, for one, would love if we handled desktop files with EnsureDirState functionality where we can easily scope the files associated with each snap and we can update them on demand (if snapd code evolves). Please consider this idea.

@mvo5
Copy link
Contributor Author

mvo5 commented Nov 15, 2018

Setting to blocked until this has more unit tests (but keen to see if all spread tests work).

@mvo5 mvo5 removed the ⛔ Blocked label Nov 16, 2018
@mvo5 mvo5 changed the title [RFC] wrappers: remove all desktop files from a snap on removal wrappers: remove all desktop files from a snap on removal Nov 16, 2018
Copy link
Collaborator

@bboozzoo bboozzoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. How do we migrate existing deskop files?

Icon=${SNAP}/meta/gui/icon.png
Terminal=true
Type=Application
Categories=Utilities;Useless;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not useless at all!

#shellcheck source=tests/lib/snaps.sh
. "$TESTSLIB/snaps.sh"
echo "Installing of a snap with a desktop file creates the desktop file"
echo "Given a snap declaring the home plug is installed"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A line too many

@mvo5
Copy link
Contributor Author

mvo5 commented Nov 19, 2018

@bboozzoo Thanks for the review! I was thinking we ignore existing desktop files. The only problematic ones are those from parallel installs, the others remain unchanged. Because parallel installs are experimental I had hoped we can get away with a forum post about the issue. However if we need to migrate we can do this and use a sub patch for this I think. I would do this as a followup if needed.

@bboozzoo
Copy link
Collaborator

Parallel installs is experimental until 2.37 so a forum post sounds good to me.

Copy link
Collaborator

@zyga zyga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -5,6 +5,6 @@ Exec=basic-desktop.echo
Icon=${SNAP}/meta/gui/icon.png
Terminal=true
Type=Application
Categories=Utilities;Useless;
Categories=Utilities;Useful;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, this is a nice upgrade :D

@@ -220,7 +235,11 @@ func AddSnapDesktopFiles(s *snap.Info) (err error) {
return err
}

installedDesktopFileName := filepath.Join(dirs.SnapDesktopFilesDir, fmt.Sprintf("%s_%s", s.InstanceName(), filepath.Base(df)))
// FIXME: don't blindly use the snap desktop filename, mangle it
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the comment.

@mvo5 mvo5 merged commit ce19584 into canonical:master Nov 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants