Closed alexispurslane closed 1 month ago
Thanks for the contribution.
I think that uninstall
is not needed right now, as just removing the extension from install
entry will remove it from the image.
For the base images which ship extensions that user wants to remove, they are always shipped in RPM format at this moment, so user can simply use rpm-ostree
module to remove it.
But if users would base on images which use gnome-extensions
module in the future, than some uninstall
step is necessary if user desires.
There are some issues with the PR, so I will review the problematic code one by one.
But if users would base on images which use
gnome-extensions
module in the future, than someuninstall
step is necessary if user desires.
This is precisely the use-case I had in mind. Also, symmetry helps with making these things intuitive imo.
There are some issues with the PR, so I will review the problematic code one by one.
i wasn't able to test it so I'm not surprised, ill happily make whatever changes are necessary!
i wasn't able to test it so I'm not surprised, ill happily make whatever changes are necessary!
Testing can be done with the source:
keyword in modules, if you get the builds running in your fork.
Good idea to make uninstallation step more reliable is to read metadata.json
from already installed extension & than gather the information from following JSON keys:
gettext-domain
(not available if there's no additional languages)settings-schema
(not always available)YAML array key for uninstallation in recipe could be manually supplied extension UUID (which is also available in metadata.json). We would need to instruct the users on how to get those.
So when UUID is supplied, those steps are happening:
gettext-domain
& settings-schema
JSON key is read from the supplied extension UUID folder in
/usr/share/gnome-shell/extensions/"$UUID"/metadata.json
gettext-domain
exists, than delete all .mo files with that name from /usr/share/locale/
Location example of serbian extension language /usr/share/locale/sr/LC_MESSAGES/"$gettext-domain".mo
If it doesn't exist, than simply skip that step, as that means that extension doesn't have additional languages.settings-schema
exists, than delete the following file /usr/share/glib-2.0/schemas/"$settings-shema".gschema.xml
If it doesn't exist, than we can substract the 1st part of the UUID before @ symbol. Let's call that "$UUID-base" string.
Than test & delete that file from
/usr/share/glib-2.0/schemas/org.gnome.shell.extensions."$UUID-base".gschema.xml
If the file doesn't exist, that means that extension doesn't have any settings, so just skip the step./usr/share/gnome-shell/extensions/"$UUID"
glib-compile-schemas /usr/share/glib-2.0/schemas
Voila, that's it.
Thanks to the tight standardization of Gnome extensions, it is possible to reliably remove them.
Note in README that uninstallation should be used only when extension is installed through gnome-extensions
module in the base image.
Otherwise, uninstallation through system package manager is preferred, to assure clean uninstallation.
If you wish, I can start work on this instead of you, in case you find working on this PR overwhelming.
If you wish, I can start work on this instead of you, in case you find working on this PR overwhelming.
Sorry! I do mean to get around to it, but I have to juggle a disability, a part time job, and a game engine project, so it might be a bit.
Hello @alexispurslane, I have great news.
With the gnome-extensions
rewrite that is merged yesterday, there is no need for this PR anymore!
Along with support for uninstalling gnome-extensions
, config is much clearer with literal name of extensions as a module entry format & latest compatible extension version is always downloaded, taking into account the current Gnome version of the image.
What the title says; create an
uninstall
list as well as an install one.