* Re: [gentoo-dev] Getting $SRC_URI in a bash program
@ 2002-07-29 15:11 99% ` heim-gentoo
0 siblings, 0 replies; 1+ results
From: heim-gentoo @ 2002-07-29 15:11 UTC (permalink / raw
To: gentoo-dev
maybe this'll help as a way to get the .tar.* names from the ebuild filename.
[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=`ls ${1}/*.ebuild`
SUFFIX='.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:
------------------------
#!/bin/bash
EBUILDS='app-2.1.ebuild'
SUFFIX='.tar.bz2'
for i in ${EBUILDS};
do
echo $i | sed -e "s:.ebuild$:${SUFFIX}:";
done
-------------------------
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
SRC_URI|sed -e "s:.*/.*\.tar.::" -e 's:"$::'
gz
--
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 <owen@gentoo.org>
> > 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
^ permalink raw reply [relevance 99%]
Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2002-07-29 10:24 Re: [gentoo-dev] Getting $SRC_URI in a bash program lakicsv
2002-07-29 15:11 99% ` heim-gentoo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox