* Re: [gentoo-dev] Getting $SRC_URI in a bash program
2002-07-29 5:52 [gentoo-dev] Getting $SRC_URI in a bash program Viktor Lakics
@ 2002-07-28 23:00 ` Owen Stampflee
0 siblings, 0 replies; 4+ messages in thread
From: Owen Stampflee @ 2002-07-28 23:00 UTC (permalink / raw
To: gentoo-dev
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* [gentoo-dev] Getting $SRC_URI in a bash program
@ 2002-07-29 5:52 Viktor Lakics
2002-07-28 23:00 ` Owen Stampflee
0 siblings, 1 reply; 4+ messages in thread
From: Viktor Lakics @ 2002-07-29 5:52 UTC (permalink / raw
To: gentoo-dev
Hi devs,
I am learning bash, and since I run gentoo, I thought the best way
to learn is manipulate ebuilds:-)).
How can I extract the value of SRC_URI from a given ebuild in a
bash program? Do I have to call emerge or ebuild somehow!? What I
would like is to get the exact URL or just the basename of the file
as a string to manipulate my distfiles.
Anyone has an idea?
Thanks in advance. -- Viktor
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-dev] Getting $SRC_URI in a bash program
2002-07-29 10:24 lakicsv
@ 2002-07-29 15:11 ` heim-gentoo
2002-07-29 18:21 ` Felipe Ghellar
1 sibling, 0 replies; 4+ messages in thread
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 [flat|nested] 4+ messages in thread
* Re: [gentoo-dev] Getting $SRC_URI in a bash program
2002-07-29 10:24 lakicsv
2002-07-29 15:11 ` heim-gentoo
@ 2002-07-29 18:21 ` Felipe Ghellar
1 sibling, 0 replies; 4+ messages in thread
From: Felipe Ghellar @ 2002-07-29 18:21 UTC (permalink / raw
To: gentoo-dev
http://forums.gentoo.org/viewtopic.php?p=41430#41430
Maybe a look into this script can help you...
--- lakicsv@ntlworld.com escreveu:
> 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
_______________________________________________________________________
Yahoo! PageBuilder
O super editor para criação de sites: é grátis, fácil e rápido.
http://br.geocities.yahoo.com/v/pb.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-07-29 18:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-29 5:52 [gentoo-dev] Getting $SRC_URI in a bash program Viktor Lakics
2002-07-28 23:00 ` Owen Stampflee
-- strict thread matches above, loose matches on Subject: below --
2002-07-29 10:24 lakicsv
2002-07-29 15:11 ` heim-gentoo
2002-07-29 18:21 ` Felipe Ghellar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox