Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Sep 2010 18:10:09 +0400
From:      Anonymous <swell.k@gmail.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/150935: [patch] devel/desktop-file-utils: simplify PORT_MIMEDIRS
Message-ID:  <86y6apewxq.fsf@gmail.com>
Resent-Message-ID: <201009251420.o8PEK3eu098670@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         150935
>Category:       ports
>Synopsis:       [patch] devel/desktop-file-utils: simplify PORT_MIMEDIRS
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Sep 25 14:20:03 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Anonymous
>Release:        FreeBSD 9.0-CURRENT amd64
>Organization:
>Environment:
>Description:
- use PREFIX rather than LOCALBASE, for mimeinfo.cache, too (bug)
- nuke pkg-install/pkg-deinstall scripts, they're too simple to keep
  them out of the port's Makefile
- drop WANT_GNOME, USE_GNOME already picks up bsd.gnome.mk (cosmetic)
- tabify (cosmetic)
>How-To-Repeat:
>Fix:
The patch doesn't need an exp-run, it affects only the port's own plist.

--- a.diff begins here ---
Index: devel/desktop-file-utils/Makefile
===================================================================
RCS file: /a/.cvsup/ports/devel/desktop-file-utils/Makefile,v
retrieving revision 1.23
diff -u -p -r1.23 Makefile
--- devel/desktop-file-utils/Makefile	31 May 2010 22:52:37 -0000	1.23
+++ devel/desktop-file-utils/Makefile	25 Sep 2010 14:02:25 -0000
@@ -17,34 +17,24 @@ COMMENT=	A couple of command line utilit
 
 USE_GNOME=	glib20
 USE_GETTEXT=	yes
-WANT_GNOME=	yes
 GNU_CONFIGURE=	yes
 CONFIGURE_ARGS=	--without-lispdir
 CONFIGURE_ENV=	CPPFLAGS="-I${LOCALBASE}/include" \
 		LDFLAGS="-L${LOCALBASE}/lib" EMACS="no"
 
-PKGINSTALL=	${WRKDIR}/pkg-install
-PKGDEINSTALL=	${WRKDIR}/pkg-deinstall
+PORT_MIMEDIRS=	share/applications
 
-PORT_MIMEDIRS=	${LOCALBASE}/share/applications
-
-MIMEDIRS=	${PORT_MIMEDIRS}
-
-RMDIRS=		${PORT_MIMEDIRS}
-
-post-patch:
-	@${SED} -e 's|%%MIMEDIRS%%|${MIMEDIRS}| ;\
-		s|%%RMDIRS%%|${RMDIRS}| ; \
-		s|%%PORT_MIMEDIRS%%|${PORT_MIMEDIRS}|' \
-		< ${FILESDIR}/pkg-deinstall.in > ${PKGDEINSTALL}
-	@${SED} -e 's|%%PORT_MIMEDIRS%%|${PORT_MIMEDIRS}|' \
-		< ${FILESDIR}/pkg-install.in > ${PKGINSTALL}
+.for d in ${PORT_MIMEDIRS}
+PLIST_FILES+=	'@rmtry ${d}/mimeinfo.cache' \
+		'@dirrmtry ${d}'
+.endfor
 
 post-install:
+.for d in ${PORT_MIMEDIRS}
+	${MKDIR} ${PREFIX}/${d}
+	${PREFIX}/bin/update-desktop-database ${PREFIX}/${d}
+.endfor
 	${INSTALL_DATA} ${WRKSRC}/misc/desktop-entry-mode.el \
-	    	${PREFIX}/share/emacs/site-lisp/desktop-entry-mode.el
-.if !defined(PACKAGE_BUILDING)
-	@${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
-.endif
+		${PREFIX}/share/emacs/site-lisp/desktop-entry-mode.el
 
 .include <bsd.port.mk>
Index: devel/desktop-file-utils/files/pkg-deinstall.in
===================================================================
RCS file: devel/desktop-file-utils/files/pkg-deinstall.in
diff -N devel/desktop-file-utils/files/pkg-deinstall.in
--- devel/desktop-file-utils/files/pkg-deinstall.in	24 Oct 2007 23:35:04 -0000	1.4
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,21 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD: ports/devel/desktop-file-utils/files/pkg-deinstall.in,v 1.4 2007/10/24 23:35:04 marcus Exp $
-#
-# Remove leftover mimeinfo.cache files.
-
-if [ "$2" != "POST-DEINSTALL" ]; then
-    exit 0
-fi
-
-for mdir in %%MIMEDIRS%%; do
-    if [ -f ${mdir}/mimeinfo.cache ]; then
-	rm -f ${mdir}/mimeinfo.cache
-    fi
-done
-
-for pmdir in $(echo %%RMDIRS%% | sort -r); do
-    rmdir ${pmdir} 2>/dev/null
-done
-
-exit 0
Index: devel/desktop-file-utils/files/pkg-install.in
===================================================================
RCS file: devel/desktop-file-utils/files/pkg-install.in
diff -N devel/desktop-file-utils/files/pkg-install.in
--- devel/desktop-file-utils/files/pkg-install.in	24 Oct 2007 23:35:04 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,17 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD: ports/devel/desktop-file-utils/files/pkg-install.in,v 1.2 2007/10/24 23:35:04 marcus Exp $
-#
-# Initialize the desktop directories and MIME cache.
-
-if [ "$2" != "POST-INSTALL" ]; then
-    exit 0
-fi
-
-for pmdir in %%PORT_MIMEDIRS%%; do
-    mkdir -p ${pmdir}
-done
-
-${PKG_PREFIX}/bin/update-desktop-database -q
-
-exit 0
--- a.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86y6apewxq.fsf>