public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] comments on portage.keywords
@ 2009-09-15 19:55 Crístian Viana
  2009-09-15 20:12 ` Neil Walker
  0 siblings, 1 reply; 6+ messages in thread
From: Crístian Viana @ 2009-09-15 19:55 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 817 bytes --]

hi,

I have a Gentoo amd64 and I noticed portage doesn't ignore comments totally
on the file /etc/portage/package.keywords (don't know about the other
portage config files). if I have the following line on portage.keywords:

www-client/mozilla-firefox

portage unmasks the Firefox ebuild for my architecture. but if I have:

www-client/mozilla-firefox # hello world

portage doesn't unmask this ebuild. if I want to put a comment at the end of
a line in this file [and I want that line to work], I have to explicitly add
the architecture flag:

www-client/mozilla-firefox ~amd64 # hello world

I don't think this behavior is consistent, comments shouldn't matter. is
that a desirable feature or a bug?

see ya,

-- 
Crístian Deives dos Santos Viana [aka CD1]
Sent from Campinas, SP, Brazil

[-- Attachment #2: Type: text/html, Size: 896 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] comments on portage.keywords
  2009-09-15 19:55 [gentoo-user] comments on portage.keywords Crístian Viana
@ 2009-09-15 20:12 ` Neil Walker
  2009-09-15 20:17   ` Crístian Viana
  0 siblings, 1 reply; 6+ messages in thread
From: Neil Walker @ 2009-09-15 20:12 UTC (permalink / raw
  To: gentoo-user

Crístian Viana wrote:
> www-client/mozilla-firefox # hello world

For it to be a valid comment, the '#' MUST be the first character on the
line. That's always been the convention. A FEW programs will recognise
the '#' elsewhere in the line as the start of the comment but you should
NEVER EVER rely upon that.

> I don't think this behavior is consistent, comments shouldn't matter.
> is that a desirable feature or a bug?

It's totally consistent and highly desirable.


Be lucky,

Neil
http://www.neiljw.com





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] comments on portage.keywords
  2009-09-15 20:12 ` Neil Walker
@ 2009-09-15 20:17   ` Crístian Viana
  2009-09-15 20:49     ` Neil Bothwick
  0 siblings, 1 reply; 6+ messages in thread
From: Crístian Viana @ 2009-09-15 20:17 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 844 bytes --]

thank you, I didn't know about that. I thought comments were always stripped
off the contents of the config files, no matter where they were.

On Tue, Sep 15, 2009 at 5:12 PM, Neil Walker <neil@ep.mine.nu> wrote:

> Crístian Viana wrote:
> > www-client/mozilla-firefox # hello world
>
> For it to be a valid comment, the '#' MUST be the first character on the
> line. That's always been the convention. A FEW programs will recognise
> the '#' elsewhere in the line as the start of the comment but you should
> NEVER EVER rely upon that.
>
> > I don't think this behavior is consistent, comments shouldn't matter.
> > is that a desirable feature or a bug?
>
> It's totally consistent and highly desirable.
>
>
> Be lucky,
>
> Neil
> http://www.neiljw.com
>
>
>
>


-- 
Crístian Deives dos Santos Viana [aka CD1]

[-- Attachment #2: Type: text/html, Size: 1305 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] comments on portage.keywords
  2009-09-15 20:17   ` Crístian Viana
@ 2009-09-15 20:49     ` Neil Bothwick
  2009-09-16  2:14       ` Crístian Viana
  0 siblings, 1 reply; 6+ messages in thread
From: Neil Bothwick @ 2009-09-15 20:49 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 480 bytes --]

On Tue, 15 Sep 2009 17:17:51 -0300, Crístian Viana wrote:

> thank you, I didn't know about that. I thought comments were always
> stripped off the contents of the config files, no matter where they
> were.

Title="### Look at me! ###"

Is there a comment in there? The general convention is that if the first
non-whitespace character is a #, the line is a comment.


-- 
Neil Bothwick

With 5 billion people on earth chances are slim it will ever be *your*
day.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] comments on portage.keywords
  2009-09-15 20:49     ` Neil Bothwick
@ 2009-09-16  2:14       ` Crístian Viana
  2009-09-16  7:34         ` Alan McKinnon
  0 siblings, 1 reply; 6+ messages in thread
From: Crístian Viana @ 2009-09-16  2:14 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 920 bytes --]

but in that case the "#" character is inside a string, so it wuldn't be
considered a comment. I was thinking like "//" in Java: it can be anywhere
in the line, but if it's inside a string it's not considered a comment
marker.

but thanks again for the information :)

On Tue, Sep 15, 2009 at 5:49 PM, Neil Bothwick <neil@digimed.co.uk> wrote:

> On Tue, 15 Sep 2009 17:17:51 -0300, Crístian Viana wrote:
>
> > thank you, I didn't know about that. I thought comments were always
> > stripped off the contents of the config files, no matter where they
> > were.
>
> Title="### Look at me! ###"
>
> Is there a comment in there? The general convention is that if the first
> non-whitespace character is a #, the line is a comment.
>
>
> --
> Neil Bothwick
>
> With 5 billion people on earth chances are slim it will ever be *your*
> day.
>



-- 
Crístian Deives dos Santos Viana [aka CD1]

[-- Attachment #2: Type: text/html, Size: 1342 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] comments on portage.keywords
  2009-09-16  2:14       ` Crístian Viana
@ 2009-09-16  7:34         ` Alan McKinnon
  0 siblings, 0 replies; 6+ messages in thread
From: Alan McKinnon @ 2009-09-16  7:34 UTC (permalink / raw
  To: gentoo-user

On Wednesday 16 September 2009 04:14:59 Crístian Viana wrote:
> but in that case the "#" character is inside a string, so it wuldn't be
> considered a comment. I was thinking like "//" in Java: it can be anywhere
> in the line, but if it's inside a string it's not considered a comment
> marker.
> 
> but thanks again for the information :)

To deal with a hash anywhere, you need a complex language parser and probably 
a full blown tokenizer like compilers have to implement.

This is decidedly non-trivial.

Java is a freeform language, the location of line breaks does not really 
matter. Config files are very different beasts, they are very much line 
oriented - one setting per line. Think like grep, it deals with a line at a 
time.

So the easiest implementation by far is the comment marker must be the first 
non-whitespace character, other wise it isn't a comment. That one step can 
make most of your config file bugs never happen, just like that.

-- 
alan dot mckinnon at gmail dot com



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-09-16  7:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-15 19:55 [gentoo-user] comments on portage.keywords Crístian Viana
2009-09-15 20:12 ` Neil Walker
2009-09-15 20:17   ` Crístian Viana
2009-09-15 20:49     ` Neil Bothwick
2009-09-16  2:14       ` Crístian Viana
2009-09-16  7:34         ` Alan McKinnon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox