With the apparition of @tag a regression was found, the cache file was not in

sync with what we had on the system during an update (because
update-mime-database(1) is now only run once at the end). That triggered some
weird behaviors if you 'pkg_add -u' while running on a fd.o Desktop as spotted
by landry@.

With this change we are now doing what most other BSD/Linux are doing, we dont't
package the files/dirs created by update-mime-database anymore and use some
@unexec-delete dance to cope with the removal of this extra stuff. So everything
should be in-sync at a given time.

input from espie@
This commit is contained in:
ajacoutot 2018-07-23 07:35:58 +00:00
parent 53946883d1
commit 06d08710fa
2 changed files with 11 additions and 50 deletions

View File

@ -1,9 +1,10 @@
# $OpenBSD: Makefile,v 1.60 2018/07/01 18:33:37 espie Exp $
# $OpenBSD: Makefile,v 1.61 2018/07/23 07:35:58 ajacoutot Exp $
COMMENT= shared mime database for desktops
DISTNAME= shared-mime-info-1.10
REVISION= 0
REVISION= 1
CATEGORIES= misc
HOMEPAGE= http://www.freedesktop.org/wiki/Software/shared-mime-info
@ -29,18 +30,11 @@ CONFIGURE_STYLE= gnu
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib"
CONFIGURE_ARGS= --disable-update-mimedb
pre-configure:
sed -i 's|/usr/local|${PREFIX}|g' \
${WRKSRC}/update-mime-database.c \
${WRKSRC}/shared-mime-info-spec.xml
# Hack to get a minimal set of files and directories. We could just
# configure with `--disable-update-mimedb' but then we don't get
# the (mostly empty) bookkeeping files.
post-install:
cd ${PREFIX}/share/mime && \
mv packages/freedesktop.org.xml{,~} && \
${PREFIX}/bin/update-mime-database $$(pwd) && \
mv packages/freedesktop.org.xml{~,}
.include <bsd.port.mk>

View File

@ -1,9 +1,8 @@
@comment $OpenBSD: PLIST,v 1.33 2018/07/01 18:33:37 espie Exp $
share/mime/
share/mime/packages/
share/mime/packages/freedesktop.org.xml
@comment $OpenBSD: PLIST,v 1.34 2018/07/23 07:35:58 ajacoutot Exp $
@define-tag update-mime-database at-end %D/bin/update-mime-database %D/share/mime
@tag update-mime-database
@unexec-delete find %D/share/mime/* -maxdepth 0 -type d ! -name packages -exec rm -rf '{}' \+
@unexec-delete find %D/share/mime/ -type f ! -name freedesktop.org.xml -exec rm -f '{}' \+
@bin bin/update-mime-database
@man man/man1/update-mime-database.1
share/locale/ar/LC_MESSAGES/shared-mime-info.mo
@ -83,39 +82,7 @@ share/locale/wa/LC_MESSAGES/shared-mime-info.mo
share/locale/zh_CN/LC_MESSAGES/shared-mime-info.mo
share/locale/zh_HK/LC_MESSAGES/shared-mime-info.mo
share/locale/zh_TW/LC_MESSAGES/shared-mime-info.mo
@comment no checksum
share/mime/XMLnamespaces
@comment no checksum
share/mime/aliases
share/mime/application/
share/mime/audio/
share/mime/font/
@comment no checksum
share/mime/generic-icons
@comment no checksum
share/mime/globs
@comment no checksum
share/mime/globs2
@comment no checksum
share/mime/icons
share/mime/image/
share/mime/inode/
@comment no checksum
share/mime/magic
share/mime/message/
@comment no checksum
share/mime/mime.cache
share/mime/model/
share/mime/multipart/
@comment no checksum
share/mime/subclasses
share/mime/text/
@comment no checksum
share/mime/treemagic
@comment no checksum
share/mime/types
share/mime/version
share/mime/video/
share/mime/x-content/
share/mime/x-epoc/
share/mime/
share/mime/packages/
share/mime/packages/freedesktop.org.xml
share/pkgconfig/shared-mime-info.pc