Installing yaru should try to remove the communitheme snap

Bug #1792604 reported by Olivier Tilloy
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
yaru-theme (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I upgraded my laptop from bionic to cosmic, and noticed that the communitheme snap remained installed, despite being useless on !bionic.

I suggest the yaru-theme-gtk's postinst script should try and remove the communitheme snap if it's present.

Assuming yaru is present only in cosmic and later, and will never be backported to an earlier stable release, this would effectively mean a transparent transition from communitheme to yaru for anyone upgrading from bionic.

ProblemType: Bug
DistroRelease: Ubuntu 18.10
Package: yaru-theme-gtk 18.10.4
ProcVersionSignature: Ubuntu 4.18.0-7.8-generic 4.18.5
Uname: Linux 4.18.0-7-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair
ApportVersion: 2.20.10-0ubuntu9
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Fri Sep 14 17:29:00 2018
EcryptfsInUse: Yes
InstallationDate: Installed on 2016-07-02 (803 days ago)
InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.1)
PackageArchitecture: all
SourcePackage: yaru-theme
UpgradeStatus: Upgraded to cosmic on 2018-09-14 (0 days ago)

Revision history for this message
Olivier Tilloy (osomon) wrote :
Revision history for this message
Olivier Tilloy (osomon) wrote :

This would need to happen on new installs of yaru-theme-gtk only, not updates.

The removal should be attempted, but failure to do so for whatever reason (does snapd need network access to remove an installed snap?) should be gracefully ignored.

Revision history for this message
Olivier Tilloy (osomon) wrote :

lxd has some logic in the deb package to install the snap in its preinst script (sort of the opposite of what we're trying to achieve here), this can be interesting: https://github.com/lxc/lxd-pkg-ubuntu/blob/dpm-cosmic/debian/lxd.preinst

Revision history for this message
Olivier Tilloy (osomon) wrote :

The following should do the trick (will require thorough testing):

$ cat debian/yaru-theme-gtk.postinst
#!/bin/sh

set -e

# When first installing yaru-theme-gtk (i.e. when upgrading from bionic),
# remove the communitheme snap if present (https://launchpad.net/bugs/1792604).
if [ "$1" = configure -a -z "$2" ]; then
  snap remove communitheme || true
fi

#DEBHELPER#

Olivier Tilloy (osomon)
Changed in yaru-theme (Ubuntu):
assignee: nobody → Olivier Tilloy (osomon)
status: New → In Progress
Revision history for this message
Olivier Tilloy (osomon) wrote :

Tested this in a PPA, and it works as expected. One minor issue is that when uninstalling the communitheme snap while the theme is in use, icons in the dock change on the fly, and that doesn't look great. That would happen only during upgrade from bionic and to users actually using the communitheme session, so that's probably acceptable, but we can reduce the impact further by having the snap removed in the dist-upgrader code at the very end of the upgrade process (when unused debs are being removed).

And the session files (/usr/share/xsessions/ubuntu-communitheme-snap.desktop and /usr/share/wayland-sessions/ubuntu-communitheme-snap-wayland.desktop) installed by ubuntu-session should move to a separate binary package and be removed when upgrading.

Changed in yaru-theme (Ubuntu):
status: In Progress → Confirmed
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

As we discussed, I'm working on the immediate issue: moving to a separate binary package.
This is done on https://bugs.launchpad.net/ubuntu/+source/gnome-session/+bug/1794024

Olivier Tilloy (osomon)
Changed in yaru-theme (Ubuntu):
assignee: Olivier Tilloy (osomon) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.