Re: [RFC] A trivial change for DESKTOP_ENTRIES (take 2)

2011-07-15 Thread Scot Hetzel
2011/7/14 Pav Lucistnik p...@freebsd.org:
 Stephen Montgomery-Smith píše v čt 14. 07. 2011 v 11:57 -0500:

 entry.  I assume that the filename of the desktop entry is unimportant,

 The filename of desktop entry should be 100% inconsequential, and our
 only care should be not have two ports installing same file.

 and is used only internally by Gnome or whatever.

 Sounds like a bug to me.

 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.

 Yes, but is it worth the effort? Note you'll have to introduce it
 somehow not to break existing ports.


How about something like this:

http://www.freebsd.org/cgi/query-pr.cgi?pr=158936

Scot
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: [RFC] A trivial change for DESKTOP_ENTRIES (take 2)

2011-07-15 Thread Warren Block

On Fri, 15 Jul 2011, Scot Hetzel wrote:


2011/7/14 Pav Lucistnik p...@freebsd.org:

Stephen Montgomery-Smith píše v čt 14. 07. 2011 v 11:57 -0500:


entry.  I assume that the filename of the desktop entry is unimportant,


The filename of desktop entry should be 100% inconsequential, and our
only care should be not have two ports installing same file.


and is used only internally by Gnome or whatever.


Sounds like a bug to me.


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.


Yes, but is it worth the effort? Note you'll have to introduce it
somehow not to break existing ports.



How about something like this:

http://www.freebsd.org/cgi/query-pr.cgi?pr=158936


Wouldn't the point of using a separate filename argument be to let the 
user specify exactly what the name is?  Here you end up with the same 
system-processed filename.  Possibly I've misunderstood.


Apart from whether it's necessary, making the filename the last field 
would simplify the code.  Just .if defined(DESKTOP_ENTRIES) or 
defined(DESKTOP_ENTRIESv2) at the start of parameter processing, and a 
.if defined(DESKTOP_ENTRIESv2) section after it to override the 
filename.  It could also be made polymorphic, basing what it does on the 
number of fields rather than a new DESKTOP_ENTRIESv2 define.___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org

Re: [RFC] A trivial change for DESKTOP_ENTRIES (take 2)

2011-07-15 Thread Scot Hetzel
2011/7/15 Warren Block wbl...@wonkity.com:
 How about something like this:

 http://www.freebsd.org/cgi/query-pr.cgi?pr=158936

 Wouldn't the point of using a separate filename argument be to let the user
 specify exactly what the name is?  Here you end up with the same
 system-processed filename.  Possibly I've misunderstood.

The system-processed filename could be simplified for the
DESKTOP_ENTRIESv2 in install-desktop-entries to just

   filename=$$1

But then we would still need to add a check to check-desktop-entries
for DESKTOP_ENTRIESv2 that would detect illegal characters in the
filename.

 Apart from whether it's necessary, making the filename the last field would
 simplify the code.  Just .if defined(DESKTOP_ENTRIES) or
 defined(DESKTOP_ENTRIESv2) at the start of parameter processing, and a .if
 defined(DESKTOP_ENTRIESv2) section after it to override the filename.  It
 could also be made polymorphic, basing what it does on the number of fields
 rather than a new DESKTOP_ENTRIESv2 define.

