Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Jul 2011 12:42:19 -0400
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        freebsd-ports@FreeBSD.org
Cc:        Stephen Montgomery-Smith <stephen@missouri.edu>, Matthias Andree <matthias.andree@gmx.de>, Pav Lucistnik <pav@freebsd.org>, Stephen Montgomery-Smith <stephen@freebsd.org>
Subject:   Re: [RFC] A trivial change for DESKTOP_ENTRIES
Message-ID:  <201107131242.21296.jkim@FreeBSD.org>
In-Reply-To: <4E1D1A21.601@missouri.edu>
References:  <201107121826.00020.jkim@FreeBSD.org> <4E1D1A21.601@missouri.edu>

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

--Boundary-00=_trcHOsn9lJ1GelS
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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

--Boundary-00=_trcHOsn9lJ1GelS
Content-Type: text/plain;
  charset="iso-8859-1";
  name="port.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="port.diff"

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} "===> WARNING: Disallowed characters in DESKTOP_ENTRIES \"$$4\""; \
+		fi; \
 		pathname="${DESKTOPDIR}/$$filename"; \
 		categories="$$5"; \
 		if [ -z "$$categories" ]; then \


--Boundary-00=_trcHOsn9lJ1GelS--



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