On my system I have all my use flags split over a few lines. The syntax I use is like this: USE="flag1 flag2 flag3 flag4.... " USE="${USE} flagN flagN+1 flagN+2" and so on. However, running euse -c only shows the first line. Wouldn't it be better if the parse_make function instead of manually parsing make.conf, simply did something like: my $use_var = `. /etc/make.conf; echo -n \$USE`; $use_var =~ s/\s+/ /gs; # the above would also catch the case when there are consecutive # spaces @site_uf_list = split(' ', $use_var); The currently used regexp $lines =~ m/^\s*USE[\s\n]*=[\s\n]*"([^"]*)"/ms heavily depends on a predefined syntax, and this syntax may not be the syntax everyone uses. What if I am not using quotes, but simply prefer to escape the spaces using a backslash? USE=flag1\ flag2\ flag3....
umm best solution would actually be to run `portageq envvar USE`
Created attachment 16246 [details, diff] euse.patch Make parse_make use the shell for parsing a file, thus correctly parsing in all situations. Remove the whitespace substition regexp as it is not needed. Change the split to split on multiple whitespace instead: split (/\s+/...)
Oh... that was fast.
i'm not a perl master by any means (i learned enough to patch stuff and understand it), so could you create a patch for what i suggested ?
portageq only reports USE flags in use, while euse has the options: -c, --conf - print USE flag setting in make.conf -d, --defaults - print USE flag setting in make.defaults -e, --env - print USE flag setting in environment variable USE Therefore, parse_make has to be able to parse a specific file only. I had no idea that /etc/make.conf did not have to have a /bin/sh compatible syntax, which is why I proposed what I did propose. I agree it is better to use the official portage interface though.
Created attachment 16295 [details, diff] euse.patch Makes euse use the getconfig parser from portage.
Your territory ;)
Any progress on this one? It's been a few months already....
Created attachment 26917 [details, diff] patch for euse based on perl parsing Supports following formats: USE="3dnow" USE="$USE X" USE="${USE} Xaw3d"
I dare object to the last patch (Attachment #26917 [details, diff]). If I read it correctly, given the input: USE=3dnow USE=sse it would count both 3dnow and sse as use flags. And it shouldn't. I still believe, the best way is to use the portage interface, considering that portage 2.0.50 is already out and it supports per-package use flags via /etc/portage/package.use (and etcat produces proper output). In fact, I am not sure if this bug is still relevant.
The last comment should have read attachment #26917 [details, diff] This one should link now.
Ups. You're right. But concerning the usage it depends. I am used to take euse to keep track of all available flags: euse -i > euse.lst and some time later euse -i | diff -ub euse.lst - | less So I see very easily any new, removed or changed flag. I don't know any other utility in gentoolkit, that can list all available flags. Therefore I need a working version.
Is this problem still present in the latest gentoolkit?
The problem doesn't seem to be relevant. euse doesn't have the "-c" option anymore.
old
Just because its old, it's not solved! euse -i is still the only possibility to follow changes in flags. The attached patch is still valid for the KEYWORD syntax in the description. It's just worse now, since euse currently does not work at all (75525)!
And how is that related to this bug? euse has been rewritten completely and this issue shouldn't be present anymore (see comment 14)
I'm sorry, you're right. I didn't check the current implementation and used my own old and patched version in /usr/local/bin. Your impl of get_useflags() should really solve this issue.