From owner-freebsd-ports@FreeBSD.ORG Wed Jul 13 04:08:03 2011 Return-Path: Delivered-To: freebsd-ports@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B46B1065670; Wed, 13 Jul 2011 04:08:03 +0000 (UTC) (envelope-from stephen@missouri.edu) Received: from wilberforce.math.missouri.edu (wilberforce.math.missouri.edu [128.206.184.213]) by mx1.freebsd.org (Postfix) with ESMTP id 067848FC13; Wed, 13 Jul 2011 04:08:02 +0000 (UTC) Received: from [127.0.0.1] (wilberforce.math.missouri.edu [128.206.184.213]) by wilberforce.math.missouri.edu (8.14.4/8.14.4) with ESMTP id p6D481qr013583; Tue, 12 Jul 2011 23:08:01 -0500 (CDT) (envelope-from stephen@missouri.edu) Message-ID: <4E1D1A21.601@missouri.edu> Date: Tue, 12 Jul 2011 23:08:01 -0500 From: Stephen Montgomery-Smith User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110516 Thunderbird/3.1.10 MIME-Version: 1.0 To: Jung-uk Kim References: <201107121826.00020.jkim@FreeBSD.org> In-Reply-To: <201107121826.00020.jkim@FreeBSD.org> Content-Type: multipart/mixed; boundary="------------010105090807040609080608" Cc: Pav Lucistnik , Stephen Montgomery-Smith , "freebsd-ports@FreeBSD.org" Subject: Re: [RFC] A trivial change for DESKTOP_ENTRIES X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jul 2011 04:08:03 -0000 This is a multi-part message in MIME format. --------------010105090807040609080608 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 07/12/2011 05:25 PM, Jung-uk Kim wrote: > After I updated x11-wm/compiz, GNOME was not able to start the window > manager. Basically, it complained that compiz-manager was not found. > Then, I realized compiz-manager.desktop was automagically replaced by > compizmanager.desktop. Now I tracked it down to this commit: > > Sat Nov 27 17:42:46 2010 UTC (7 months, 2 weeks ago) by pav > > - DESKTOP_ENTRIES: commandline is used to name installed .desktop > file, this can lead to files containing whitespace and funny > characters; thus strip all non-alphanumeric characters > > http://www.freebsd.org/cgi/cvsweb.cgi/ports/Mk/bsd.port.mk.diff?r1=1.656;r2=1.657 > > To me, it looks far too restrictive. At least, I'd like to allow '-' > and '_'. Please see the attached patch. > > Any objections? > > Jung-uk Kim Thinking more about it, it seems to me that instead of silently deleting the disallowed characters in the filename, that the port should declare itself broken if there are disallowed characters. That way, this particular error would have been caught far more easily. Here is a simple patch, although I think you guys could come up with a better error message. --------------010105090807040609080608 Content-Type: text/plain; name="patch.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch.txt" diff -u bsd.port.mk-orig bsd.port.mk --- bsd.port.mk-orig 2011-07-13 03:48:35.000000000 +0000 +++ bsd.port.mk 2011-07-13 04:04:14.000000000 +0000 @@ -6432,7 +6432,10 @@ ${ECHO_CMD} "@cwd ${DESKTOPDIR}" >> ${TMPPLIST}; \ fi; \ while [ $$# -gt 6 ]; do \ - filename="`${ECHO_CMD} "$$4" | ${TR} -cd [:alnum:]`.desktop"; \ + filename="`${ECHO_CMD} "$$4" | ${TR} -cd "[:alnum:]-_"`.desktop"; \ + if [ "$$filename" != "$$4.desktop" ]; then \ + ${ECHO_MSG} "===> Disallowed characters in entry 4 of DESKTOP_ENTRIES \"$$4\""; exit 1; \ + fi; \ pathname="${DESKTOPDIR}/$$filename"; \ categories="$$5"; \ if [ -z "$$categories" ]; then \ --------------010105090807040609080608--