Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 233816 - use.local.desc is b0rkened wrt whitespace
Summary: use.local.desc is b0rkened wrt whitespace
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Alec Warner (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-03 16:04 UTC by Fabian Groffen
Modified: 2008-09-13 15:16 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for use_desc_gen.diff (use_desc_gen.diff,499 bytes, patch)
2008-08-04 14:22 UTC, Ulrich Müller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Groffen gentoo-dev 2008-08-03 16:04:17 UTC
ps, you guys introduce a lot of crap in package.local.use
[5:46pm] <grobian>
many words are being glued together, where they previously were split
[5:46pm] <grobian>
also double spaces and that stuff
[5:47pm] <ulm>
grobian: you have an example?
[5:47pm] <ulm>
it shouldn't be like that
[5:47pm] » nerdboy 
pokes at the mail server with a sharp stick
[5:48pm] <grobian>
ulm: enjoy http://overlays.gentoo.org/proj/alt/changeset?new=trunk%2Fprefix-overlay%2Fprofiles%2Fuse.local.desc%4028893&old=trunk%2Fprefix-overlay%2Fprofiles%2Fuse.local.desc%4028795
[5:48pm] <grobian>
like dar, and app-cdr/mybashburn
[5:49pm] <grobian>
app-cdr/disc-cover
[5:49pm] <grobian>
plenty
[5:49pm] <grobian>
app-crypt/gnupg:openct is a nice one too
[5:49pm] <grobian>
(while I admit the last one could be a real fix)
[5:52pm] <ulm>
grobian: I agree that this is not right
[5:52pm] <ulm>
antarus: ping
[5:52pm] <ulm>
antarus: ^^
[5:54pm] <ulm>
grobian: I guess the issue is that the flag descriptions in metadata contain line breaks now
[5:54pm] <ulm>
and these are not converted properly by the script
[5:55pm] <ulm>
I guess <newline><whitespace> should be converted to a single space
[5:56pm] <grobian>
ulm: sounds reasonable, but you guys should pay more attention, instead of rely on lunatics that review like 1/3th of the entire tree ;)
[5:58pm] <ulm>
grobian: can you file a bug for the whitespace issue?
[5:59pm] <darksiide>
ulm: is that file script generated now?
[5:59pm]
EvaSDK betrad het kanaal.
[5:59pm] <grobian>
ulm: do I really have to?
[6:00pm]
je_fro betrad het kanaal.
[6:01pm] <grobian>
ulm: assign to who?
[6:01pm] <ulm>
grobian: assign to antarus
[6:02pm] <ulm>
darksiide: for the converted categories, yes
[6:02pm] <darksiide>
ah
[6:03pm] <ulm>
grobian: and put cardoe in CC ;)
Comment 1 Ulrich Müller gentoo-dev 2008-08-04 14:22:29 UTC
Created attachment 162200 [details, diff]
Patch for use_desc_gen.diff

Attached patch will fix the line break problem by converting any amount of whitespace to a single blank.
Comment 2 Ulrich Müller gentoo-dev 2008-08-07 06:06:43 UTC
There is another whitespace problem with <pkg> tags, see for example app-text/sword:

<use>
  <flag name='icu'>Enable <pkg>dev-libs/icu</pkg> support for sword</flag>
  <flag name='lucene'>Enable lucene support for faster searching
    (<pkg>dev-cpp/clucene</pkg>)</flag>
</use>

This is converted to the following in use.local.desc:

app-text/sword:icu - Enable dev-libs/icusupport for sword
app-text/sword:lucene - Enable lucene support for faster searching
( dev-cpp/clucene)

The first description misses a blank after the pkg name, while for the second one a spurious blank is inserted before.
Comment 3 Alec Warner (RETIRED) archtester gentoo-dev Security 2008-08-07 06:34:33 UTC
There was a use case for adding spaces before <pkg> declarations; let me see if I wrote down what it was.

-Alec
Comment 4 Alec Warner (RETIRED) archtester gentoo-dev Security 2008-08-12 18:04:38 UTC
Fixed in CVS..I think ;)
Comment 5 Fabian Groffen gentoo-dev 2008-08-16 09:05:09 UTC
in today's diff:

+ x11-libs/wxGTK:gnome -  Use gnome-base/libgnomeprintui for printing tasks. 
+ x11-libs/wxGTK:gstreamer -  Enable the wxMediaCtrl class for playing audio    and video through gstreamer. 
+ x11-libs/wxGTK:sdl -  Use Simple Directmedia Layer (media-libs/libsdl) for    audio. 

(note: two spaces after the hyphen)
Comment 6 Doug Goldstein (RETIRED) gentoo-dev 2008-08-16 23:17:15 UTC
I think it's do to the 3 different types of spaces in the actual metadata.xml file. There's a newline, some tabs, and some spaces before the actual data.
Comment 7 Fabian Groffen gentoo-dev 2008-08-17 09:32:55 UTC
since it's computer generated code, I thought doing a .strip() would just give some consistency in the use.local.desc file...
Comment 8 Alec Warner (RETIRED) archtester gentoo-dev Security 2008-08-20 17:57:49 UTC
(In reply to comment #7)
> since it's computer generated code, I thought doing a .strip() would just give
> some consistency in the use.local.desc file...
> 

If you strip leading spaces you end up with <pkg> tags that run into other items:

<pkg1>, <pkg2>, <pkg> becomes
pkg1,pkg2,pkg3

It would be easier to just stick to spaces in the metadata.xml (2 spaces? 4? tabs?)

-Alec
Comment 9 Fabian Groffen gentoo-dev 2008-08-20 18:03:21 UTC
Gentoo uses tabs everywhere, I never got why people have to use spaces with xml.  It would be a lot more consistent if metadata.xml just used tabs (and proper indenting!!!)