Don't run update-desktop-database on an empty directory

During a distcheck, update-desktop-database creates a cache file whcih
we can't remove in a sane manner. The left-over file makes distcheck
fail.

Run update-desktop-database only if there is already a default list in
that directory. This stops it from running when doing "make install"
into an empty directory.

[Originally from banshee's 60e674ba90c (2012-05-31; Bertrand Lorentz;
build: Don't run update-desktop-database in an empty folder)]
This commit is contained in:
Carlos Martín Nieto 2012-06-07 01:33:45 +02:00
parent 911ad06a9c
commit c99f9140f9

View file

@ -25,4 +25,5 @@ SOURCES = \
include $(top_srcdir)/build/build.mk
install-data-hook:
test -f $(datadir)/applications/defaults.list && \
test -z $(DESTDIR) && update-desktop-database $(datadir)/applications || :