Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jul 2011 13:47:29 -0400
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        Stephen Montgomery-Smith <stephen@missouri.edu>
Cc:        "demon@FreeBSD.org" <demon@FreeBSD.org>, Pav Lucistnik <pav@FreeBSD.org>, Stephen Montgomery-Smith <stephen@FreeBSD.org>, "freebsd-ports@FreeBSD.org" <freebsd-ports@FreeBSD.org>, "lioux@FreeBSD.org" <lioux@FreeBSD.org>
Subject:   Re: [RFC] A trivial change for DESKTOP_ENTRIES (take 2)
Message-ID:  <201107141347.39261.jkim@FreeBSD.org>
In-Reply-To: <4E1F200D.1080002@missouri.edu>
References:  <201107121826.00020.jkim@FreeBSD.org> <4E1E9C79.6080105@FreeBSD.org> <4E1F200D.1080002@missouri.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 14 July 2011 12:57 pm, Stephen Montgomery-Smith wrote:
> Pav Lucistnik wrote:
> > On 2011/07/14 00:57, Jung-uk Kim wrote:
> >> links.diff, metalink-editor.diff, tome.diff:
> >> - Add static desktop files to work around DESKTOP_ENTRIES
> >> limitations.
> >
> > This is a step backwards and I'll oppose it.
>
> I am beginning to get a clearer picture of what is going on.  This
> "desktop_entries" stuff is all rather new to me, and I think that
> yesterday I wasn't understanding it.
>
> So entry 4 in Desktop Entries serves two purposes.  First, it tells
> us what program we are running, complete with path names and flags
> if needed.  Secondly, it is used to generate the filename of the
> desktop entry.  I assume that the filename of the desktop entry is
> unimportant, and is used only internally by Gnome or whatever.
>
> But what is important is that the name of the filename stays the
> SAME. So if I deinstall some software, and then reinstall, and then
> the filename of the desktop entry changes, then suddenly there is
> the potential for stuff to stop working.
>
> And this "not working" will typically be at the user level, not the
> system administrator level.  And Joe Average user who doesn't
> actually install the ports shouldn't be expected to read UPDATING.
>
> So one fix would be to keep everything in bsd.port.mk as it is, and
> just change the instructions in pkg-message in x11-wm/compix to use
> compizmanager instead of compiz-manager.
>
> But maybe it would have been better to have had one more entry in
> DESKTOP_ENTRIES that was the actual filename of the desktop entry. 
> But I can also see why people didn't do that, because it would be
> opaque to the users.
>
> But using the program name for the filename didn't work, because of
> the possibility of spaces and slashes and "..".  So Pavel had to
> change it to remove spaces and such like.  But this had the
> unintended consequence that users would find their desktop icons
> suddenly not working.  And now the filename for the desktop entry
> is inconsistent across different computers, depending upon whether
> people installed the ports before or after the change to
> bsd.port.mk.
>
> So Jung-uk Kim's scheme of partially reversing Pavel's changes will
> create more havoc for some people, and less for others.  And my
> initial complaint that bsd.port.mk was changing names without
> telling me was based on my not understanding what all this desktop
> entry stuff was all about.
>
> Sorry for the long ramble.  Am I understanding this correctly?

Yes, I believe so.

Anyhow, I guess we can do it much simpler:

--- Mk/bsd.port.mk      3 Jul 2011 15:51:18 -0000       1.687
+++ Mk/bsd.port.mk      14 Jul 2011 17:26:43 -0000
@@ -6432,7 +6432,7 @@
 		${ECHO_CMD} "@cwd ${DESKTOPDIR}" >> ${TMPPLIST}; \
 	fi; \
 	while [ $$# -gt 6 ]; do \
-		filename="`${ECHO_CMD} "$$4" | ${TR} -cd [:alnum:]`.desktop"; \
+		filename="`${BASENAME} "$$4" | ${SED} -E 's/[[:space:]]+.*//'`.desktop"; \
 		pathname="${DESKTOPDIR}/$$filename"; \
 		categories="$$5"; \
 		if [ -z "$$categories" ]; then \

I think this is much simpler and better fix.

Jung-uk Kim



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