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

2011-07-13 Thread Matthias Andree
Am 13.07.2011 00:25, schrieb Jung-uk Kim:
 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?

The dot should also be allowed, to cover the POSIX portable filename
character set altogether.

-- 
Matthias Andree
___
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

2011-07-13 Thread Pav Lucistnik

On 2011/07/13 00:25, 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?


Shouldn't you fix whatever is trying to call compizmanager not to use 
.desktop file instead?


--
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

2011-07-13 Thread Jung-uk Kim
On Wednesday 13 July 2011 07:39 am, Pav Lucistnik wrote:
 On 2011/07/13 00:25, 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?

 Shouldn't you fix whatever is trying to call compizmanager not to
 use .desktop file instead?

GNOME session manager calls the compiz-manager, i.e., the user has to 
change it manually.  Actually, x11-wm/compiz/pkg-message recommended 
this:

If you are using gnome, you can use the configuration editor to set 
the value of:

desktop-gnome-session-required_components-windowmanager = 
compiz-manager
^^

This will enable compiz as your default window manager.

I am quite sure there are similar instructions on the net.

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

2011-07-13 Thread Jung-uk Kim
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
diff -u bsd.port.mk-orig bsd.port.mk
--- bsd.port.mk-orig2011-07-13 03:48:35.0 +
+++ bsd.port.mk 2011-07-13 04:04:14.0 +
@@ -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 \

___
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

2011-07-13 Thread Stephen Montgomery-Smith

On 07/13/2011 10:41 AM, Jung-uk Kim wrote:

On Wednesday 13 July 2011 07:39 am, Pav Lucistnik wrote:

On 2011/07/13 00:25, 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?


Shouldn't you fix whatever is trying to call compizmanager not to
use .desktop file instead?


GNOME session manager calls the compiz-manager, i.e., the user has to
change it manually.  Actually, x11-wm/compiz/pkg-message recommended
this:

If you are using gnome, you can use the configuration editor to set
the value of:

desktop-gnome-session-required_components-windowmanager =
compiz-manager
^^

This will enable compiz as your default window manager.

I am quite sure there are similar instructions on the net.

Jung-uk Kim


Also, bsd.ports.mk shouldn't change what the port tells it to do, 
without informing anybody.


I'm sure it took Jung-uk Kim many hours to figure out why it wasn't 
working.  Other users are going to be in a similar spot.  Many users 
will never figure it out.



___
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

2011-07-13 Thread Stephen Montgomery-Smith

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.


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;
___
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

2011-07-13 Thread Stephen Montgomery-Smith

On 07/13/2011 11:59 AM, 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.

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;


Oh, and use ${GREP} and ${ECHO_CMD} instead of echo and grep.  And maybe 
the -E is unnecessary.

___
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

2011-07-13 Thread Jung-uk Kim
On Wednesday 13 July 2011 12:42 pm, Stephen Montgomery-Smith wrote:
 On 07/13/2011 10:41 AM, Jung-uk Kim wrote:
  On Wednesday 13 July 2011 07:39 am, Pav Lucistnik wrote:
  On 2011/07/13 00:25, 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?
 
  Shouldn't you fix whatever is trying to call compizmanager not
  to use .desktop file instead?
 
  GNOME session manager calls the compiz-manager, i.e., the user
  has to change it manually.  Actually, x11-wm/compiz/pkg-message
  recommended this:
 
  If you are using gnome, you can use the configuration editor to
  set the value of:
 
  desktop-gnome-session-required_components-windowmanager =
  compiz-manager
  ^^
 
  This will enable compiz as your default window manager.
 
  I am quite sure there are similar instructions on the net.
 
  Jung-uk Kim

 Also, bsd.ports.mk shouldn't change what the port tells it to do,
 without informing anybody.

Exactly.

 I'm sure it took Jung-uk Kim many hours to figure out why it wasn't
 working.  Other users are going to be in a similar spot.  Many
 users will never figure it out.

Sh...  Please don't tell it to my employee. ;-P

It only took me about 1/2 hour.  But you're right; average users may 
misinterpret unrelated commits (such as yours) and think it broke 
their desktop environment after updating ports.

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

