Hey,
I've added file triggers for a number of desktop things:
- gsettings schemas - gio modules - desktop files - mime types - gdk-pixbuf loaders - gtk im modules
If you are updating a desktop package in rawhide that uses any of glib-compile-schemas, gio-querymodules, update-desktop-database, update -mime-database, gdk-pixbuf-query-loaders or gtk-query-immodules-3.0 in its %post, %postun or %posttrans, you can simply drop those calls - the file triggers will take care of things.
For the time being, it might be a good idea to add a dependency on a new-enough build of the package(s) whose file triggers you are using.
Here is a representative commit:
http://pkgs.fedoraproject.org/cgit/gedit.git/commit/?id=1cd2537b862233c c4b4b1d59a56d26224e8b5b8a
Matthias
On Mon, Aug 17, 2015 at 09:04:05AM -0400, Matthias Clasen wrote:
I've added file triggers for a number of desktop things:
- gsettings schemas
- gio modules
- desktop files
- mime types
- gdk-pixbuf loaders
- gtk im modules
If you are updating a desktop package in rawhide that uses any of glib-compile-schemas, gio-querymodules, update-desktop-database, update -mime-database, gdk-pixbuf-query-loaders or gtk-query-immodules-3.0 in its %post, %postun or %posttrans, you can simply drop those calls - the file triggers will take care of things.
Cool! Can we get the package guidelines updated to reflect this?
On Mon, 2015-08-17 at 15:26 -0400, Matthew Miller wrote:
Cool! Can we get the package guidelines updated to reflect this?
Eventually, we should. For now, this is just a rawhide experiment. I think the packaging committee prefers to have guidelines that cover all active releases in a uniform way...
On Tue, 2015-08-18 at 10:10 -0400, Matthias Clasen wrote:
On Mon, 2015-08-17 at 15:26 -0400, Matthew Miller wrote:
Cool! Can we get the package guidelines updated to reflect this?
Eventually, we should. For now, this is just a rawhide experiment. I think the packaging committee prefers to have guidelines that cover all active releases in a uniform way...
No, they are quite comfortable with saying "These guidelines apply to F23+ or F24+". For example, they recently added F23+ guidelines for self-signed certificate generation.
On Tue, 2015-08-18 at 10:18 -0400, Stephen Gallagher wrote:
On Tue, 2015-08-18 at 10:10 -0400, Matthias Clasen wrote:
On Mon, 2015-08-17 at 15:26 -0400, Matthew Miller wrote:
Cool! Can we get the package guidelines updated to reflect this?
Eventually, we should. For now, this is just a rawhide experiment. I think the packaging committee prefers to have guidelines that cover all active releases in a uniform way...
No, they are quite comfortable with saying "These guidelines apply to F23+ or F24+". For example, they recently added F23+ guidelines for self-signed certificate generation.
alright. I'll send a proposal their way at some point
No plans to add the same trigger in gtk2?
On Mon, Aug 17, 2015 at 10:04 PM, Matthias Clasen mclasen@redhat.com wrote:
Hey,
I've added file triggers for a number of desktop things:
- gsettings schemas
- gio modules
- desktop files
- mime types
- gdk-pixbuf loaders
- gtk im modules
If you are updating a desktop package in rawhide that uses any of glib-compile-schemas, gio-querymodules, update-desktop-database, update -mime-database, gdk-pixbuf-query-loaders or gtk-query-immodules-3.0 in its %post, %postun or %posttrans, you can simply drop those calls - the file triggers will take care of things.
For the time being, it might be a good idea to add a dependency on a new-enough build of the package(s) whose file triggers you are using.
Here is a representative commit:
http://pkgs.fedoraproject.org/cgit/gedit.git/commit/?id=1cd2537b862233c c4b4b1d59a56d26224e8b5b8a
Matthias
desktop mailing list desktop@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/desktop
On Mon, 17 Aug 2015 09:04:05 -0400, Matthias Clasen wrote:
Hey,
I've added file triggers for a number of desktop things:
- gsettings schemas
- gio modules
- desktop files
- mime types
- gdk-pixbuf loaders
- gtk im modules
If you are updating a desktop package in rawhide that uses any of glib-compile-schemas, gio-querymodules, update-desktop-database, update -mime-database, gdk-pixbuf-query-loaders or gtk-query-immodules-3.0 in its %post, %postun or %posttrans, you can simply drop those calls - the file triggers will take care of things.
For the time being, it might be a good idea to add a dependency on a new-enough build of the package(s) whose file triggers you are using.
Here is a representative commit:
http://pkgs.fedoraproject.org/cgit/gedit.git/commit/?id=1cd2537b862233c c4b4b1d59a56d26224e8b5b8a
+# for file triggers +Requires: glib2 >= 2.45.4-2 +Requires: desktop-file-utils >= 0.22-6 +
The minimum version for desktop-file-utils in there makes this change specific to Fedora >= 24 so far.
On 11/29/2015 11:22 AM, Michael Schwendt wrote:
On Mon, 17 Aug 2015 09:04:05 -0400, Matthias Clasen wrote:
Here is a representative commit:
http://pkgs.fedoraproject.org/cgit/gedit.git/commit/?id=1cd2537b862233c c4b4b1d59a56d26224e8b5b8a
+# for file triggers +Requires: glib2 >= 2.45.4-2 +Requires: desktop-file-utils >= 0.22-6
The minimum version for desktop-file-utils in there makes this change specific to Fedora >= 24 so far.
Right, it is intended for F24 and above. Is something wrong with this commit that you are pointing it out now?
On Sun, 29 Nov 2015 11:41:16 +0100, Kalev Lember wrote:
Right, it is intended for F24 and above. Is something wrong with this commit that you are pointing it out now?
It's just that I want a spec file to cover Fedora < 24, too, and then I need conditionals for the lines removed from the scriptlet sections as well as for an explicit Requires on desktop-file-utils and its minimum version.
As some months have passed, is desktop-file-utils guaranteed to be installed for every spin/product or is an explicit dep on it still needed?
Michael Schwendt wrote:
On Sun, 29 Nov 2015 11:41:16 +0100, Kalev Lember wrote:
Right, it is intended for F24 and above. Is something wrong with this commit that you are pointing it out now?
It's just that I want a spec file to cover Fedora < 24, too, and then I need conditionals for the lines removed from the scriptlet sections as well as for an explicit Requires on desktop-file-utils and its minimum version.
As some months have passed, is desktop-file-utils guaranteed to be installed for every spin/product or is an explicit dep on it still needed?
At least in the desktop-file-utils case, you probably don't need to worry about it being present. When/if it gets installed, it'll run the appropriate scriptlet then.
-- Rex
On Sun, 29 Nov 2015 06:40:57 -0600, Rex Dieter wrote:
At least in the desktop-file-utils case, you probably don't need to worry about it being present. When/if it gets installed, it'll run the appropriate scriptlet then.
That's not enough. It _must_ be present already [1] or needs to be installed within the same RPM transaction [2].
For [1] I'm not too happy about comps/group based installations where the base package set may different between various spins/products.
For [2] there must be a strict dependency I can rely on.
Michael Schwendt wrote:
On Sun, 29 Nov 2015 06:40:57 -0600, Rex Dieter wrote:
At least in the desktop-file-utils case, you probably don't need to worry about it being present. When/if it gets installed, it'll run the appropriate scriptlet then.
That's not enough. It _must_ be present already [1] or needs to be installed within the same RPM transaction [2].
The current scriptlet snippets wiki page is clear that no dependency on desktop-file-utils is required, that was true before, and that is still true now.
The scriptlet will get run when desktop-file-utils is installed (at least that's how it should work, if not, that's a bug worth fixing in desktop- file-utils.
-- Rex
On Sun, 29 Nov 2015 09:16:42 -0600, Rex Dieter wrote:
The current scriptlet snippets wiki page is clear that no dependency on desktop-file-utils is required, that was true before, and that is still true now.
*sigh* I had been working on the "representative commit" in the message that started this thread:
http://pkgs.fedoraproject.org/cgit/gedit.git/commit/?id=1cd2537b862233cc4b4b...
+# for file triggers +Requires: glib2 >= 2.45.4-2 +Requires: desktop-file-utils >= 0.22-6 +
That made me want such a dependency, too. How lame!
Okay. I'll remove it again, but "gedit" and other packages also ought to be fixed.
It's too easy to not follow the guidelines, if other packages serve as bad examples or cause confusion. Such as "ibus", which even does
Requires(post): desktop-file-utils Requires(postun): desktop-file-utils
without running any of the desktop-file-utils in those scriptlets.
$ rpm -e --test desktop-file-utils error: Failed dependencies: desktop-file-utils is needed by (installed) xdg-utils-1.1.1-1.fc23.noarch desktop-file-utils is needed by (installed) ibus-1.5.11-1.fc23.x86_64 desktop-file-utils is needed by (installed) setroubleshoot-3.3.1-0.2.fc23.x86_64 desktop-file-utils is needed by (installed) rpmlint-1.8-2.fc23.noarch desktop-file-utils is needed by (installed) emacs-1:24.5-6.fc23.x86_64 desktop-file-utils is needed by (installed) gvfs-1.26.2-1.fc23.x86_64 desktop-file-utils is needed by (installed) gnome-bluetooth-1:3.18.1-1.fc23.x86_64
Michael Schwendt wrote:
On Sun, 29 Nov 2015 09:16:42 -0600, Rex Dieter wrote:
The current scriptlet snippets wiki page is clear that no dependency on desktop-file-utils is required, that was true before, and that is still true now.
*sigh* I had been working on the "representative commit" in the message that started this thread:
http://pkgs.fedoraproject.org/cgit/gedit.git/commit/?id=1cd2537b862233cc4b4b...
+# for file triggers +Requires: glib2 >= 2.45.4-2 +Requires: desktop-file-utils >= 0.22-6
That made me want such a dependency, too. How lame!
I missed that, but I would say gedit is being erroneous by adding dependencies, at least with respect to desktop-file-utils.
-- rex
On Mon, 2015-11-30 at 07:11 -0600, Rex Dieter wrote:
Michael Schwendt wrote:
On Sun, 29 Nov 2015 09:16:42 -0600, Rex Dieter wrote:
The current scriptlet snippets wiki page is clear that no dependency on desktop-file-utils is required, that was true before, and that is still true now.
*sigh* I had been working on the "representative commit" in the message that started this thread:
http://pkgs.fedoraproject.org/cgit/gedit.git/commit/?id=1cd2537b86223 3cc4b4b1d59a56d26224e8b5b8a
+# for file triggers +Requires: glib2 >= 2.45.4-2 +Requires: desktop-file-utils >= 0.22-6 +
That made me want such a dependency, too. How lame!
I missed that, but I would say gedit is being erroneous by adding dependencies, at least with respect to desktop-file-utils.
I added the dependency for a new enough desktop-file-utils build because the desktop-file-utils package does not contain the file trigger section before 0.22-6
On Mon, Nov 30, 2015 at 12:02:59PM -0500, Matthias Clasen wrote:
On Mon, 2015-11-30 at 07:11 -0600, Rex Dieter wrote:
Michael Schwendt wrote:
On Sun, 29 Nov 2015 09:16:42 -0600, Rex Dieter wrote:
The current scriptlet snippets wiki page is clear that no dependency on desktop-file-utils is required, that was true before, and that is still true now.
*sigh* I had been working on the "representative commit" in the message that started this thread:
http://pkgs.fedoraproject.org/cgit/gedit.git/commit/?id=1cd2537b86223 3cc4b4b1d59a56d26224e8b5b8a
+# for file triggers +Requires: glib2 >= 2.45.4-2 +Requires: desktop-file-utils >= 0.22-6 +
That made me want such a dependency, too. How lame!
I missed that, but I would say gedit is being erroneous by adding dependencies, at least with respect to desktop-file-utils.
I added the dependency for a new enough desktop-file-utils build because the desktop-file-utils package does not contain the file trigger section before 0.22-6
Seems that you need 'Conflicts: desktop-file-utils < 0.22-6' instead.
Zbyszek
Matthias Clasen wrote:
On Mon, 2015-11-30 at 07:11 -0600, Rex Dieter wrote:
I missed that, but I would say gedit is being erroneous by adding dependencies, at least with respect to desktop-file-utils.
I added the dependency for a new enough desktop-file-utils build because the desktop-file-utils package does not contain the file trigger section before 0.22-6
Sure, but that's conceptually no different than the case where gedit owned the scriptlet but (also) had no dependency on desktop-file-utils.
either way, if desktop-file-utils is not present, the effect is nothing happens. We only care about the case when desktop-file-utils *is* present and that case already works without adding any package dependencies.
-- Rex
On Mon, 2015-11-30 at 12:09 -0600, Rex Dieter wrote:
Matthias Clasen wrote:
On Mon, 2015-11-30 at 07:11 -0600, Rex Dieter wrote:
I missed that, but I would say gedit is being erroneous by adding dependencies, at least with respect to desktop-file-utils.
I added the dependency for a new enough desktop-file-utils build because the desktop-file-utils package does not contain the file trigger section before 0.22-6
Sure, but that's conceptually no different than the case where gedit owned the scriptlet but (also) had no dependency on desktop-file-utils.
either way, if desktop-file-utils is not present, the effect is nothing happens. We only care about the case when desktop-file-utils *is* present and that case already works without adding any package dependencies.
This all is of course largely theoretical (in practice, desktop-file- utils will be installed, and f24 will have a build of d-f-u with the file trigger), but I don't entirely agree. If you install the gedit package, and nothing happens, your system is now in an inconsistent state - the installed desktop files contain mime handler information that is not reflected in the mime db. The fact that installing d-f-u later will bring your system back into consistency doesn't change the fact that it is inconsistent between the end of the gedit installation and the time you decide to install d-f-u.
On 11/30/2015 07:09 PM, Rex Dieter wrote:
Matthias Clasen wrote:
On Mon, 2015-11-30 at 07:11 -0600, Rex Dieter wrote:
I missed that, but I would say gedit is being erroneous by adding dependencies, at least with respect to desktop-file-utils.
I added the dependency for a new enough desktop-file-utils build because the desktop-file-utils package does not contain the file trigger section before 0.22-6
Sure, but that's conceptually no different than the case where gedit owned the scriptlet but (also) had no dependency on desktop-file-utils.
either way, if desktop-file-utils is not present, the effect is nothing happens. We only care about the case when desktop-file-utils *is* present and that case already works without adding any package dependencies.
Rex, do you by any chance remember why the packaging guidelines say to not add a dependency on desktop-file-utils? Does KDE not want the dependency?
All I could find was https://bugzilla.redhat.com/show_bug.cgi?id=180899#c2 that just hand waves the reasons and only says "it was agreed that it is wrong/wasteful /.../"
Kalev Lember wrote:
On 11/30/2015 07:09 PM, Rex Dieter wrote:
Matthias Clasen wrote:
On Mon, 2015-11-30 at 07:11 -0600, Rex Dieter wrote:
I missed that, but I would say gedit is being erroneous by adding dependencies, at least with respect to desktop-file-utils.
I added the dependency for a new enough desktop-file-utils build because the desktop-file-utils package does not contain the file trigger section before 0.22-6
Sure, but that's conceptually no different than the case where gedit owned the scriptlet but (also) had no dependency on desktop-file-utils.
either way, if desktop-file-utils is not present, the effect is nothing happens. We only care about the case when desktop-file-utils *is* present and that case already works without adding any package dependencies.
Rex, do you by any chance remember why the packaging guidelines say to not add a dependency on desktop-file-utils? Does KDE not want the dependency?
I don't recall exactly, but I think one reason was because it would be added a hundred times all over. In this particular case, we're saving .spec scriptlets but (re)adding dependencies, so arguably not much simplification gained.
I suppose the flipside is that *something* should depend on desktop-file- utils (ideally something low-level)... maybe any library (or app) that expects xdg mimetype support to be present, so for starters that could include stuff like: glib2, qt (similar arguments can be made for update-mime-desktop and gtk-update-icon- cache scriptlets)
-- Rex
On 11/30/2015 09:45 PM, Rex Dieter wrote:
I don't recall exactly, but I think one reason was because it would be added a hundred times all over. In this particular case, we're saving .spec scriptlets but (re)adding dependencies, so arguably not much simplification gained.
RPM has pretty good support for autogenerating dependencies these days. If it turns out it makes sense to have the dependencies, I'm sure they can be made completely automatic without needing to manually add anything in individual spec files.
Although I am not sure it's worth much effort because like mclasen wrote above, desktop-file-utils is going to be always installed in a Workstation install. :)
I suppose the flipside is that *something* should depend on desktop-file- utils (ideally something low-level)... maybe any library (or app) that expects xdg mimetype support to be present, so for starters that could include stuff like: glib2, qt (similar arguments can be made for update-mime-desktop and gtk-update-icon- cache scriptlets)
gtk2 and gtk3 already have a hard dependency on gtk-update-icon-cache. Not sure if glib2 is a good place for desktop dependencies because glib is often used in low level projects that don't have anything to do with graphical apps. DNF for example indirectly pulls in glib2.
On Mon, 30 Nov 2015 22:00:56 +0100, Kalev Lember wrote:
Although I am not sure it's worth much effort because like mclasen wrote above, desktop-file-utils is going to be always installed in a Workstation install. :)
Only GNOME Workstation or also other spins/products?
I'm really not a fan of comps/group based installations that add packages without inserting a corresponding dependency into the RPM DB.
What guarantees d-f-u to be available "always"?
$ rpm -e --test desktop-file-utils error: Failed dependencies: desktop-file-utils is needed by (installed) xdg-utils-1.1.1-1.fc23.noarch desktop-file-utils is needed by (installed) ibus-1.5.11-1.fc23.x86_64 desktop-file-utils is needed by (installed) setroubleshoot-3.3.1-0.2.fc23.x86_64 desktop-file-utils is needed by (installed) rpmlint-1.8-2.fc23.noarch desktop-file-utils is needed by (installed) emacs-1:24.5-6.fc23.x86_64 desktop-file-utils is needed by (installed) gvfs-1.26.2-1.fc23.x86_64 desktop-file-utils is needed by (installed) gnome-bluetooth-1:3.18.1-1.fc23.x86_64
$ rpm -e --test gnome-bluetooth error: Failed dependencies: gnome-bluetooth(x86-64) >= 1:3.18.0 is needed by (installed) control-center-1:3.18.2-1.fc23.x86_64 gnome-bluetooth(x86-64) >= 1:3.9.0 is needed by (installed) gnome-shell-3.18.3-1.fc23.x86_64
$ rpm -e --test xdg-utils error: Failed dependencies: xdg-utils is needed by (installed) gnome-abrt-1.2.0-5.fc23.x86_64 xdg-utils is needed by (installed) setroubleshoot-3.3.1-0.2.fc23.x86_64 xdg-utils is needed by (installed) pinfo-0.6.10-12.fc23.x86_64 xdg-utils is needed by (installed) gimp-2:2.8.16-1.fc23.x86_64 xdg-utils is needed by (installed) kdelibs-6:4.14.14-1.fc23.x86_64
Kalev Lember wrote:
I suppose the flipside is that *something* should depend on desktop-file- utils (ideally something low-level)... maybe any library (or app) that expects xdg mimetype support to be present, so for starters that could include stuff like: glib2, qt (similar arguments can be made for update-mime-desktop and gtk-update-icon- cache scriptlets)
gtk2 and gtk3 already have a hard dependency on gtk-update-icon-cache. Not sure if glib2 is a good place for desktop dependencies
If you expect glib/gio mime-related functionality like: https://developer.gnome.org/gio/stable/gio-GContentType.html to work, it's not unreasonable to expect the system to ensure the dependencies are present
-- Rex
Kalev Lember wrote:
RPM has pretty good support for autogenerating dependencies these days. If it turns out it makes sense to have the dependencies, I'm sure they can be made completely automatic without needing to manually add anything in individual spec files
I'm ok with that, provided it's smart enough to only auto-add the dependency if app's .desktop files contain any non-empty MimeTypes= key
-- Rex
Kalev Lember wrote:
On 11/30/2015 09:45 PM, Rex Dieter wrote:
I don't recall exactly, but I think one reason was because it would be added a hundred times all over. In this particular case, we're saving .spec scriptlets but (re)adding dependencies, so arguably not much simplification gained.
RPM has pretty good support for autogenerating dependencies these days. If it turns out it makes sense to have the dependencies, I'm sure they can be made completely automatic without needing to manually add anything in individual spec files.
Although I am not sure it's worth much effort because like mclasen wrote above, desktop-file-utils is going to be always installed in a Workstation install. :)
I'm ok with it being automatic, as long as the dep is only added when really needed (ie, only when .desktop files include any MimeType= keys)
I suppose the flipside is that *something* should depend on desktop-file- utils (ideally something low-level)... maybe any library (or app) that expects xdg mimetype support to be present, so for starters that could include stuff like: glib2, qt (similar arguments can be made for update-mime-desktop and gtk-update-icon- cache scriptlets)
gtk2 and gtk3 already have a hard dependency on gtk-update-icon-cache. Not sure if glib2 is a good place for desktop dependencies
glib (gio) is where some mime handler functions live, for example: https://developer.gnome.org/gio/stable/gio-GContentType.html
I think it not unreasonable to expect those to "just work".
-- Rex
desktop@lists.fedoraproject.org