View previous topic :: View next topic |
Author |
Message |
pYrania Retired Dev
Joined: 27 Oct 2002 Posts: 650 Location: Cologne - Germany
|
Posted: Sat Aug 02, 2003 8:37 pm Post subject: determine cflags of installed packages |
|
|
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 |
|
|
pYrania Retired Dev
Joined: 27 Oct 2002 Posts: 650 Location: Cologne - Germany
|
Posted: Sat Aug 02, 2003 9:25 pm Post subject: |
|
|
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 |
|
|
M_Kelder n00b
Joined: 02 Aug 2003 Posts: 16 Location: Netherlands
|
Posted: Sat Aug 02, 2003 9:56 pm Post subject: |
|
|
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 |
|
|
pYrania Retired Dev
Joined: 27 Oct 2002 Posts: 650 Location: Cologne - Germany
|
Posted: Sat Aug 02, 2003 10:25 pm Post subject: |
|
|
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 |
|
|
Wedge_ Advocate
Joined: 08 Aug 2002 Posts: 3614 Location: Scotland
|
Posted: Sat Aug 02, 2003 10:35 pm Post subject: |
|
|
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 |
|
|
pYrania Retired Dev
Joined: 27 Oct 2002 Posts: 650 Location: Cologne - Germany
|
Posted: Sat Aug 02, 2003 11:32 pm Post subject: |
|
|
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 |
|
|
|