public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] Perl interface to portage
@ 2003-03-02  6:20 Oleg Letsinsky
  2003-03-02 12:17 ` Mishael Sibiryakov
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Oleg Letsinsky @ 2003-03-02  6:20 UTC (permalink / raw
  To: gentoo-dev

Hi!

Sorry if my qustion has been answered somewhere already, but I've spent
some time reading FAQ, searching through the ebuilds tree and didn't
find an answer - are there any perl bindings for portage available?
(well, frankly I don't understand why would anyone want to use anything
else for writing a system toolset, but it's probably just a matter of
  personal preference :) ). Should I start writing my own one, or there
  is something already available?

Thanks
-- 
  May the bluebird of happiness twiddle your bits.

--
gentoo-dev@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-dev] Perl interface to portage
  2003-03-02  6:20 [gentoo-dev] Perl interface to portage Oleg Letsinsky
@ 2003-03-02 12:17 ` Mishael Sibiryakov
  2003-03-02 12:29 ` Leon Brocard
  2003-03-02 13:51 ` Alain Penders
  2 siblings, 0 replies; 8+ messages in thread
From: Mishael Sibiryakov @ 2003-03-02 12:17 UTC (permalink / raw
  To: gentoo-dev

On Sun, 2 Mar 2003 09:20:18 +0300
Oleg Letsinsky <letsinsky@mtu-net.ru> wrote:

	And what for it is necessary?
	
	Can we shall write on C ? :))

OL\-> Hi!
OL\-> 
OL\-> Sorry if my qustion has been answered somewhere already, but I've spent
OL\-> some time reading FAQ, searching through the ebuilds tree and didn't
OL\-> find an answer - are there any perl bindings for portage available?
OL\-> (well, frankly I don't understand why would anyone want to use anything
OL\-> else for writing a system toolset, but it's probably just a matter of
OL\->   personal preference :) ). Should I start writing my own one, or there
OL\->   is something already available?
OL\-> 
OL\-> Thanks
OL\-> -- 
OL\->   May the bluebird of happiness twiddle your bits.
OL\-> 

--
Time    :  17:15:56-02:03:2003
NP      :  Hybrid - Mixes 'In the Mix'
SysStat :  5:15pm  up 6 days,  6:02, 16 users,  load average: 0.25, 0.25, 0.16

--
gentoo-dev@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-dev] Perl interface to portage
  2003-03-02  6:20 [gentoo-dev] Perl interface to portage Oleg Letsinsky
  2003-03-02 12:17 ` Mishael Sibiryakov
@ 2003-03-02 12:29 ` Leon Brocard
  2003-03-02 17:15   ` Nick Jones
  2003-03-02 13:51 ` Alain Penders
  2 siblings, 1 reply; 8+ messages in thread
From: Leon Brocard @ 2003-03-02 12:29 UTC (permalink / raw
  To: gentoo-dev

Oleg Letsinsky sent the following bits through the ether:

> are there any perl bindings for portage available?

What do you want to do? Figure out dependencies? Parsing the output of
qpkg is fairly easy, or do you want to parse /usr/portage/metadata and
figure out dependencies?

Leon
-- 
Leon Brocard.............................http://www.astray.com/
scribot.................................http://www.scribot.com/

... Afraid of heights? Not me, I'm afraid of widths!

--
gentoo-dev@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-dev] Perl interface to portage
  2003-03-02  6:20 [gentoo-dev] Perl interface to portage Oleg Letsinsky
  2003-03-02 12:17 ` Mishael Sibiryakov
  2003-03-02 12:29 ` Leon Brocard
@ 2003-03-02 13:51 ` Alain Penders
  2003-03-03 18:17   ` Oleg Letsinsky
  2 siblings, 1 reply; 8+ messages in thread
From: Alain Penders @ 2003-03-02 13:51 UTC (permalink / raw
  To: gentoo-dev

On Sun, Mar 02, 2003 at 09:20:18AM +0300, Oleg Letsinsky wrote:
> Sorry if my qustion has been answered somewhere already, but I've spent
> some time reading FAQ, searching through the ebuilds tree and didn't
> find an answer - are there any perl bindings for portage available?
> (well, frankly I don't understand why would anyone want to use anything
> else for writing a system toolset, but it's probably just a matter of
>   personal preference :) ). Should I start writing my own one, or there
>   is something already available?

There currently is no real API to portage in any language.  The best way to
get information out of portage is using the new 'portageq' command line tool,
which was designed for just that.  portageq will also work on the upcoming
portage 2.1, very few of the other interfaces will.  If there's things you
need to know from portage that portageq doesn't provide, let me know.

Alain

--
gentoo-dev@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-dev] Perl interface to portage
  2003-03-02 12:29 ` Leon Brocard
@ 2003-03-02 17:15   ` Nick Jones
  0 siblings, 0 replies; 8+ messages in thread
From: Nick Jones @ 2003-03-02 17:15 UTC (permalink / raw
  To: Leon Brocard; +Cc: gentoo-dev

>> are there any perl bindings for portage available?

> What do you want to do? Figure out dependencies? Parsing the output of
> qpkg is fairly easy, or do you want to parse /usr/portage/metadata and
> figure out dependencies?

metadata is not guarenteed to be proper, and you shouldn't use it
directly. /var/cache/edb/dep/ is, although it may not be generated.

--
gentoo-dev@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-dev] Perl interface to portage
  2003-03-02 13:51 ` Alain Penders
@ 2003-03-03 18:17   ` Oleg Letsinsky
  2003-03-03 22:18     ` Alain Penders
  2003-03-04  8:00     ` Chris Smith
  0 siblings, 2 replies; 8+ messages in thread
