Summary: | ban the usage of DEPEND="|| ( foo? ( . ) . )" | ||
---|---|---|---|
Product: | Gentoo Hosted Projects | Reporter: | Tiziano Müller (RETIRED) <dev-zero> |
Component: | PMS/EAPI | Assignee: | PMS/EAPI <pms> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | alex_y_xu, pacho, sam |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Tiziano Müller (RETIRED)
2009-03-12 19:58:42 UTC
So what is the proposed alternative? Are we sure this is the only use case for "|| ( foo? ( . ) . )"? (In reply to comment #1) > So what is the proposed alternative? > Are we sure this is the only use case for "|| ( foo? ( . ) . )"? The alternative is to write your deps out correctly. There is no way to use this construct correctly. Do I understand it correctly, the construct is equivalent to the following? DEPEND=" foo? ( bar? ( || ( cat/foo cat/bar cat/baz ) ) !bar? ( || ( cat/foo cat/baz ) ) ) !foo? ( bar? ( || ( cat/bar cat/baz ) ) !bar? ( cat/baz ) )" (In reply to comment #3) > Do I understand it correctly, the construct is equivalent to the following? Uh, that looks right, yes. Of course, it's almost certainly not what anyone wants to write... do any packages in the tree today actually use this construct? (In reply to Alex Xu (Hello71) from comment #5) > do any packages in the tree today actually use this construct? Yes, and in a legitimate way. Legitimately? Really? Examples please. Remember that any example that actually checks the use flag that's present inside the || block is not legitimate. grep -rE '^DEPEND=.*\|\| \( [^ []*\?' /usr/portage/metadata/md5-cache/ this only shows uses where the use-conditional is first in the || block, since it is not possible to do a perfect check using pure regex. however, on my tree, it only shows: media-sound/pulseaudio-*:DEPEND=|| ( elibc_glibc? ( virtual/libc ) elibc_uclibc? ( virtual/libc ) dev-libs/libpcre ) ... which seems legitimate, since only one elibc can be set, and all packages must be rebuilt if elibc is changed. (In reply to Alex Xu (Hello71) from comment #8) > grep -rE '^DEPEND=.*\|\| \( [^ []*\?' /usr/portage/metadata/md5-cache/ > > this only shows uses where the use-conditional is first in the || block, > since it is not possible to do a perfect check using pure regex. > > however, on my tree, it only shows: > > media-sound/pulseaudio-*:DEPEND=|| ( elibc_glibc? ( virtual/libc ) > elibc_uclibc? ( virtual/libc ) dev-libs/libpcre ) ... > > which seems legitimate, since only one elibc can be set, and all packages > must be rebuilt if elibc is changed. This is a good example of an incorrect dependency... virtual/linux-sources used to have the following which I believe was correct: RDEPEND="|| ( hardened? ( =sys-kernel/hardened-sources-3* ) xrc? ( =sys-kernel/cluster-sources-3* ) =sys-kernel/gentoo-sources-3* =sys-kernel/vanilla-sources-3* ... )" (In reply to Ulrich Müller from comment #10) > virtual/linux-sources used to have the following which I believe was correct: > > RDEPEND="|| ( > hardened? ( =sys-kernel/hardened-sources-3* ) > xrc? ( =sys-kernel/cluster-sources-3* ) > =sys-kernel/gentoo-sources-3* > =sys-kernel/vanilla-sources-3* > ... > )" Those flags are just superfluous. you want a more complete grep like: grep -rE 'DEPEND=.*\|\|[[:space:]]+[(][^)]*[?][[:space:]]+[(]' \ /usr/portage/metadata/md5-cache/ the pulseaudio dep looks like it should be written as: !elibc_glibc? ( !elibc_uclibc? ( dev-libs/libpcre ) ) the virtual/kernel examples seem like the USE flags are superfluous. even when they're doing it based on KEYWORD availability of the target. other examples: games-strategy/dominions2 & games-strategy/heroes3-demo & games-fps/unreal-tournament-goty & app-emulation/crossover-bin do something like: RDEPEND=" || ( ppc? ( media-libs/libsdl virtual/opengl virtual/glu ) !ppc? ( media-libs/libsdl[abi_x86_32(-)] virtual/opengl[abi_x86_32(-)] virtual/glu[abi_x86_32(-)] ) )" that doesn't seem wrong to me as it's a binary package. would be nice if it could be written differently. net-print/hplip seems legit: hpijs? ( || ( >=net-print/cups-filters-1.0.43-r1[foomatic] >=net-print/foomatic-filters-3.0.20080507[cups] ) ) as does the portage one: || ( >=dev-lang/python-2.7[ssl] dev-lang/python:2.6[threads,ssl] ) |