Gentoo Archives: gentoo-user

From: Dr Rainer Woitok <rainer.woitok@×××××.com>
To: gentoo-user@l.g.o, Martin Vaeth <martin@×××××.de>
Subject: [gentoo-user] Re: Problem understanding "eix"
Date: Tue, 21 Apr 2020 09:56:27
Message-Id: 24222.49980.791275.25282@tux.local
1 Martin,
2
3 On Monday, 2020-04-20 18:21:00 -0000, you wrote:
4
5 > ...
6 > > app-crypt/tpm2-tss 2.3.3 0 1
7 > ...
8 > The second value depends on your ARCH;
9 > Since {isunstable} fails, I suppose that your ARCH is not amd64.
10
11 $ eix --dump | grep DEFAULT_ARCH
12 DEFAULT_ARCH="amd64"
13 $
14
15 So no, that's a wrong assumption.
16
17 > ...
18 > installedversion returns the details of the version in /var/db.
19
20 You may be right on this one: the description of the "--installed" opt-
21 ion in the "eix" manual page contains a faint hint pointing into this
22 direction by explaining that
23
24 --format '<installedversions:NAMEVERSION>' --pure-packages
25
26 would produce the same result as "equery" while using the "--installed"
27 option might not. But the description of "installedversions:VARIABLE"
28 farther down just tersly notes "This is analogous to availableversions
29 with the difference that only installed versions are printed".
30
31 So it boils down to the question what precisely "analogous" means here.
32
33 > ...
34 > But /vat/db does not contain any information whether the version
35 > is stable, unstable, or alienstable, so these tests do not make
36 > any sense for installed versions.
37
38 $ cd /var/db/pkg
39 $ cat acct-group/input-0/KEYWORDS app-crypt/tpm2-tss-2.3.3/KEYWORDS |
40 xargs -n1 | grep '^~?amd64$'
41 amd64
42 ~amd64
43 $
44
45 So the information is clearly there.
46
47 > eix does not print an error if you query that information anyway,
48 > but the return value for any such test (isstable, isunstable,
49 > isalienstable, etc) is always empty (false).
50
51 From that it follows that the "isstable" and "isunstable" properties may
52 both return "0" at the same time because the information just isn't av-
53 ailable, but may never both return "1". So for clarity I slightly mod-
54 ified my test script by removing the "!" prefix from the "isunstable"
55 property:
56
57 $ cat test-script
58 #! /bin/sh
59 export EIX_LIMIT=0 OVERLAYS_LIST=false PRINT_COUNT_ALWAYS=never
60 export FMT="<category>/<name>\t<version>\t{isstable}1{else}0{} {isunstable}1{else}0{}\n"
61 echo in:
62 eix --format '<installedversions:FMT>' \
63 --category-name --regex 'app-crypt/tpm2-tss$|acct-group/input'
64 echo av:
65 eix --format '<availableversions:FMT>' \
66 --category-name --regex 'app-crypt/tpm2-tss$|acct-group/input'
67 $ ./test-script
68 in:
69 acct-group/input 0 0 0
70 app-crypt/tpm2-tss 2.3.3 0 0
71 av:
72 acct-group/input 0 1 0
73 app-crypt/tpm2-tss 2.2.3-r2 1 1
74 app-crypt/tpm2-tss 2.3.3 1 1
75 $
76
77 So it seems that even though the information is available in "/var/db/
78 pkg/" "eix" just doesn't look there when processing "installedversions".
79 This may be a documentation problem rather than a bug (even though I my-
80 self would prefer a correction in "eix" itself rather than in its docum-
81 entation :-). The manual mentions in another place that the "test for
82 markedversions always fails in the context of <installedversions:...>",
83 but aparently there are also other properties than just "markedversion"
84 that always fail in this context.
85
86 But why does "<availableversions:...>" only return a correct result for
87 installed virtual package "acct-group/input-0" but incorrect results
88 (stable and unstable at the same time) for both, the not installed pack-
89 age "app-crypt/tpm2-tss-2.2.3-r2" and the installed package "app-crypt/
90 tpm2-tss-2.3.3"?
91
92 Still puzzled :-/
93
94 Sincerely,
95 Rainer

Replies

Subject Author
[gentoo-user] Re: Problem understanding "eix" Martin Vaeth <martin@×××××.de>