From: Oleg Letsinsky @ 2003-03-03 18:17 UTC (permalink / raw
  To: gentoo-dev

On Sun, Mar 02, 2003 at 06:51:56AM -0700, Alain Penders wrote:
> 
> There currently is no real API to portage in any language.  The best way to
> get information out of portage is using the new 'portageq' command line tool,
> which was designed for just that.  portageq will also work on the upcoming
> portage 2.1, very few of the other interfaces will.  If there's things you
> need to know from portage that portageq doesn't provide, let me know.
> 

What I want is to write is a small script to help me manage my distfiles
"collection" - I'm on dial-up, so I usually have to download files first,
disconnect (to reduce my connection bills) and build then. But upgrading
packages is not the only thing I do with my PC, so I frequently forget
about files downloaded and which packages I wanted to upgrade last night
:). I also want to know about unfinished downloads, about distfiles I
don't need anymore (since they belong to obsolete ebuilds) - not a huge
set of functions, but would be really helpful. I want the script to be
more or less universal and "right" - i.e. no hardwired paths, so I need
the right (i.e. "already existing") way for a perl script to get a
portage variable - PORTDIR, DISTDIR is enough.

Thanks for pointing me to the portageq. But it doesn't, for example,
provide me with a value of DISTDIR variable. BTW, I think its current
parameters are kinda redundant - there is no real need for having
separate "gentoo_mirrors", "portdir" etc. parameters - something like
"--get-env=ENVNAME" would be just fine. 

Thanks
-- 
  May the bluebird of happiness twiddle your bits.

--
gentoo-dev@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-dev] Perl interface to portage
  2003-03-03 18:17   ` Oleg Letsinsky
@ 2003-03-03 22:18     ` Alain Penders
  2003-03-04  8:00     ` Chris Smith
  1 sibling, 0 replies; 8+ messages in thread
From: Alain Penders @ 2003-03-03 22:18 UTC (permalink / raw
  To: gentoo-dev

On Mon, Mar 03, 2003 at 09:17:44PM +0300, Oleg Letsinsky wrote:

> What I want is to write is a small script to help me manage my distfiles
> "collection" - I'm on dial-up, so I usually have to download files first,
> disconnect (to reduce my connection bills) and build then. But upgrading
> packages is not the only thing I do with my PC, so I frequently forget
> about files downloaded and which packages I wanted to upgrade last night
> :). I also want to know about unfinished downloads, about distfiles I
> don't need anymore (since they belong to obsolete ebuilds) - not a huge
> set of functions, but would be really helpful. I want the script to be
> more or less universal and "right" - i.e. no hardwired paths, so I need
> the right (i.e. "already existing") way for a perl script to get a
> portage variable - PORTDIR, DISTDIR is enough.
> 
> Thanks for pointing me to the portageq. But it doesn't, for example,
> provide me with a value of DISTDIR variable. BTW, I think its current
> parameters are kinda redundant - there is no real need for having
> separate "gentoo_mirrors", "portdir" etc. parameters - something like
> "--get-env=ENVNAME" would be just fine. 

The more recent versions of portageq have a command like that:

portageq envvar ENVNAME

However, I'd advise *against* using it.  The main reason why you shouldn't
query ENVNAME's like this is what you want to know might not be environment
variables in a future version of portage, or their name/meaning might change, 
etc.

As for distdir, I added a "distdir" option to portageq.  It'll be available in
the next portage release.

Alain


--
gentoo-dev@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [gentoo-dev] Perl interface to portage
  2003-03-03 18:17   ` Oleg Letsinsky
  2003-03-03 22:18     ` Alain Penders
@ 2003-03-04  8:00     ` Chris Smith
  1 sibling, 0 replies; 8+ messages in thread
From: Chris Smith @ 2003-03-04  8:00 UTC (permalink / raw
  To: gentoo-dev

On Mon, 03 Mar 2003 18:17, Oleg Letsinsky wrote:
> I want the script to be
> more or less universal and "right" - i.e. no hardwired paths, so I need
> the right (i.e. "already existing") way for a perl script to get a
> portage variable - PORTDIR, DISTDIR is enough.

Try parsing the output of "emerge info" its fast and has almost everything you 
need in it. Just a quick grep and awk should do it :D

-- 
Whatever women do they must do twice as well as men to be thought half
as good.  Luckily this is not difficult.
		-- Charlotte Whitton



--
gentoo-dev@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2003-03-03 22:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-02  6:20 [gentoo-dev] Perl interface to portage Oleg Letsinsky
2003-03-02 12:17 ` Mishael Sibiryakov
2003-03-02 12:29 ` Leon Brocard
2003-03-02 17:15   ` Nick Jones
2003-03-02 13:51 ` Alain Penders
2003-03-03 18:17   ` Oleg Letsinsky
2003-03-03 22:18     ` Alain Penders
2003-03-04  8:00     ` Chris Smith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox