Package: debhelper
Severity: wishlist
Tags: patch
The attached patch to dh_desktop creates a ${Mime-Types} substitution
variable, containing the list of supported MIME types in the
shipped .desktop files.
The goal is to create for packages a new field:
XB-Mime-Types: ${Mime-Types}
In the end, it could be used by Debian-specific tools to look for an
application supporting a specific MIME type.
Furthermore, it doesn't create the postinst/postrm scripts when no MIME
types are supported, as in this case they are not necessary.
--
.''`.
: :' : We are debian.org. Lower your prices, surrender your code.
`. `' We will add your hardware and software distinctiveness to
`- our own. Resistance is futile.
--- /usr/bin/dh_desktop 2006-01-04 02:20:51.000000000 +0100
+++ dh_desktop 2007-01-20 17:53:39.000000000 +0100
@@ -32,8 +32,15 @@
# usr/share/applications and thus might need
# update-desktop-database be called. Other desktop
# files don't.
- my $desktop_files = `find $tmp/usr/share/applications -type f -name \\*.desktop -printf '%p\n'`;
- if ($desktop_files && ! $dh{NOSCRIPTS}) {
+ my $do_scripts = 0;
+
+ foreach my $file (split /\n/, `find $tmp/usr/share/applications -type f -name \\*.desktop -printf '%p\n'`) {
+ foreach my $type (split /\;/, `sed -n s/^MimeType=//p $file`) {
+ $do_scripts = 1;
+ addsubstvar($package, "Mime-Types", $type);
+ }
+ }
+ if ($do_scripts && ! $dh{NOSCRIPTS}) {
autoscript($package,"postinst","postinst-desktop");
autoscript($package,"postrm","postrm-desktop");
}
signature.asc
Description: Ceci est une partie de message numériquement signée