That was my first ideal, but since the entire processing is done in a
@set ${DESKTOP_ENTRIES{,v2}} XXX ; while [$$# -gt {6,7}]; do
filename=$${4,1}... ; done loop, I wasn't sure how to change this
part.

Scot
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: [RFC] A trivial change for DESKTOP_ENTRIES (take 2)

2011-07-15 Thread Eitan Adler
 But then we would still need to add a check to check-desktop-entries
 for DESKTOP_ENTRIESv2 that would detect illegal characters in the
 filename.

Since this is not user settable IMHO the check should really be done
in portlint, not in b.p.m.

-- 
Eitan Adler
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: [RFC] A trivial change for DESKTOP_ENTRIES (take 2)

2011-07-15 Thread Chris Rees
On 15 Jul 2011 03:16, Stephen Montgomery-Smith step...@missouri.edu
wrote:

 On 07/14/2011 02:29 PM, Chris Rees wrote:


 On 14 Jul 2011 17:58, Stephen Montgomery-Smith step...@missouri.edu
 mailto:step...@missouri.edu wrote:
  Joe Average user who doesn't actually install the ports shouldn't be
 expected to read UPDATING.

 Er... he really should and is expected to.


 The situation I am thinking of is where a group all use FreeBSD.  One
person is responsible for installation and upkeep of the computers, and
everyone else just uses them (for example, they don't have root access).

 An example of this is the University of Missouri Math Dept about 10 years
ago.  We all used FreeBSD.  Now being Mathematicians, most of us didn't have
a clue about how it all worked inside.  Most of us wouldn't even understand
what the UPDATING entries mean.

 Since then, most of the Dept have moved to Windows or the Mac.  I am one
of the few who still uses FreeBSD.  So maybe you are correct after all -
only use FreeBSD if you are a power user.


No, I see your point now, and I'm sorry. I was surprised, because I wouldn't
have expected you to say reading updating was mandatory! Now I realise
that's not what you said.

I'll return to my cave.

Chris
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: [RFC] A trivial change for DESKTOP_ENTRIES (take 2)

2011-07-15 Thread Pav Lucistnik
Warren Block píše v pá 15. 07. 2011 v 07:15 -0600:

 It could also be made polymorphic, basing what it does on the 
 number of fields rather than a new DESKTOP_ENTRIESv2 define.

I believe that's impossible because you can create several desktop
entries by repeating the quadruple of values in this variable.
Quite similar to OPTIONS.

-- 
-- 
Pav Lucistnik p...@oook.cz
  p...@freebsd.org
... the obese drugged penguin used by Linux. -- Scott Long


signature.asc
Description: This is a digitally signed message part


Re: [RFC] A trivial change for DESKTOP_ENTRIES (take 2)

2011-07-15 Thread Warren Block

On Fri, 15 Jul 2011, Pav Lucistnik wrote:


Warren Block píše v pá 15. 07. 2011 v 07:15 -0600:


It could also be made polymorphic, basing what it does on the
number of fields rather than a new DESKTOP_ENTRIESv2 define.


I believe that's impossible because you can create several desktop
entries by repeating the quadruple of values in this variable.
Quite similar to OPTIONS.


It would be just like the error check at the start of the routine, look 
for an even multiple of 6 or 7 fields.


But that brings up another problem.  All desktop entries would have to 
be the same type.  Can't set the filename for one and leave the others 
alone.  Unless empty fields are used to mean a default filename, and 
that just makes it more complicated for a rare situation.


FWIW, I think the original code with a better regex like Jung-uk Kim has 
in http://lists.freebsd.org/pipermail/freebsd-ports/2011-July/068737.html 
is still the way to go.  If the port requires a special desktop entry 
filename, that seems beyond the scope of the DESKTOP_ENTRIES variable.


This all should be documented in the Porter's Handbook, and I'll 
volunteer to work on the DESKTOP_ENTRIES section once there's a decision 
on the code.___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org

Re: [RFC] A trivial change for DESKTOP_ENTRIES (take 2)

2011-07-15 Thread Stephen Montgomery-Smith

On 07/15/2011 04:57 PM, Warren Block wrote:


FWIW, I think the original code with a better regex like Jung-uk Kim has
in http://lists.freebsd.org/pipermail/freebsd-ports/2011-July/068737.html
is still the way to go.  If the port requires a special desktop entry
filename, that seems beyond the scope of the DESKTOP_ENTRIES variable.


I agree.  DESKTOP_ENTRIESv2 seems like a lot of work for just three ports.
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: [RFC] A trivial change for DESKTOP_ENTRIES (take 2)

2011-07-15 Thread Warren Block

On Fri, 15 Jul 2011, Stephen Montgomery-Smith wrote:


On 07/15/2011 04:57 PM, Warren Block wrote:


FWIW, I think the original code with a better regex like Jung-uk Kim has
in http://lists.freebsd.org/pipermail/freebsd-ports/2011-July/068737.html
is still the way to go.  If the port requires a special desktop entry
filename, that seems beyond the scope of the DESKTOP_ENTRIES variable.


I agree.  DESKTOP_ENTRIESv2 seems like a lot of work for just three ports.


It's not even three ports.  AFAIR, the only current port where it 
matters is x11-wm/compiz, the port that exposed the problem.  Allowing 
dashes fixes that.

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: [RFC] A trivial change for DESKTOP_ENTRIES (take 2)

2011-07-14 Thread Pav Lucistnik

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.

--
Pav Lucistnik p...@oook.cz
  p...@freebsd.org
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: [RFC] A trivial change for DESKTOP_ENTRIES (take 2)

2011-07-14 Thread Stephen Montgomery-Smith

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?
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: [RFC] A trivial change for DESKTOP_ENTRIES (take 2)

2011-07-14 Thread Jung-uk Kim
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 -   1.687
+++ Mk/bsd.port.mk  14 Jul 2011 17:26:43 -
@@ -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
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: [RFC] A trivial change for DESKTOP_ENTRIES (take 2)

2011-07-14 Thread Pav Lucistnik
Stephen Montgomery-Smith píše v čt 14. 07. 2011 v 11:57 -0500:

 entry.  I assume that the filename of the desktop entry is unimportant, 

The filename of desktop entry should be 100% inconsequential, and our
only care should be not have two ports installing same file.

 and is used only internally by Gnome or whatever.

Sounds like a bug to me.

 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.  

Yes, but is it worth the effort? Note you'll have to introduce it
somehow not to break existing ports.


-- 
-- 
Pav Lucistnik p...@oook.cz
  p...@freebsd.org
Cats happen.


signature.asc
Description: This is a digitally signed message part


Re: [RFC] A trivial change for DESKTOP_ENTRIES (take 2)

2011-07-14 Thread Stephen Montgomery-Smith

On 07/14/2011 12:47 PM, Jung-uk Kim wrote:


Anyhow, I guess we can do it much simpler:

--- Mk/bsd.port.mk  3 Jul 2011 15:51:18 -   1.687
+++ Mk/bsd.port.mk  14 Jul 2011 17:26:43 -
@@ -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


I agree.

What about dots at the beginning of the filename?

${SED} -E 's/[[:space:]]+.*//' -E 's/^\.+//'

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: [RFC] A trivial change for DESKTOP_ENTRIES (take 2)

2011-07-14 Thread Stephen Montgomery-Smith

On 07/14/2011 12:54 PM, Pav Lucistnik wrote:

Stephen Montgomery-Smith píše v čt 14. 07. 2011 v 11:57 -0500:


entry.  I assume that the filename of the desktop entry is unimportant,


The filename of desktop entry should be 100% inconsequential, and our
only care should be not have two ports installing same file.


and is used only internally by Gnome or whatever.


Sounds like a bug to me.


This means I am still not understanding it fully then.


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.


Yes, but is it worth the effort? Note you'll have to introduce it
somehow not to break existing ports.


I agree.  It is a lot of work.
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: [RFC] A trivial change for DESKTOP_ENTRIES (take 2)

2011-07-14 Thread Jung-uk Kim
On Thursday 14 July 2011 01:54 pm, Pav Lucistnik wrote:
 Stephen Montgomery-Smith p紫e v �t 14. 07. 2011 v 11:57 -0500:
  entry.  I assume that the filename of the desktop entry is
  unimportant,

 The filename of desktop entry should be 100% inconsequential, and
 our only care should be not have two ports installing same file.

I believe the original intention was to use executable name to make 
desktop file, i.e., ${PREFIX}/bin/foo - ${DESKTOPDIR}/foo.desktop.  
I understand your concerns but we only have to worry about two ports 
installing executables with a same name in two different directories 
and both having DESKTOP_ENTRIES.  I haven't seen such ports from our 
ports tree.  If there is, it should be fixed individually.  Or we may 
have to consider something totally radical.

  and is used only internally by Gnome or whatever.

 Sounds like a bug to me.

Why do you think there is a bug?  Basically, desktop files are 
meta-data for OSes which cannot handle extended attributes within a 
file (e.g., resource fork of Mac), if I understand it correctly.  I 
don't see anything wrong with GNOME referencing its window manager by 
desktop file name rather than by executable name with obscure 
options.

  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.

 Yes, but is it worth the effort? Note you'll have to introduce it
 somehow not to break existing ports.

DESKTOP_ENTRIES are for *basic* stuff and bsd.port.mk clearly says 
complex desktop files cannot use it:

Rules:
* Only add desktop entries for applications which do not
  require a terminal (ie. X applications).
* If the upstream distribution already installs .desktop
  files, you do not need to use this.
* If you require a more elaborate .desktop file than this
  variable permits, write it yourself and install it
  in ${DESKTOPDIR}.

The actual bug for bsd.port.mk was that it did not mention field 4 
Exec cannot contain '/' or any options, IMHO.

Jung-uk Kim
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: [RFC] A trivial change for DESKTOP_ENTRIES (take 2)

2011-07-14 Thread Jung-uk Kim
On Thursday 14 July 2011 01:55 pm, Stephen Montgomery-Smith wrote:
 On 07/14/2011 12:47 PM, Jung-uk Kim wrote:
  Anyhow, I guess we can do it much simpler:
 
  --- Mk/bsd.port.mk  3 Jul 2011 15:51:18 -   1.687
  +++ Mk/bsd.port.mk  14 Jul 2011 17:26:43 -
  @@ -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

 I agree.

I'll commit this version tomorrow unless I see more objection.

 What about dots at the beginning of the filename?

 ${SED} -E 's/[[:space:]]+.*//' -E 's/^\.+//'

I think mine's good enough. ;-)

Jung-uk Kim
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: [RFC] A trivial change for DESKTOP_ENTRIES (take 2)

2011-07-14 Thread Pav Lucistnik
Jung-uk Kim píše v čt 14. 07. 2011 v 15:07 -0400:

   entry.  I assume that the filename of the desktop entry is
   unimportant,
 
  The filename of desktop entry should be 100% inconsequential, and
  our only care should be not have two ports installing same file.
 
 I believe the original intention was to use executable name to make 
 desktop file, i.e., ${PREFIX}/bin/foo - ${DESKTOPDIR}/foo.desktop.  

Yes, and then came ports that needed to install several icons for same
executable, with different arguments. That was the reason for the
change.

   and is used only internally by Gnome or whatever.
 
  Sounds like a bug to me.
 
 Why do you think there is a bug?  Basically, desktop files are 
 meta-data for OSes which cannot handle extended attributes within a 

No, .desktop files are just gnomeish equivalent of windows .pif files.
If they are used for something more significant, that's poor design by
my standards. That's why I wanted to get an opinion from gnome team
before taking any steps on this issue.

 file (e.g., resource fork of Mac), if I understand it correctly.  I 
 don't see anything wrong with GNOME referencing its window manager by 
 desktop file name rather than by executable name with obscure 
 options.

If that .desktop file was that critical for GNOME functionality, then
why it is not installed by vendor Makefiles and have to be hacked in in
the port??

 DESKTOP_ENTRIES are for *basic* stuff and bsd.port.mk clearly says 
 complex desktop files cannot use it:

Yes but I see no need to abandon DESKTOP_ENTRIES for a simple port like
links..

-- 
-- 
Pav Lucistnik p...@oook.cz
  p...@freebsd.org
Ragtime contained about forty-five seconds of Elizabeth McGovern
completely topless, but it got a PG in 1980. I have no idea why that
did, or Titanic got PG-13, yet Merchant of Venice gets tagged with
an R. The MPAA is an intellectual and aesthetic embarassment. --
comment from IMDb board on US movie rating system


signature.asc
Description: This is a digitally signed message part


Re: [RFC] A trivial change for DESKTOP_ENTRIES (take 2)

2011-07-14 Thread Pav Lucistnik
Jung-uk Kim píše v čt 14. 07. 2011 v 15:15 -0400:
 On Thursday 14 July 2011 01:55 pm, Stephen Montgomery-Smith wrote:
  On 07/14/2011 12:47 PM, Jung-uk Kim wrote:
   Anyhow, I guess we can do it much simpler:
  
   --- Mk/bsd.port.mk  3 Jul 2011 15:51:18 -   1.687
   +++ Mk/bsd.port.mk  14 Jul 2011 17:26:43 -
   @@ -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
 
  I agree.
 
 I'll commit this version tomorrow unless I see more objection.

Eh, don't you need to get portmgr@ approval before touching bsd.port.mk
by any chance ???

I could support allowing dash as one extra allowed char, and having that
change exp-run'ed.

-- 
-- 
Pav Lucistnik p...@oook.cz
  p...@freebsd.org
 With a 10 MHz 386 the downloading speed would most likely drop  to a
crawl or stop with the decoding process etc. I think most 10MHz 386
users are quite accustomed to things dropping to a crawl.


signature.asc
Description: This is a digitally signed message part


Re: [RFC] A trivial change for DESKTOP_ENTRIES (take 2)

2011-07-14 Thread Chris Rees
On 14 Jul 2011 17:58, Stephen Montgomery-Smith step...@missouri.edu
wrote:
Joe Average user who doesn't actually install the ports shouldn't be
expected to read UPDATING.

Er... he really should and is expected to.

Chris
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: [RFC] A trivial change for DESKTOP_ENTRIES (take 2)

2011-07-14 Thread Jung-uk Kim
On Thursday 14 July 2011 03:15 pm, Pav Lucistnik wrote:
 Jung-uk Kim p紫e v �t 14. 07. 2011 v 15:07 -0400:
entry.  I assume that the filename of the desktop entry is
unimportant,
  
   The filename of desktop entry should be 100% inconsequential,
   and our only care should be not have two ports installing same
   file.
 
  I believe the original intention was to use executable name to
  make desktop file, i.e., ${PREFIX}/bin/foo -
  ${DESKTOPDIR}/foo.desktop.

 Yes, and then came ports that needed to install several icons for
 same executable, with different arguments. That was the reason for
 the change.

That had to be considered a bug for the ports, not for bsd.port.mk.  
As I said, the only bug in it was not describing limitations more 
clearly, IMHO.

and is used only internally by Gnome or whatever.
  
   Sounds like a bug to me.
 
  Why do you think there is a bug?  Basically, desktop files are
  meta-data for OSes which cannot handle extended attributes within
  a

 No, .desktop files are just gnomeish equivalent of windows .pif
 files.

.pif was a poor copycat of Mac's resource fork. ;-P

 If they are used for something more significant, that's poor design
 by my standards. That's why I wanted to get an opinion from gnome
 team before taking any steps on this issue. 

Poor design, maybe.  But what's your point, really?

  file (e.g., resource fork of Mac), if I understand it correctly. 
  I don't see anything wrong with GNOME referencing its window
  manager by desktop file name rather than by executable name with
  obscure options.

 If that .desktop file was that critical for GNOME functionality,
 then why it is not installed by vendor Makefiles and have to be
 hacked in in the port??

You mean x11-wm/compiz?  As far as I know, many Linux distros 
install their own customized .desktop files.  As such, often times 
vendors don't install it by default.

  DESKTOP_ENTRIES are for *basic* stuff and bsd.port.mk clearly
  says complex desktop files cannot use it:

 Yes but I see no need to abandon DESKTOP_ENTRIES for a simple port
 like links..

Please let the maintainers decide.

Jung-uk Kim
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: [RFC] A trivial change for DESKTOP_ENTRIES (take 2)

2011-07-14 Thread Stephen Montgomery-Smith

On 07/14/2011 02:29 PM, Chris Rees wrote:


On 14 Jul 2011 17:58, Stephen Montgomery-Smith step...@missouri.edu
mailto:step...@missouri.edu wrote:
 Joe Average user who doesn't actually install the ports shouldn't be
expected to read UPDATING.

Er... he really should and is expected to.


The situation I am thinking of is where a group all use FreeBSD.  One 
person is responsible for installation and upkeep of the computers, and 
everyone else just uses them (for example, they don't have root access).


An example of this is the University of Missouri Math Dept about 10 
years ago.  We all used FreeBSD.  Now being Mathematicians, most of us 
didn't have a clue about how it all worked inside.  Most of us wouldn't 
even understand what the UPDATING entries mean.


Since then, most of the Dept have moved to Windows or the Mac.  I am one 
of the few who still uses FreeBSD.  So maybe you are correct after all - 
only use FreeBSD if you are a power user.


Stephen
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to freebsd-ports-unsubscr...@freebsd.org


Re: [RFC] A trivial change for DESKTOP_ENTRIES (take 2)

2011-07-13 Thread Jung-uk Kim
On Tuesday 12 July 2011 06: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.

Please review the revised patches.

bsd.port.mk.diff:
- Allow '-' and '_' in desktop file names for DESKTOP_ENTRIES.
- Apply basename(1) on Exec to remove directory structure when desktop 
file names are made.
- Add a comment about Exec limitations.

links.diff, metalink-editor.diff, tome.diff:
- Add static desktop files to work around DESKTOP_ENTRIES limitations.

Ultimately, we may have to consider adding an additional field in 
DESKTOP_ENTRIES for its file name.

These patches are also available from here:

http://people.freebsd.org/~jkim/bsd.port.mk.diff
http://people.freebsd.org/~jkim/links.diff
http://people.freebsd.org/~jkim/metalink-editor.diff
http://people.freebsd.org/~jkim/tome.diff

Thanks,

Jung-uk Kim
Index: Mk/bsd.port.mk
===
RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.687
diff -u -r1.687 bsd.port.mk
--- Mk/bsd.port.mk  3 Jul 2011 15:51:18 -   1.687
+++ Mk/bsd.port.mk  13 Jul 2011 22:33:56 -
@@ -1064,7 +1064,9 @@
 #If the deduction fails, you will have 
to set Categories
 #manually. You should check the 
generated value using
 #make desktop-categories, and 
override it if necessary.
-#  * Exec will also be used to name the 
.desktop file.
+#  * Exec will also be used to name the 
.desktop file.  Only
+#alphanumeric characters, -, and _ 
are allowed after
+#basename(1) is executed on it.
 #  * The files will be automatically added 
to ${PLIST}.
 #Example:
 #  X Window Information \
@@ -6389,6 +6391,11 @@
if [ -z $$4 ]; then \
${ECHO_MSG} ${PKGNAME}: Makefile error: in desktop 
entry $$entry: field 4 (Exec) is empty; \
exit 1; \
+   else \
+   if [ -n `${BASENAME} $$4 | ${TR} -d '[:alnum:]-_'` 
]; then \
+   ${ECHO_CMD} ${PKGNAME}: Makefile error: in 
desktop entry $$entry: field 4 (Exec) has a disallowed character; \
+   exit 1; \
+   fi; \
fi; \
if [ -n $$5 ]; then \
for c in `${ECHO_CMD} $$5 | ${TR} ';' ' '`; do \
@@ -6432,7 +6439,7 @@
${ECHO_CMD} @cwd ${DESKTOPDIR}  ${TMPPLIST}; \
fi; \
while [ $$# -gt 6 ]; do \
-   filename=`${ECHO_CMD} $$4 | ${TR} -cd [:alnum:]`.desktop; \
+   filename=`${BASENAME} $$4`.desktop; \
pathname=${DESKTOPDIR}/$$filename; \
categories=$$5; \
if [ -z $$categories ]; then \
Index: games/tome/Makefile
===
RCS file: /home/pcvs/ports/games/tome/Makefile,v
retrieving revision 1.21
diff -u -r1.21 Makefile
--- games/tome/Makefile 25 Jan 2010 22:49:44 -  1.21
+++ games/tome/Makefile 13 Jul 2011 22:33:56 -
@@ -7,7 +7,7 @@
 
 PORTNAME=  tome
 PORTVERSION=   2.3.5
-PORTREVISION=  1
+PORTREVISION=  2
 CATEGORIES=games
 MASTER_SITES=  http://t-o-m-e.net/dl/src/
 DISTNAME=  tome-235-src
@@ -15,7 +15,7 @@
 MAINTAINER=po...@freebsd.org
 COMMENT=   Roguelike dungeon exploration game based on JRR Tolkien's works
 
-SUB_FILES= pkg-deinstall
+SUB_FILES= pkg-deinstall tome.desktop
 
 ALL_TARGET=# empty
 MAKEFILE=  makefile.bsd
@@ -24,10 +24,6 @@
 WRKSRC=${WRKDIR}/${DISTNAME}/src
 
 OPTIONS=   X11 Turn on support for X on
-DESKTOP_ENTRIES=   ToME Roguelike game based on JRR Tolkien's work \
-   ${DATADIR}/xtra/graf/tome-128.png \
-   tome -v -g Application;Game;RolePlaying; \
-   false
 
 .include bsd.port.pre.mk
 
@@ -43,4 +39,8 @@
${REINPLACE_CMD} -e 's@-I$$(LOCALBASE)/include@@g' ${WRKSRC}/${MAKEFILE}
 .endif