Package portage :: Package dbapi :: Module porttree :: Class portdbapi
[hide private]

Class portdbapi

source code

object --+    
         |    
     dbapi --+
             |
            portdbapi

this tree will scan a portage directory located at root (passed to init)

Instance Methods [hide private]
 
__init__(self, _unused_param=<type 'exceptions.DeprecationWarning'>, mysettings=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
_create_pregen_cache(self, tree) source code
 
_init_cache_dirs(self)
Create /var/cache/edb/dep and adjust permissions for the portage group.
source code
 
close_caches(self) source code
 
flush_cache(self) source code
 
findLicensePath(self, license_name) source code
 
findname(self, mycpv, mytree=None, myrepo=None) source code
 
getRepositoryPath(self, repository_id)
This function is required for GLEP 42 compliance; given a valid repository ID it must return a path to the repository TreeMap = { id:path }
source code
String or None
getRepositoryName(self, canonical_repo_path)
This is the inverse of getRepositoryPath().
source code
 
getRepositories(self)
This function is required for GLEP 42 compliance; it will return a list of repository IDs TreeMap = {id: path}
source code
 
getMissingRepoNames(self)
Returns a list of repository paths that lack profiles/repo_name.
source code
 
getIgnoredRepos(self)
Returns a list of repository paths that have been ignored, because another repo with the same name exists.
source code
 
findname2(self, mycpv, mytree=None, myrepo=None)
Returns the location of the CPV, and what overlay it was in.
source code
 
_write_cache(self, cpv, repo_path, metadata, ebuild_hash) source code
 
_pull_valid_cache(self, cpv, ebuild_path, repo_path) source code
 
aux_get(self, mycpv, mylist, mytree=None, myrepo=None)
stub code for returning auxilliary db information, such as SLOT, DEPEND, etc.
source code
dict
getFetchMap(self, mypkg, useflags=None, mytree=None)
Get the SRC_URI metadata as a dict which maps each file name to a set of alternative URIs.
source code
 
getfetchsizes(self, mypkg, useflags=None, debug=0, myrepo=None) source code
 
fetch_check(self, mypkg, useflags=None, mysettings=None, all=False, myrepo=None)
TODO: account for PORTAGE_RO_DISTDIRS
source code
 
cpv_exists(self, mykey, myrepo=None)
Tells us whether an actual ebuild exists on disk (no masking)
source code
 
cp_all(self, categories=None, trees=None, reverse=False)
This returns a list of all keys in our tree or trees
source code
 
cp_list(self, mycp, use_cache=1, mytree=None) source code
 
freeze(self) source code
 
melt(self) source code
 
xmatch(self, level, origdep, mydep=None, mykey=None, mylist=None)
caching match function; very trick stuff
source code
 
match(self, mydep, use_cache=1)
Given a dependency, try to find packages that match...
source code
 
gvisible(self, mylist) source code
 
visible(self, cpv_iter) source code
 
_iter_visible(self, cpv_iter, myrepo=None)
Return a new list containing only visible packages.
source code
 
_visible(self, cpv, metadata) source code

Inherited from dbapi: aux_update, cpv_all, invalidentry, move_slot_ent, update_ents

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]

Inherited from dbapi (private): _cmp_cpv, _cpv_sort_ascending

Class Variables [hide private]
  portdbapi_instances = []
  _use_mutable = True

Inherited from dbapi (private): _category_re, _known_keys, _pkg_str_aux_keys

Properties [hide private]
  _categories
hash(x)
  porttree_root
  eclassdb
  _event_loop

Inherited from dbapi: categories

Inherited from object: __class__

Method Details [hide private]

__init__(self, _unused_param=<type 'exceptions.DeprecationWarning'>, mysettings=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • _unused_param (None) - deprecated, use mysettings['PORTDIR'] instead
  • mysettings (portage.config) - an immutable config instance
Overrides: object.__init__

close_caches(self)

source code 
Overrides: dbapi.close_caches

getRepositoryName(self, canonical_repo_path)

source code 

This is the inverse of getRepositoryPath().

Parameters:
  • canonical_repo_path (String) - the canonical path of a repository, as resolved by os.path.realpath()
Returns: String or None
The repo_name for the corresponding repository, or None if the path does not correspond a known repository

findname2(self, mycpv, mytree=None, myrepo=None)

source code 

Returns the location of the CPV, and what overlay it was in. Searches overlays first, then PORTDIR; this allows us to return the first matching file. As opposed to starting in portdir and then doing overlays second, we would have to exhaustively search the overlays until we found the file we wanted. If myrepo is not None it will find packages from this repository(overlay)

aux_get(self, mycpv, mylist, mytree=None, myrepo=None)

source code 

stub code for returning auxilliary db information, such as SLOT, DEPEND, etc.

Overrides: dbapi.aux_get

getFetchMap(self, mypkg, useflags=None, mytree=None)

source code 

Get the SRC_URI metadata as a dict which maps each file name to a set of alternative URIs.

Parameters:
  • mypkg (String) - cpv for an ebuild
  • useflags (set, or None to enable all conditionals) - a collection of enabled USE flags, for evaluation of conditionals
  • mytree - The canonical path of the tree in which the ebuild is located, or None for automatic lookup
Returns: dict
A dict which maps each file name to a set of alternative URIs.

cp_all(self, categories=None, trees=None, reverse=False)

source code 

This returns a list of all keys in our tree or trees

Parameters:
  • categories - optional list of categories to search or defaults to self.settings.categories
  • trees - optional list of trees to search the categories in or defaults to self.porttrees
  • reverse - reverse sort order (default is False) @rtype list of [cat/pkg,...]
Overrides: dbapi.cp_all

cp_list(self, mycp, use_cache=1, mytree=None)

source code 
Overrides: dbapi.cp_list

match(self, mydep, use_cache=1)

source code 
Given a dependency, try to find packages that match
Args:
        origdep - Depend atom
        use_cache - Boolean indicating if we should use the cache or not
        NOTE: Do we ever not want the cache?
Returns:
        a list of packages that match origdep

Overrides: dbapi.match
(inherited documentation)

Property Details [hide private]

_categories

hash(x)

Get Method:
unreachable._categories(self)

porttree_root

Get Method:
unreachable.porttree_root(self)

eclassdb

Get Method:
unreachable.eclassdb(self)

_event_loop

Get Method:
unreachable._event_loop(self)