public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] portage without portage
@ 2003-10-27  7:32 Andrew Gaffney
  2003-10-26  8:25 ` Kumba
  2003-10-26 12:29 ` Bartosch Pixa
  0 siblings, 2 replies; 7+ messages in thread
From: Andrew Gaffney @ 2003-10-27  7:32 UTC (permalink / raw
  To: Gentoo Dev

In an effort to better understand the way that Portage works, I'm trying to write a perl 
program that can generate a dependency tree like emerge does. Since I'm using Perl and not 
Python, I can't use the Portage API. Here is my code so far:

[code]
#!/usr/bin/perl -w

my $dbpath = '/usr/portage';
my $pkgregex =
     '^(.+?)'.                                   # name
     '-(\d+(?:\.\d+)*\w*)'.                      # version, eg 1.23.4a
     '((?:(?:_alpha|_beta|_pre|_rc)\d*)?)'.      # special suffix
     '((?:-r\d+)?)$';                            # revision, eg r12

my $pkg = shift;

$depend = `source ${dbpath}/${pkg}; echo \${DEPEND}; echo \${RDEPEND}`;
print $depend;

$useflags = `source /etc/make.conf; echo \${USE}`;
print $useflags;
[/code]

This gets me a nice list of the packages that the ebuild depends on. As for the USE flags, 
I only get the ones defined in /etc/make.conf, not the full set. Is there an easy way to 
do this?

-- 
Andrew Gaffney


--
gentoo-dev@gentoo.org mailing list


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

end of thread, other threads:[~2003-10-29 17:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-27  7:32 [gentoo-dev] portage without portage Andrew Gaffney
2003-10-26  8:25 ` Kumba
2003-10-26 12:29 ` Bartosch Pixa
2003-10-27 16:16   ` Andrew Gaffney
2003-10-26 18:25     ` Kain
2003-10-29 16:37     ` Nick Jones
2003-10-29 17:46       ` Andrew Gaffney

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