1 |
Thanks :) |
2 |
|
3 |
Reason I thought this is relevant is: I'm basically looking for an API |
4 |
to get an installed package's version/rev. I prefer that over making |
5 |
syntactical assumptions on the way portage names packages. |
6 |
|
7 |
Taking RPM for example, there's such an API: something like rpm -q |
8 |
--queryformat '%{VERSION}|' PKG_NAME if I remember correctly.| |
9 |
|
10 |
Amit |
11 |
|
12 |
Andrew Gaffney wrote: |
13 |
> Amit Dor-Shifer wrote: |
14 |
>> Given the following: |
15 |
>> # qlist -Iv sys-apps/portage |
16 |
>> sys-apps/portage-2.1.4.5 |
17 |
>> |
18 |
>> How do I safely extract the "2.1.4.5"? |
19 |
> |
20 |
> That's probably offtopic for this list, since it really has nothing to |
21 |
> do with portage itself. However, you probably want something like: |
22 |
> |
23 |
> qlist -Iv sys-apps/portage | sed -e 's:^.*-\([0-9][^-_]*\).*$:\1:' |
24 |
> |