Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
determine cflags of installed packages
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
pYrania
Retired Dev
Retired Dev


Joined: 27 Oct 2002
Posts: 650
Location: Cologne - Germany

PostPosted: Sat Aug 02, 2003 8:37 pm    Post subject: determine cflags of installed packages Reply with quote

how could i get a list of all packages installed, that are not compiled with the current cflags?

need to parse all the /var/db/pkg/<category>/<package>/CFLAGS files, but i am not experienced enough to get it working.

The main problem is: emerge -e world b0rked at one package and i issued some other emerge commands to get it fixed. right. bad idea. now i cannot resume the previous emerge process anymore.

EDIT: altered subject.
_________________
Markus Nigbur
Back to top
View user's profile Send private message
pYrania
Retired Dev
Retired Dev


Joined: 27 Oct 2002
Posts: 650
Location: Cologne - Germany

PostPosted: Sat Aug 02, 2003 9:25 pm    Post subject: Reply with quote

so, this is what i've got so far:
Code:
cd /var/db/pkg ; for name in $(find . -name CFLAGS); do if  grep -v " -funroll-loops " $name >/dev/null ; then echo $name; fi; done


it will return a list like the following:
Code:
./sys-kernel/development-sources-2.6.0_beta1/CFLAGS
./sys-kernel/ck-sources-2.4.20-r6/CFLAGS
./sys-kernel/ck-sources-2.4.21-r3/CFLAGS
./dev-cpp/gtkmm-1.2.9-r2/CFLAGS
./dev-cpp/gnomemm-1.2.3-r1/CFLAGS
./dev-php/smarty-2.5.0/CFLAGS


but i can't figure out how to use sed to display only the package name
_________________
Markus Nigbur
Back to top
View user's profile Send private message
M_Kelder
n00b
n00b


Joined: 02 Aug 2003
Posts: 16
Location: Netherlands

PostPosted: Sat Aug 02, 2003 9:56 pm    Post subject: Reply with quote

Code:
cd /var/db/pkg ; for name in $(find . -name CFLAGS); do if  grep -v " -funroll-loops " $name >/dev/null ; then echo $name | sed 's/\/CFLAGS$//g;s/^.*\///g' ; fi; done
I think this works. I used sed to get rid of the unwanted lines. First I get the last /CFLAGS out (search and 'replace'), then I can delete everything before the /.
Back to top
View user's profile Send private message
pYrania
Retired Dev
Retired Dev


Joined: 27 Oct 2002
Posts: 650
Location: Cologne - Germany

PostPosted: Sat Aug 02, 2003 10:25 pm    Post subject: Reply with quote

really nice. now the last problem is to strip off the package version, because emerge won't work with it.
_________________
Markus Nigbur
Back to top
View user's profile Send private message
Wedge_
Advocate
Advocate


Joined: 08 Aug 2002
Posts: 3614
Location: Scotland

PostPosted: Sat Aug 02, 2003 10:35 pm    Post subject: Reply with quote

If you put an equals sign before the package name and version, it'll emerge that particular version, if that would help.
_________________
Per Ardua Ad Astra
The Earth is the cradle of the mind, but we cannot live forever in a cradle - Konstantin E. Tsiolkovsky
Gentoo Radeon FAQ
Back to top
View user's profile Send private message
pYrania
Retired Dev
Retired Dev


Joined: 27 Oct 2002
Posts: 650
Location: Cologne - Germany

PostPosted: Sat Aug 02, 2003 11:32 pm    Post subject: Reply with quote

ah GREAT!

thanks to both of you.

For future reference, the final hack looks like this:
Code:
cd /var/db/pkg ; for name in $(find . -name CFLAGS); do if  grep -v " -funroll-loops " $name >/dev/null ; then echo $name | sed 's/\/CFLAGS$//g;s/.\//=/' ; fi; done > /root/packages

_________________
Markus Nigbur
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum