From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on finch.gentoo.org X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=DMARC_MISSING, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_DYNAMIC autolearn=unavailable autolearn_force=no version=4.0.0 Received: from tnt.heim.cjb.net (bgp01114665bgs.westln01.mi.comcast.net [68.42.96.64]) by chiba.3jane.net (Postfix) with ESMTP id E1018AC394 for ; Mon, 29 Jul 2002 10:11:45 -0500 (CDT) Received: from pdq.lan (pdq.lan [192.168.0.4]) by tnt.heim.cjb.net (Postfix) with ESMTP id 7C4A6344B51 for ; Mon, 29 Jul 2002 11:11:44 -0400 (EDT) To: gentoo-dev@gentoo.org Subject: Re: [gentoo-dev] Getting $SRC_URI in a bash program Date: Mon, 29 Jul 2002 11:11:43 -0400 User-Agent: KMail/1.4.5 References: <20020729102456.QZUL290.mta02-svc.ntlworld.com@[10.137.100.62]> In-Reply-To: <20020729102456.QZUL290.mta02-svc.ntlworld.com@[10.137.100.62]> MIME-Version: 1.0 Content-Disposition: inline From: heim-gentoo@heim.cjb.net Reply-To: heim-gentoo@heim.cjb.net Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <200207291111.43326.heim-gentoo@heim.cjb.net> Sender: gentoo-dev-admin@gentoo.org Errors-To: gentoo-dev-admin@gentoo.org X-BeenThere: gentoo-dev@gentoo.org X-Mailman-Version: 2.0.6 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Gentoo Linux developer list List-Unsubscribe: , List-Archive: X-Archives-Salt: ba11e947-c1d1-4ff7-90c5-6adb4019368a X-Archives-Hash: aa8f3c1b47caeaf29acaba32f336106f maybe this'll help as a way to get the .tar.* names from the ebuild filenam= e. [heim@tnt ~]$ ./test.sh /usr/portage/x11-wm/fluxbox/ fluxbox-0.1.10.tar.bz2 fluxbox-0.1.9-r5.tar.bz2 [heim@tnt ~]$ [heim@tnt ~]$ cat test.sh #!/bin/bash EBUILDS=3D`ls ${1}/*.ebuild` SUFFIX=3D'.tar.bz2' for i in ${EBUILDS}; do echo $i | sed -e 's:^/.*/::' -e 's:.ebuild$:${SUFFIX}:"; done or, maybe you already have a variable set to the name of the ebuild: =2D----------------------- #!/bin/bash EBUILDS=3D'app-2.1.ebuild' SUFFIX=3D'.tar.bz2' for i in ${EBUILDS}; do echo $i | sed -e "s:.ebuild$:${SUFFIX}:"; done =2D------------------------ of course, you'll want to set SUFFIX to whatever it's set to in the ebuild this'll get you the "gz" or "bz2" part. [heim@tnt ~]$ cat /usr/portage/x11-wm/fluxbox/fluxbox-0.1.10.ebuild |grep=20 SRC_URI|sed -e "s:.*/.*\.tar.::" -e 's:"$::' gz =2D- heim On Monday 29 July 2002 06:24 am, lakicsv@ntlworld.com wrote: > This is exactly what I did, but it did not give me what I wanted, the > complete URL or not even the file name. As you pointed out the problem is > the variables which are not set in the ebuild themselves...Where are they > set then? And how can I extract, get the file name?! > > In other words : If I have /usr/portage/app-cat/app-2.1.ebuild then I want > to get: > > app-2.1.tar.bz2 > > or whatever the file is *ACTUALLY* called. I think this could be different > from that you could deduct from simply the ebuild name... > > Viktor > > > From: Owen Stampflee > > Date: Sun, 28 Jul 2002 23:00:32 +0000 > > To: gentoo-dev@gentoo.org > > Subject: Re: [gentoo-dev] Getting $SRC_URI in a bash program > > > > Simply source the ebuild, and SRC_URI and other variables will be set. > > This wont work for ${P}, ${PN}, ${PV}, etc. etc. as they are not set in > > the ebuild themselves. > > > > Owen > > > > -- > > Owen Stampflee - owen@gentoo.org > > Gentoo Linux Developer - http://www.gentoo.org > > > > _______________________________________________ > > gentoo-dev mailing list > > gentoo-dev@gentoo.org > > http://lists.gentoo.org/mailman/listinfo/gentoo-dev > > _______________________________________________ > gentoo-dev mailing list > gentoo-dev@gentoo.org > http://lists.gentoo.org/mailman/listinfo/gentoo-dev