From owner-freebsd-ports@FreeBSD.ORG Wed Jul 13 17:13:44 2011 Return-Path: Delivered-To: freebsd-ports@FreeBSD.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 1FEBE106564A; Wed, 13 Jul 2011 17:13:44 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: freebsd-ports@FreeBSD.org Date: Wed, 13 Jul 2011 13:13:35 -0400 User-Agent: KMail/1.6.2 References: <201107121826.00020.jkim@FreeBSD.org> <201107131242.21296.jkim@FreeBSD.org> <4E1DCF09.2060604@missouri.edu> In-Reply-To: <4E1DCF09.2060604@missouri.edu> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201107131313.37202.jkim@FreeBSD.org> Cc: Stephen Montgomery-Smith , Matthias Andree , Pav Lucistnik , Stephen Montgomery-Smith 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 17:13:44 -0000 On Wednesday 13 July 2011 12:59 pm, Stephen Montgomery-Smith wrote: > On 07/13/2011 11:42 AM, Jung-uk Kim wrote: > > On Wednesday 13 July 2011 12:08 am, Stephen Montgomery-Smith wrote: > >> 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 > >>>?r 1=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. > > > > I think that's a good idea but "exit 1;" should be done in a > > separate commit as an exp-run is needed. > > > >> Here is a simple patch, although I think you guys could come up > >> with a better error message. > >> > > :-) > > > > "entry 4 of" seems redundant. What do you think about the > > attached patch? Please note I also added "." per Matthias > > Andree's request. > > > > Thanks, > > > > Jung-uk Kim > > I have no problems with your changes. But I didn't see where you > put the ".". Maybe it was meant to be at the end of the error > message. Err... Here: filename="`${ECHO_CMD} "$$4" | ${TR} -cd "[:alnum:]-._"`.desktop"; ^ i.e., allowing "." as a legal character. Jung-uk Kim > But code like this seems simpler than my original suggestion: > > if (echo "$$4" | grep -E [^[:alnum:]_-] > /dev/null); then echo \ > ${ECHO_MSG} "blah blah."; \ > exit 1; \ > fi; \ > pathname="${DESKTOPDIR}/$$4";