2011-07-13 Thread Jung-uk Kim
On Wednesday 13 July 2011 01:04 pm, Jung-uk Kim wrote:
 On Wednesday 13 July 2011 12:42 pm, Stephen Montgomery-Smith wrote:
  On 07/13/2011 10:41 AM, Jung-uk Kim wrote:
   On Wednesday 13 July 2011 07:39 am, Pav Lucistnik wrote:
   On 2011/07/13 00:25, 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.di
  ff ?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?
  
   Shouldn't you fix whatever is trying to call compizmanager not
   to use .desktop file instead?
  
   GNOME session manager calls the compiz-manager, i.e., the user
   has to change it manually.  Actually, x11-wm/compiz/pkg-message
   recommended this:
  
   If you are using gnome, you can use the configuration editor
   to set the value of:
  
   desktop-gnome-session-required_components-windowmanager =
   compiz-manager
   ^^
  
   This will enable compiz as your default window manager.
  
   I am quite sure there are similar instructions on the net.
  
   Jung-uk Kim
 
  Also, bsd.ports.mk shouldn't change what the port tells it to do,
  without informing anybody.

 Exactly.

  I'm sure it took Jung-uk Kim many hours to figure out why it
  wasn't working.  Other users are going to be in a similar spot. 
  Many users will never figure it out.

 Sh...  Please don't tell it to my employee. ;-P

employer
I am not there yet. :-(

Jung-uk Kim

 It only took me about 1/2 hour.  But you're right; average users
 may misinterpret unrelated commits (such as yours) and think it
 broke their desktop environment after updating 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

2011-07-13 Thread Jung-uk Kim
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;
___
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

2011-07-13 Thread Stephen Montgomery-Smith

On 07/13/2011 12:04 PM, Jung-uk Kim wrote:

On Wednesday 13 July 2011 12:42 pm, Stephen Montgomery-Smith wrote:



I'm sure it took Jung-uk Kim many hours to figure out why it wasn't
working.  Other users are going to be in a similar spot.  Many
users will never figure it out.


Sh...  Please don't tell it to my employee. ;-P

It only took me about 1/2 hour.  But you're right; average users may
misinterpret unrelated commits (such as yours) and think it broke
their desktop environment after updating ports.



And if you hadn't figured it out, you would have emailed me asking me 
how I broke compiz.  There is no way I would have figured it out, 
because I can't get compiz to work on my system anyway.  So I would have 
emailed the submitter of the PR.  And I don't think he would have 
figured it out either.


So then we would have reverted the commit.  Then you would have found 
out that it still didn't work.  And then we would be truly mystified.


This could have turned into a disaster.

___
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

2011-07-13 Thread Jung-uk Kim
On Wednesday 13 July 2011 01:04 pm, Stephen Montgomery-Smith wrote:
 On 07/13/2011 11:59 AM, Stephen Montgomery-Smith wrote:
  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;

 Oh, and use ${GREP} and ${ECHO_CMD} instead of echo and grep.  And
 maybe the -E is unnecessary.

If we actually do exit 1;, I'd prefer something like that, too.

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

2011-07-13 Thread Jung-uk Kim
On Wednesday 13 July 2011 01:23 pm, Jung-uk Kim wrote:
 On Wednesday 13 July 2011 01:04 pm, Stephen Montgomery-Smith wrote:
  On 07/13/2011 11:59 AM, Stephen Montgomery-Smith wrote:
   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;
 
  Oh, and use ${GREP} and ${ECHO_CMD} instead of echo and grep. 
  And maybe the -E is unnecessary.

 If we actually do exit 1;, I'd prefer something like that, too.

Actually, this must be moved to 'check-desktop-entries' target, I 
believe.

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

2011-07-13 Thread Stephen Montgomery-Smith

On 07/13/2011 12:26 PM, Jung-uk Kim wrote:

On Wednesday 13 July 2011 01:23 pm, Jung-uk Kim wrote:

On Wednesday 13 July 2011 01:04 pm, Stephen Montgomery-Smith wrote:

On 07/13/2011 11:59 AM, Stephen Montgomery-Smith wrote:

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;


Oh, and use ${GREP} and ${ECHO_CMD} instead of echo and grep.
And maybe the -E is unnecessary.


If we actually do exit 1;, I'd prefer something like that, too.


Actually, this must be moved to 'check-desktop-entries' target, I
believe.



Yes, that seems to be the right place.  And the code there is so full of 
exit 1's that one more won't be noticed.

___
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

2011-07-13 Thread Jung-uk Kim
On Wednesday 13 July 2011 06:42 am, Matthias Andree wrote:
 Am 13.07.2011 00:25, schrieb Jung-uk Kim:
  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?

 The dot should also be allowed, to cover the POSIX portable
 filename character set altogether.

I liked the idea first.  Then, I realized that we have to add more 
sanity checks, e.g., ., .., .foo, etc.

Sorry,

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

2011-07-13 Thread Pav Lucistnik
Jung-uk Kim píše v st 13. 07. 2011 v 11:41 -0400:
 On Wednesday 13 July 2011 07:39 am, Pav Lucistnik wrote:
  On 2011/07/13 00:25, 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?
 
  Shouldn't you fix whatever is trying to call compizmanager not to
  use .desktop file instead?
 
 GNOME session manager calls the compiz-manager, i.e., the user has to 
 change it manually.  Actually, x11-wm/compiz/pkg-message recommended 
 this:
 
 If you are using gnome, you can use the configuration editor to set 
 the value of:
 
 desktop-gnome-session-required_components-windowmanager = 
 compiz-manager
 ^^
 
 This will enable compiz as your default window manager.

What does the gnome@ people said about this whole issue?

-- 
-- 
Pav Lucistnik p...@oook.cz
  p...@freebsd.org
KDE is for the techies who feel they can't be productive without being
able to control the exact amount of bevel in their window frames in 2%
increments.


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


Re: [RFC] A trivial change for DESKTOP_ENTRIES

2011-07-13 Thread Stephen Montgomery-Smith

On 07/13/2011 02:35 PM, Jung-uk Kim wrote:

On Wednesday 13 July 2011 06:42 am, Matthias Andree wrote:

Am 13.07.2011 00:25, schrieb Jung-uk Kim:

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?


The dot should also be allowed, to cover the POSIX portable
filename character set altogether.


I liked the idea first.  Then, I realized that we have to add more
sanity checks, e.g., ., .., .foo, etc.

Sorry,

Jung-uk Kim


The extra sanity check seems to add very little overhead:

if (echo $$4 | grep ^\..*  /dev/null) \
|| (echo $$4 | grep [^[:alnum:]_.-]  /dev/null); then \
echo blah blah; \
fi

And . are very common in filenames.
___
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

2011-07-13 Thread Jung-uk Kim
On Wednesday 13 July 2011 05:10 pm, Stephen Montgomery-Smith wrote:
 On 07/13/2011 02:35 PM, Jung-uk Kim wrote:
  On Wednesday 13 July 2011 06:42 am, Matthias Andree wrote:
  Am 13.07.2011 00:25, schrieb Jung-uk Kim:
  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?
 
  The dot should also be allowed, to cover the POSIX portable
  filename character set altogether.
 
  I liked the idea first.  Then, I realized that we have to add
  more sanity checks, e.g., ., .., .foo, etc.
 
  Sorry,
 
  Jung-uk Kim

 The extra sanity check seems to add very little overhead:

 if (echo $$4 | grep ^\..*  /dev/null) \

   || (echo $$4 | grep [^[:alnum:]_.-]  /dev/null); then \

  echo blah blah; \
 fi

 And . are very common in filenames.

Some times '.' and '..' are very hard to deal with. :-(

After I applied sanity checks, I only found one port that contains '.' 
in Exec, i.e., misc/metalink-editor, which has metalink_editer.py 
as an executable name.  So, I concluded it isn't very useful check 
while it is error-prone.

There are two ports that contains spaces:

games/tome: tome -v -g
www/links:  links -g

These can be easily fixable by adding static desktop files.  Other 
failures are caused by / in their Execs, which is also very valid.  
Currently, these ports create very ugly desktop files, e.g., 
usrlocalbinfoo.desktop.  This problem is also easily fixable, i.e., 
s/ECHO_CMD/BASENAME/.  I believe it must be fixed regardless.

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

2011-07-13 Thread Stephen Montgomery-Smith

On 07/13/2011 05:06 PM, Jung-uk Kim wrote:

On Wednesday 13 July 2011 05:10 pm, Stephen Montgomery-Smith wrote:

On 07/13/2011 02:35 PM, Jung-uk Kim wrote:

On Wednesday 13 July 2011 06:42 am, Matthias Andree wrote:

Am 13.07.2011 00:25, schrieb Jung-uk Kim:

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?


The dot should also be allowed, to cover the POSIX portable
filename character set altogether.


I liked the idea first.  Then, I realized that we have to add
more sanity checks, e.g., ., .., .foo, etc.

Sorry,

Jung-uk Kim


The extra sanity check seems to add very little overhead:

if (echo $$4 | grep ^\..*  /dev/null) \

|| (echo $$4 | grep [^[:alnum:]_.-]   /dev/null); then \

  echo blah blah; \
fi

And . are very common in filenames.


Some times '.' and '..' are very hard to deal with. :-(


The only other way I can think of in which .'s can appear in a 
filename in a bad way is via xxx/../../../../../backdoor.  But you are 
eliminating the /'s.



After I applied sanity checks  


...but I respect your opinion because you did all this work checking it.

Are you going to check with gnomes@ as Pav suggested?
___
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
 

[RFC] A trivial change for DESKTOP_ENTRIES

2011-07-12 Thread Jung-uk Kim
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
Index: bsd.port.mk
===
RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.687
diff -u -r1.687 bsd.port.mk
--- bsd.port.mk 3 Jul 2011 15:51:18 -   1.687
+++ bsd.port.mk 12 Jul 2011 21:58:02 -
@@ -6432,7 +6432,7 @@
${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; \
pathname=${DESKTOPDIR}/$$filename; \
categories=$$5; \
if [ -z $$categories ]; then \
___
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

2011-07-12 Thread Stephen Montgomery-Smith

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


It sounds like a good idea to me.
___
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

2011-07-12 Thread Warren Block

On Tue, 12 Jul 2011, 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


My fault, arising out of 
http://www.freebsd.org/cgi/query-pr.cgi?pr=147701


Additionally allowing dashes and underlines seems harmless.  Spaces and 
disallowed characters like slashes were the original concern.

___
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

2011-07-12 Thread Stephen Montgomery-Smith

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.


diff -u bsd.port.mk-orig bsd.port.mk
--- bsd.port.mk-orig2011-07-13 03:48:35.0 +
+++ bsd.port.mk 2011-07-13 04:04:14.0 +
@@ -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 \

___
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

2011-07-12 Thread Doug Barton
On 07/12/2011 21:08, Stephen Montgomery-Smith wrote:
 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 was thinking along similar lines. My concern would be that if the
change to allow - and _ is done silently that it will break plists.


Doug

-- 

Nothin' ever doesn't change, but nothin' changes much.
-- OK Go

Breadth of IT experience, and depth of knowledge in the DNS.
Yours for the right price.  :)  http://SupersetSolutions.com/

___
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

2011-07-12 Thread Stephen Montgomery-Smith

On 07/12/2011 11:17 PM, Doug Barton wrote:

On 07/12/2011 21:08, Stephen Montgomery-Smith wrote:

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 was thinking along similar lines. My concern would be that if the
change to allow - and _ is done silently that it will break plists.




I don't see how it can break plists - a few lines later (around line 
6440), bsd.port.mk dynamically generates the entries for plist from 
$filename.

___
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

2011-07-12 Thread Doug Barton
On 07/12/2011 21:29, Stephen Montgomery-Smith wrote:
 On 07/12/2011 11:17 PM, Doug Barton wrote:
 On 07/12/2011 21:08, Stephen Montgomery-Smith wrote:
 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 was thinking along similar lines. My concern would be that if the
 change to allow - and _ is done silently that it will break plists.


 
 I don't see how it can break plists - a few lines later (around line
 6440), bsd.port.mk dynamically generates the entries for plist from
 $filename.

Ah, never mind then. :)



-- 

Nothin' ever doesn't change, but nothin' changes much.
-- OK Go

Breadth of IT experience, and depth of knowledge in the DNS.
Yours for the right price.  :)  http://SupersetSolutions.com/

___
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