From: heim-gentoo@heim.cjb.net
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 [thread overview]
Message-ID: <200207291111.43326.heim-gentoo@heim.cjb.net> (raw)
In-Reply-To: <20020729102456.QZUL290.mta02-svc.ntlworld.com@[10.137.100.62]>
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
next prev parent reply other threads:[~2002-07-29 15:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-29 10:24 Re: [gentoo-dev] Getting $SRC_URI in a bash program lakicsv
2002-07-29 15:11 ` heim-gentoo [this message]
2002-07-29 18:21 ` Felipe Ghellar
-- strict thread matches above, loose matches on Subject: below --
2002-07-29 5:52 Viktor Lakics
2002-07-28 23:00 ` Owen Stampflee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200207291111.43326.heim-gentoo@heim.cjb.net \
--to=heim-gentoo@heim.cjb.net \
--cc=gentoo-dev@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox