public inbox for gentoo-guis@lists.gentoo.org
 help / color / mirror / Atom feed
From: Brian <dol-sen@telus.net>
To: gentoo-guis@lists.gentoo.org
Subject: Re: [gentoo-guis] One backend for all portage GUIs
Date: Tue, 09 Oct 2007 18:21:26 -0700	[thread overview]
Message-ID: <1191979286.12008.100.camel@localhost> (raw)
In-Reply-To: <470BF8AB.7030802@necoro.eu>

[-- Attachment #1: Type: text/plain, Size: 802 bytes --]

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@telus.net>

[-- Attachment #2: portage_calls --]
[-- Type: text/plain, Size: 2196 bytes --]

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

  reply	other threads:[~2007-10-10  1:29 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-20  6:52 [gentoo-guis] One backend for alle portage GUIs René 'Necoro' Neumann
2007-09-20 22:27 ` Luis Francisco Araujo
2007-09-21  4:14   ` René 'Necoro' Neumann
2007-10-02 21:38 ` René 'Necoro' Neumann
2007-10-03  6:40   ` Rolf Herzog
2007-10-03  9:21     ` René 'Necoro' Neumann
2007-10-03 16:30   ` René 'Necoro' Neumann
2007-10-03 17:51     ` René 'Necoro' Neumann
2007-10-04 23:17     ` René 'Necoro' Neumann
2007-10-04 23:17       ` René 'Necoro' Neumann
2007-10-08 17:52       ` René 'Necoro' Neumann
2007-10-08 18:55         ` Dawid Węgliński
2007-10-08 19:16           ` René 'Necoro' Neumann
2007-10-09  6:45         ` [gentoo-guis] One backend for all " Brian
2007-10-09 12:05           ` René 'Necoro' Neumann
2007-10-09 13:56             ` René 'Necoro' Neumann
2007-10-09 21:33           ` Luis Francisco Araujo
2007-10-09 21:54             ` René 'Necoro' Neumann
2007-10-10  1:21               ` Brian [this message]
2007-10-10  5:34                 ` René 'Necoro' Neumann
2007-10-10 17:47                   ` René 'Necoro' Neumann
2007-10-11  0:49                     ` Brian
2007-10-11  5:26                       ` René 'Necoro' Neumann
2007-10-22 16:44 ` [gentoo-guis] One backend for alle " René 'Necoro' Neumann
2007-11-02 18:10   ` René 'Necoro' Neumann
2007-11-04 23:51     ` René 'Necoro' Neumann
2007-11-02  0:08 ` René 'Necoro' Neumann
2007-11-02 13:58   ` Luis Francisco Araujo
2007-11-02 17:48     ` René 'Necoro' Neumann
2007-11-08 17:42 ` René 'Necoro' Neumann

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=1191979286.12008.100.camel@localhost \
    --to=dol-sen@telus.net \
    --cc=gentoo-guis@gentoo.org \
    --cc=gentoo-guis@lists.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