Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-guis
Navigation:
Lists: gentoo-guis: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-guis@g.o
From: Brian <dol-sen@...>
Subject: Re: One backend for all portage GUIs
Date: Tue, 09 Oct 2007 18:21:26 -0700
On Tue, 2007-09-10 at 23:54 +0200, René 'Necoro' Neumann wrote:

> This is the thing I'm waiting for atm ... the functions to implement (ie
> the API)... I think, that it should be done in a functional way is
> general consensus, isn't it?
> 

Ok, I've put together a small list of portage calls mostly unigue, but
many have variations of the basic call (not listed)repeated for
different info returned. A few lines of code I left in to make it more
clear, but should give an overall list of the portage function calls
used so far.


I will put together a list of functions that I created in portagelib to
add functionality directly related to portage.  Some of them are copies
of code chunks from lifted from gentoolkit.

> Regards,
> - - Necoro

-- 
Brian <dol-sen@...>
try:
    import portage
    import portage_const
    import portage_manifest
    print >>stderr, ("PORTAGELIB: portage version = " + portage.VERSION)
except ImportError:
    
return portage.settings.virtuals
portage.settings["ARCH"]
portage.catpkgsplit
portage.pkgsplit(ebuild)
portage.grabfile
portage.config(clone=portage.settings).environ()[var]
return portage.db['/']['vartree'].dep_match(str(package_name))
return portage.portdb.xmatch(*args, **kwargs)[:] # make a copy.  needed for <portage-svn-r5382
for x in portage.portdb.mysettings.pmaskdict[full_name]:
for x in portage.portdb.mysettings.punmaskdict[full_name]:
return portage.best(versions)
portage.archlist[:]
portage.getmaskingreason(ebuild)
portdb.findname(mycpv)
mf = portage_manifest.Manifest(pkgdir, settings["DISTDIR"])
    fetchlist = portdb.getfetchlist(mycpv, mysettings=settings, all=True)[1]
mysum[0] = mf.getDistfilesSize(fetchlist)
portage.db['/']['porttree'].dbapi.finddigest(ebuild)
if portage.portdb.cpv_exists(ebuild): # if in portage tree
Properties(dict(zip(keys, portage.portdb.aux_get(ebuild, portage.auxdbkeys))))
        vartree = portage.db['/']['vartree']
        if vartree.dbapi.cpv_exists(ebuild): # elif in installed pkg tree
            return Properties(dict(zip(keys, vartree.dbapi.aux_get(ebuild, portage.auxdbkeys))))
        else: return Properties()
non_virtual_atom = portage.dep_virtual([atom], portage.settings)[0]
dir,ovl = portage.portdb.findname2(cpv)
def get_system_pkgs(): # lifted from gentoolkit
	"""Returns a tuple of lists, first list is resolved system packages,
	second is a list of unresolved packages."""
	pkglist = settings.packages
return portage.db['/']['porttree'].getallnodes()[:] # copy
return portage.db['/']['vartree'].getallnodes()[:] # try copying...
return portage.db['/']['vartree'].getebuildpath(fullname)
trees = portage.create_trees(trees=trees, **kwargs)
settings = trees[myroot]["vartree"].settings
    mtimedbfile = os.path.join("/", portage.CACHE_PATH.lstrip(os.path.sep), "mtimedb")
    mtimedb = portage.MtimeDB(mtimedbfile)
    return settings, trees, mtimedb
settings, trees, mtimedb = load_emerge_config()
portdb = trees[settings["ROOT"]]["porttree"].dbapi
Replies:
Re: One backend for all portage GUIs
-- René 'Necoro' Neumann
References:
One backend for alle portage GUIs
-- René 'Necoro' Neumann
Re: One backend for alle portage GUIs
-- René 'Necoro' Neumann
Re: One backend for alle portage GUIs
-- René 'Necoro' Neumann
Re: One backend for alle portage GUIs
-- René 'Necoro' Neumann
Re: One backend for alle portage GUIs
-- René 'Necoro' Neumann
Re: One backend for all portage GUIs
-- Brian
Re: One backend for all portage GUIs
-- Luis Francisco Araujo
Re: One backend for all portage GUIs
-- René 'Necoro' Neumann
Navigation:
Lists: gentoo-guis: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Re: One backend for all portage GUIs
Next by thread:
Re: One backend for all portage GUIs
Previous by date:
Re: One backend for all portage GUIs
Next by date:
Re: One backend for all portage GUIs


Updated Jun 17, 2009

Summary: Archive of the gentoo-guis mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.