Gentoo Archives: gentoo-dev

From: Jason Stubbs <jstubbs@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Reliance upon || ( use? ( ) ) behaviour
Date: Sat, 24 Feb 2007 03:26:39
Message-Id: 200702241227.35432.jstubbs@gentoo.org
In Reply to: Re: [gentoo-dev] Reliance upon || ( use? ( ) ) behaviour by Ciaran McCreesh
1 On Saturday 24 February 2007 03:57, Ciaran McCreesh wrote:
2 > On Fri, 23 Feb 2007 22:56:19 +0900 Jason Stubbs <jstubbs@g.o>
3 >
4 > wrote:
5 > | Disallowing it would be the cleaner in terms of package manager
6 > | responsibilities, but ...
7 >
8 > Well, I looked through the tree.
9 >
10 > There is exactly one package using this construct that doesn't get it
11 > wrong. That package is openoffice, and it uses it to do this:
12 >
13 > java? ( || ( !amd64? ( =virtual/jdk-1.5* ) =virtual/jdk-1.4* )
14 > dev-java/ant-core )
15
16 The openoffice example above shouldn't need the !amd64? condition unless
17 the amd64 port of openoffice itself doesn't work with a jdk-1.5 package.
18 However, if the amd64 port does in fact not work with jdk-1.5, the only
19 way to rewrite without losing functionality would be:
20
21 amd64? ( =virtual/jdk-1.4 )
22 !amd64? ( || ( =virtual/jdk-1.5* =virtual/jdk-1.4* ) )
23
24 > The other fourteen packages using it are either making the mistake
25 > described in the original email in the thread, or using it where no use
26 > flag is required at all.
27 >
28 > Given that the one legitimate case can easily be rewritten in another
29 > way with no loss of functionality, is there really a justification for
30 > keeping this?
31
32 The only compelling reason is aesthetic(sp?). Kevin Quinn rewrote the
33 example given in ebuild(5) but in doing so functionality was lost.
34 To rewrite it without any change in behaviour would require something like
35 below.
36
37 For the 14 cases you mentioned that were making a mistake, they probably can
38 be rewritten so as to force an install of the first matching
39 package, but when that isn't what is wanted it becomes a bit of a headache.
40
41 || (
42 sdl? ( media-libs/libsdl )
43 svga? ( media-libs/svgalib )
44 opengl? ( virtual/opengl )
45 ggi? ( media-libs/libggi )
46 virtual/x
47 )
48
49 becomes:
50
51 sdl? (
52 svga? (
53 opengl? (
54 ggi? (
55 || ( media-libs/libsdl media-libs/svgalib virtual/opengl
56 media-libs/libggi virtual/x )
57 )
58 !ggi? (
59 || ( media-libs/libsdl media-libs/svgalib virtual/opengl
60 virtual/x )
61 )
62 )
63 !opengl? (
64 ggi? (
65 || ( media-libs/libsdl media-libs/svgalib media-libs/libggi
66 virtual/x )
67 )
68 !ggi? (
69 || ( media-libs/libsdl media-libs/svgalib virtual/x )
70 )
71 )
72 )
73 !svga? (
74 opengl? (
75 ggi? (
76 || ( media-libs/libsdl virtual/opengl media-libs/libggi virtual/x )
77 )
78 !ggi? (
79 || ( media-libs/libsdl virtual/opengl virtual/x )
80 )
81 )
82 !opengl? (
83 ggi? (
84 || ( media-libs/libsdl media-libs/libggi virtual/x )
85 )
86 !ggi? (
87 || ( media-libs/libsdl virtual/x )
88 )
89 )
90 )
91 )
92 !sdl? (
93 svga? (
94 opengl? (
95 ggi? (
96 || ( media-libs/svgalib virtual/opengl media-libs/libggi virtual/x )
97 )
98 !ggi? (
99 || ( media-libs/svgalib virtual/opengl virtual/x )
100 )
101 )
102 !opengl? (
103 ggi? (
104 || ( media-libs/svgalib media-libs/libggi virtual/x )
105 )
106 !ggi? (
107 || ( media-libs/svgalib virtual/x )
108 )
109 )
110 )
111 !svga? (
112 opengl? (
113 ggi? (
114 || ( virtual/opengl media-libs/libggi virtual/x )
115 )
116 !ggi? (
117 || ( virtual/opengl virtual/x )
118 )
119 )
120 !opengl? (
121 ggi? (
122 || ( media-libs/libggi virtual/x )
123 )
124 !ggi? ( virtual/x )
125 )
126 )
127 )
128
129 --
130 Jason Stubbs
131 --
132 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] Reliance upon || ( use? ( ) ) behaviour Ciaran McCreesh <ciaranm@×××××××.org>