]> git.donarmstrong.com Git - debhelper.git/blobdiff - dh_desktop
dh_desktop: Avoid using find -execdir as it will fail with certian badly configured...
[debhelper.git] / dh_desktop
old mode 100644 (file)
new mode 100755 (executable)
index 2034606..7900152
@@ -11,14 +11,18 @@ use Debian::Debhelper::Dh_Lib;
 
 =head1 SYNOPSIS
 
-B<dh_desktop> [S<I<debhelper options>>] [B<-p<package>>]
+B<dh_desktop> [S<I<debhelper options>>]
 
 =head1 DESCRIPTION
 
 dh_desktop is a debhelper program that registers .desktop files.
 Currently this program does not handle installation of the files, though it
 may do so at a later date. It takes care of adding maintainer script
-fragements to call F<update-desktop-database>.
+fragments to call F<update-desktop-database>.
+
+Note that since F<update-desktop-database> currently only handles mime
+types, as an optimisation, desktop files not containing MimeType fields
+will currently  be ignored by dh_desktop.
 
 =cut
 
@@ -32,7 +36,7 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
                # 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'`;
+               my $desktop_files = `find $tmp/usr/share/applications -type f -name \\*.desktop -exec grep -q "^MimeType" '{}' \\; -printf '%p\n'`;
                if ($desktop_files && ! $dh{NOSCRIPTS}) {
                        autoscript($package,"postinst","postinst-desktop");
                        autoscript($package,"postrm","postrm-desktop");