Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 16159 - SRC_URI doesn't accept nested conditionals
Summary: SRC_URI doesn't accept nested conditionals
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Ebuild Support (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
: 42144 42315 53679 54102 54338 54705 55997 56246 57118 58442 58878 60595 (view as bug list)
Depends on: 57261
Blocks: 20665 26440 30579 47896 55997
  Show dependency tree
 
Reported: 2003-02-21 15:35 UTC by Aron Griffis (RETIRED)
Modified: 2004-10-05 05:10 UTC (History)
16 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
uclibc-0.9.26.ebuild (uclibc-0.9.26.ebuild,10.18 KB, text/x-ebuild)
2004-02-13 05:10 UTC, Daniel Black (RETIRED)
Details
.50-r8 evaluate fix (evaluate-fix.patch,670 bytes, patch)
2004-06-11 16:35 UTC, Brian Harring (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Griffis (RETIRED) gentoo-dev 2003-02-21 15:35:58 UTC
This is in media-video/mjpegtools/mjpegtools-1.6.0-r7.ebuild

# Portage currently chokes on the following nested conditional.
#   SRC_URI="mirror://sourceforge/mjpeg/${P}.tar.gz
#       quicktime? ( !alpha? (
#           mirror://sourceforge/mjpeg/quicktime4linux-1.4-patched.tar.gz
#       ) )"
if [ "$ARCH" = alpha ]; then
    SRC_URI="mirror://sourceforge/mjpeg/${P}.tar.gz"
else
    SRC_URI="mirror://sourceforge/mjpeg/${P}.tar.gz
        quicktime? (
http://download.sourceforge.net/mjpeg/quicktime4linux-1.4-patched.tar.gz )"
fi


Reproducible: Always
Steps to Reproduce:
1. Uncomment the SRC_URI with the nested conditional
2. emerge mjpegtools

Actual Results:  
# emerge mjpegtools
Calculating dependencies ...done!
>>> emerge (1 of 1) media-video/mjpegtools-1.6.0-r7 to /
>>> Downloading !alpha?
--15:22:32--  http://!alpha/?
           => `/usr/distfiles/index.html'
Resolving www-proxy.zko.dec.com... done.
Connecting to www-proxy.zko.dec.com[16.47.32.60]:8080... connected.
Proxy request sent, awaiting response... 502 Proxy Error ( Host was not found.
For more information about this event, see ISA Server Help. )
15:22:37 ERROR 502: Proxy Error ( Host was not found. For more information about
this event, see ISA Server Help. ).
 
!!! Couldn't download !alpha?. Aborting.


Expected Results:  
It should have skipped downloading quicktime4linux since I'm on an alpha.
Comment 1 Nicholas Jones (RETIRED) gentoo-dev 2003-02-21 20:13:20 UTC
You cannot wrap ANYTHING in bash condidtionals that portage needs to use.
Portage _CANNOT_ figure that out.

SRC_URI="alpha? ( http://blah1.alpha : http://blah1.notalpha )"
Comment 2 Aron Griffis (RETIRED) gentoo-dev 2003-02-22 07:47:24 UTC
Carpaski,

I think you missed the point of this bug.  The bash conditionals were
just supposed to be a workaround (sorry if a bad one).  The issue is
that SRC_URI isn't working with nested conditionals, as far as I can
tell.

Here is what I'm trying to do:

SRC_URI="mirror://sourceforge/mjpeg/${P}.tar.gz
    quicktime? ( !alpha? (
        mirror://sourceforge/mjpeg/quicktime4linux-1.4-patched.tar.gz
    ) )"

Portage barfs as described earlier in this bug report.  I've also
tried this format:

SRC_URI="mirror://sourceforge/mjpeg/${P}.tar.gz
    alpha? ( : quicktime? (
        mirror://sourceforge/mjpeg/quicktime4linux-1.4-patched.tar.gz 
    ) )"

In this case it doesn't unpack the second source on x86.  How should I
accomplish this correctly?

Thanks,
Aron
Comment 3 Nicholas Jones (RETIRED) gentoo-dev 2003-02-22 08:02:33 UTC
Oh. Completely ignored the comments. :-/

Ok. It'll be fixed for portage-2.1... not sure about before then.
I'll look at it for 47-r4.
Comment 4 Aron Griffis (RETIRED) gentoo-dev 2003-02-22 08:15:54 UTC
I worked around this for the moment by downloading the second source
file on alpha even though it won't be built on that platform.
Comment 5 SpanKY gentoo-dev 2003-08-28 09:37:31 UTC
maybe it's just me, but why cant we consolidate the 2 functions used by DEPEND 
and SRC_URI into the same function ? 
 
that way when we add features to one, both will get it ? 
plus, the DEPEND one is more advancded ... 
Comment 6 Adrian Almenar 2003-10-08 20:02:30 UTC
This is a feature really needed for maintaining all JDK's (blackdown,sun,ibm,....)
Comment 7 Adrian Almenar 2003-10-08 20:03:40 UTC
ill keep bugging portage team until this gets resolved =)
Comment 8 Daniel Robbins (RETIRED) gentoo-dev 2003-10-30 22:00:41 UTC
http://dev.gentoo.org/~drobbins/SRC_URI-fix.diff

Bugs like this need to get closed *much* quicker. The functions are all there.
They just need to get called. No new code was required (just a couple of
different function calls). I'll commit this fix to cvs so it should show
up in the next release.
Comment 9 Adrian Almenar 2003-12-07 05:46:45 UTC
This is still not fixed in 2.0.49-r18.
Comment 10 Masatomo Nakano (RETIRED) gentoo-dev 2004-01-24 00:40:13 UTC
This bug was fixed in .50pre19 at least.
But .49* is not fixed.

carpaski: do we need to fix it in .49*?
Comment 11 Marius Mauch (RETIRED) gentoo-dev 2004-02-08 17:55:16 UTC
supposed to be fixed in 2.0.50 which is stable now. If this bug is not fixed please reopen.
Comment 12 Daniel Black (RETIRED) gentoo-dev 2004-02-12 18:32:12 UTC
Sorry not fixed yet.

bash-2.05b# emerge info
Portage 2.0.50-r1 (default-x86-1.4, gcc-3.3.2, glibc-2.3.2-r9, 2.6.1-gentoo)
=================================================================
System uname: 2.6.1-gentoo i686 Celeron (Coppermine)
Gentoo Base System version 1.4.3.10
distcc 2.11.1 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
Autoconf: sys-devel/autoconf-2.58
Automake: sys-devel/automake-1.7.7
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium3 -O3"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3/share/config /usr/share/config /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O2 -mcpu=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache cvs sandbox userpriv usersandbox"
GENTOO_MIRRORS="ftp://usename:pass@mirror.internode.on.net/pub/gentoo             http://usename:pass@premium.planetmirror.com/pub/gentoo             http://gentoo.oregonstate.edu           http://distro.ibiblio.org/pub/linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.au.gentoo.org/gentoo-portage"
USE="3dfx X acpi alsa apache2 apm arts artswrappersuid avi berkdb bonobo cdr crypt cups debug doc encode esd ethereal fam fastcgi flash foomaticdb gd gdbm gif gnome gphoto2 gpm gtkhtml guile imagemagick imlib java jpeg kde ldap libg++ libgda libwww mad mbox mikmod mmx motif mozilla mpeg mysql nas ncurses oggvorbis openal oss pam pdflib perl php pic plotutils png postgres ppds psyco python qt quicktime readline samba sasl scanner sdl skey slang slp snmp socks5 sox spell sse ssl svga tcltk tetex tiff truetype usb vhost x86 xinerama xml xml2 xmms xv zeo zlib"

ebuild uclibc-0.9.26.ebuild digest
>>> Downloading x86?
--11:54:06--  http://x86/?
           => `/usr/portage/distfiles/index.html'
Resolving x86... failed: Host not found.
!!! Couldn't download x86?. Aborting.

#Ebuild uclibc-0.9.26.ebuild extract.

inherit eutils crosscompile

DESCRIPTION="Embedded C libraries"
HOMEPAGE="http://www.uclibc.org/"
SRC_URI="mirror://kernel/linux/libs/uclibc/uClibc-${PV}.tar.bz2
	nls? ( x86? ( mirror://kernel/linux/libs/uclibc/uClibc-locale-030818.tgz ) )"

#
Comment 13 Masatomo Nakano (RETIRED) gentoo-dev 2004-02-13 04:54:26 UTC
Hi,

It works for me.
Can you attach the ebuild?
Comment 14 Daniel Black (RETIRED) gentoo-dev 2004-02-13 05:10:34 UTC
Created attachment 25527 [details]
uclibc-0.9.26.ebuild

Don't expect this ebuild do more than unpack. Still very much work in progress.

bash-2.05b# ebuild uclibc-0.9.26.ebuild digest
>>> Downloading x86?
--22:34:05--  http://x86/?
	   => `/usr/portage/distfiles/index.html'
Resolving x86... failed: Host not found.
!!! Couldn't download x86?. Aborting.
bash-2.05b# pwd
/usr/local/portage/dev-libs/uclibc
bash-2.05b#
Comment 15 Martin Holzer (RETIRED) gentoo-dev 2004-02-13 06:49:48 UTC
nls? ( x86? ( mirror://kernel/linux/libs/uclibc/uClibc-locale-030818.tgz ) )"


this can't work

just use nls or x86 but not both
Comment 16 Masatomo Nakano (RETIRED) gentoo-dev 2004-02-13 07:03:32 UTC
OK.
I found the problem. It occurs when FEATURES="cvs".
I just fixed it in cvs.

Thank you for reporting.
Comment 17 SpanKY gentoo-dev 2004-02-13 09:37:44 UTC
martin: the point of this bug is that it should work

nakano seems to have fixed it for us
Comment 18 Masatomo Nakano (RETIRED) gentoo-dev 2004-02-19 06:45:20 UTC
*** Bug 42144 has been marked as a duplicate of this bug. ***
Comment 19 Masatomo Nakano (RETIRED) gentoo-dev 2004-02-21 00:17:32 UTC
*** Bug 42315 has been marked as a duplicate of this bug. ***
Comment 20 Heinrich Wendel (RETIRED) gentoo-dev 2004-03-13 10:36:09 UTC
what about a portage-2.0.50-r2 release ;)
Comment 21 Heinrich Wendel (RETIRED) gentoo-dev 2004-03-27 09:01:06 UTC
works fine now in -r2 -> close :)
Comment 23 Masatomo Nakano (RETIRED) gentoo-dev 2004-04-17 06:51:49 UTC
It works here in 2.0.50-r6/portage-2.0.51_pre3

Do you have "cvs" in FEATURES?
If so, portage would download all files to make a digest file.

anyway, please show us 'emerge info'.
Comment 24 Heinrich Wendel (RETIRED) gentoo-dev 2004-04-17 17:38:35 UTC
i have portage-2.0.50-r6 with cvs in FEATURES and tried to make an digest for opera-7.50_alpha4, after downloading all 6 tbz2's it does the following:

>>> Downloading ftp://ftp.tu-clausthal.de/pub/linux/gentoo/distfiles/static?
--02:37:35--  ftp://ftp.tu-clausthal.de/pub/linux/gentoo/distfiles/static?
           => `/usr/portage/distfiles/.listing'
Resolving ftp.tu-clausthal.de... 139.174.2.36
Connecting to ftp.tu-clausthal.de[139.174.2.36]:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD /pub/linux/gentoo/distfiles ... done.
==> PASV ... done.    ==> LIST ... done.

    [                                                   <=>                                         ] 928,300       89.47K/s

02:37:46 (85.19 KB/s) - `/usr/portage/distfiles/.listing' saved [928300]

Removed `/usr/portage/distfiles/.listing'.
No matches on pattern `static?'.
>>> Downloading ftp://ftp.tu-clausthal.de/pub/linux/gentoo/distfiles/!static?
--02:37:46--  ftp://ftp.tu-clausthal.de/pub/linux/gentoo/distfiles/!static?
           => `/usr/portage/distfiles/.listing'
Resolving ftp.tu-clausthal.de... 139.174.2.36
Connecting to ftp.tu-clausthal.de[139.174.2.36]:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done.    ==> PWD ... done.
==> TYPE I ... done.  ==> CWD /pub/linux/gentoo/distfiles ... done.
==> PASV ... done.    ==> LIST ... done.

    [                                                    <=>                                        ] 928,300       89.76K/s

02:37:58 (85.36 KB/s) - `/usr/portage/distfiles/.listing' saved [928300]

Removed `/usr/portage/distfiles/.listing'.
No matches on pattern `!static?'.
>>> Generating digest file...
<<< !static?
!!! Given file does not appear to be readable. Does it exist?
!!! File: /usr/portage/distfiles/!static?
Comment 25 Heinrich Wendel (RETIRED) gentoo-dev 2004-04-17 17:41:12 UTC
heino@heino opera $ emerge info
Portage 2.0.50-r6 (default-x86-1.4, gcc-3.3.2, glibc-2.3.3_pre20040207-r0, 2.6.3)
=================================================================
System uname: 2.6.3 i686 AMD Athlon(tm) XP 2600+
Gentoo Base System version 1.4.9
ccache version 2.3 [enabled]
Autoconf: sys-devel/autoconf-2.58-r1
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon-xp -fomit-frame-pointer -Os -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/bind /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon-xp -fomit-frame-pointer -Os -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache cvs digest sandbox strict"
GENTOO_MIRRORS="ftp://ftp.tu-clausthal.de/pub/linux/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/home/heino/projects/gentoo/cvs/gentoo-x86"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X aalib alsa apache2 apm arts avi berkdb cdr crypt cups dvd encode esd flash foomaticdb gd gdbm gif gnome gpm gtk gtk2 imap imlib jpeg kde ldap libg++ libwww lirc mad mikmod motif mozilla mpeg mysql ncurses nls nptl oggvorbis opengl pam pdflib perl png python qt quicktime readline ruby samba scanner sdl slang spell sse ssl svga tcltk tcpd tetex truetype unicode wmf x86 xml xml2 xmms xv zlib"
Comment 26 Masatomo Nakano (RETIRED) gentoo-dev 2004-04-17 18:33:04 UTC
Sorry, I misunderstood your comment #22.
I've just confirm the bug exists in 2.0.50-r6.
But the bug has alrealy fixed in 2.0.51_pre*.

I don't know when the version will be stable..
Comment 27 SpanKY gentoo-dev 2004-06-11 15:49:45 UTC
*** Bug 53679 has been marked as a duplicate of this bug. ***
Comment 28 Brian Harring (RETIRED) gentoo-dev 2004-06-11 16:35:25 UTC
Created attachment 33107 [details, diff]
.50-r8 evaluate fix

Seems this has popped up in .50-r8.

The issue is in evaluate, basically for 
blah? [ blah2? [ uri1, uri2 ] ]

if blah was set, then evaluate automatically skipped to the next arguement-
basically skipping over the following arg regardless of what it may've been (
in this case, a list w/ the first element being another conditional).

Included patch fixes the issue w/ evaluate not going recursive when it's
supposed to, *and* fixes an oversight in evaluate, where it's not honoring the
passed in allon (eg, if I passed in allon=1, it doesn't propogate when evaluate
goes recursive).

Bit wordy, but fixes the issue and a bug w/ allon support.
Comment 29 Brian Harring (RETIRED) gentoo-dev 2004-06-16 10:57:25 UTC
*** Bug 54102 has been marked as a duplicate of this bug. ***
Comment 30 Mr. Bones. (RETIRED) gentoo-dev 2004-06-18 12:28:48 UTC
*** Bug 54338 has been marked as a duplicate of this bug. ***
Comment 31 Mr. Bones. (RETIRED) gentoo-dev 2004-06-21 21:56:17 UTC
*** Bug 54705 has been marked as a duplicate of this bug. ***
Comment 32 Mr. Bones. (RETIRED) gentoo-dev 2004-07-03 16:39:30 UTC
*** Bug 55997 has been marked as a duplicate of this bug. ***
Comment 33 Donnie Berkholz (RETIRED) gentoo-dev 2004-07-04 16:26:59 UTC
*** Bug 55997 has been marked as a duplicate of this bug. ***
Comment 34 Sven Wegener gentoo-dev 2004-07-06 12:03:45 UTC
*** Bug 56246 has been marked as a duplicate of this bug. ***
Comment 35 Mr. Bones. (RETIRED) gentoo-dev 2004-07-14 23:38:02 UTC
*** Bug 57118 has been marked as a duplicate of this bug. ***
Comment 36 Mr. Bones. (RETIRED) gentoo-dev 2004-07-26 14:55:11 UTC
*** Bug 58442 has been marked as a duplicate of this bug. ***
Comment 37 Tom Knight (RETIRED) gentoo-dev 2004-07-30 06:16:01 UTC
*** Bug 58878 has been marked as a duplicate of this bug. ***
Comment 38 Brian Harring (RETIRED) gentoo-dev 2004-07-30 23:31:24 UTC
Nick,
This bug alone warrants getting another .50 release out.
I realize getting .51 out the door is a goal, but people keep hitting this.

In bug #57261, all evaluate oddness (including this reocurring bug) is corrected.
I realize you're busy, but this was identified broke in -r8, yet we're at -r9.  The eclass IUSE issues were identified in r6, and are still broke.

It would be nice to just schlop in the patches, and nail down these final issues w/ .50 so people stop running into them.
Getting .51 stabled and marked ~arch is important, but I don't think .50 should be neglected, or that .51 should be pushed out early to correct .50 issues.
Comment 39 Mr. Bones. (RETIRED) gentoo-dev 2004-08-16 14:55:02 UTC
*** Bug 60595 has been marked as a duplicate of this bug. ***
Comment 40 Jason Stubbs (RETIRED) gentoo-dev 2004-10-05 05:10:16 UTC
This should be fixed in both .50 and .51