Gentoo Archives: gentoo-dev

From: heim-gentoo@××××××××.net
To: gentoo-dev@g.o
Subject: Re: [gentoo-dev] Getting $SRC_URI in a bash program
Date: Mon, 29 Jul 2002 10:11:45
Message-Id: 200207291111.43326.heim-gentoo@heim.cjb.net
In Reply to: Re: Re: [gentoo-dev] Getting $SRC_URI in a bash program by lakicsv@ntlworld.com
1 maybe this'll help as a way to get the .tar.* names from the ebuild filename.
2
3 [heim@tnt ~]$ ./test.sh /usr/portage/x11-wm/fluxbox/
4 fluxbox-0.1.10.tar.bz2
5 fluxbox-0.1.9-r5.tar.bz2
6 [heim@tnt ~]$
7 [heim@tnt ~]$ cat test.sh
8 #!/bin/bash
9
10 EBUILDS=`ls ${1}/*.ebuild`
11 SUFFIX='.tar.bz2'
12 for i in ${EBUILDS};
13 do
14 echo $i | sed -e 's:^/.*/::' -e 's:.ebuild$:${SUFFIX}:";
15 done
16
17
18 or, maybe you already have a variable set to the name of the ebuild:
19 ------------------------
20 #!/bin/bash
21 EBUILDS='app-2.1.ebuild'
22 SUFFIX='.tar.bz2'
23
24 for i in ${EBUILDS};
25 do
26 echo $i | sed -e "s:.ebuild$:${SUFFIX}:";
27 done
28 -------------------------
29 of course, you'll want to set SUFFIX to whatever it's set to in the ebuild
30 this'll get you the "gz" or "bz2" part.
31 [heim@tnt ~]$ cat /usr/portage/x11-wm/fluxbox/fluxbox-0.1.10.ebuild |grep
32 SRC_URI|sed -e "s:.*/.*\.tar.::" -e 's:"$::'
33 gz
34
35
36 --
37 heim
38
39 On Monday 29 July 2002 06:24 am, lakicsv@××××××××.com wrote:
40 > This is exactly what I did, but it did not give me what I wanted, the
41 > complete URL or not even the file name. As you pointed out the problem is
42 > the variables which are not set in the ebuild themselves...Where are they
43 > set then? And how can I extract, get the file name?!
44 >
45 > In other words : If I have /usr/portage/app-cat/app-2.1.ebuild then I want
46 > to get:
47 >
48 > app-2.1.tar.bz2
49 >
50 > or whatever the file is *ACTUALLY* called. I think this could be different
51 > from that you could deduct from simply the ebuild name...
52 >
53 > Viktor
54 >
55 > > From: Owen Stampflee <owen@g.o>
56 > > Date: Sun, 28 Jul 2002 23:00:32 +0000
57 > > To: gentoo-dev@g.o
58 > > Subject: Re: [gentoo-dev] Getting $SRC_URI in a bash program
59 > >
60 > > Simply source the ebuild, and SRC_URI and other variables will be set.
61 > > This wont work for ${P}, ${PN}, ${PV}, etc. etc. as they are not set in
62 > > the ebuild themselves.
63 > >
64 > > Owen
65 > >
66 > > --
67 > > Owen Stampflee - owen@g.o
68 > > Gentoo Linux Developer - http://www.gentoo.org
69 > >
70 > > _______________________________________________
71 > > gentoo-dev mailing list
72 > > gentoo-dev@g.o
73 > > http://lists.gentoo.org/mailman/listinfo/gentoo-dev
74 >
75 > _______________________________________________
76 > gentoo-dev mailing list
77 > gentoo-dev@g.o
78 > http://lists.gentoo.org/mailman/listinfo/gentoo-dev