Package entropy :: Package db :: Module sqlite :: Class EntropySQLiteRepository

Class EntropySQLiteRepository

source code


EntropySQLiteRepository implements SQLite3 based storage. In a Model-View based pattern, it can be considered the "model". Actually it's the only one available but more model backends will be supported in future (which will inherit this class directly). Beside the underlying SQLite3 calls are thread safe, you are responsible of the semantic of your calls.

Nested Classes
  ModuleProxy
  SQLiteProxy

Inherited from sql.EntropySQLRepository: Schema

Instance Methods
 
__init__(self, readOnly=False, dbFile=None, xcache=False, name=None, indexing=True, skipChecks=False, temporary=False, direct=False, cache_policy=None)
EntropySQLiteRepository constructor.
source code
 
__repr__(self)
repr(x)
source code
 
__str__(self)
str(x)
source code
 
__unicode__(self) source code
object
acquire_exclusive(self)
Reimplemented from EntropyBaseRepository.
source code
object
acquire_shared(self)
Reimplemented from EntropyBaseRepository.
source code
string
checksum(self, do_order=False, strict=True, include_signatures=False, include_dependencies=False)
Reimplemented from EntropySQLRepository.
source code
 
close(self, safe=False)
Reimplemented from EntropySQLRepository.
source code
 
createAllIndexes(self)
Reimplemented from EntropySQLRepository.
source code
 
dropAllIndexes(self)
Reimplemented from EntropyRepositoryBase.
source code
 
dropContentSafety(self)
Reimplemented from EntropySQLRepository.
source code
 
dropInstalledPackageFromStore(self, package_id)
Reimplemented from EntropySQLRepository.
source code
 
exportRepository(self, dumpfile)
Reimplemented from EntropyRepositoryBase.
source code
tuple
getBaseData(self, package_id)
Reimplemented from EntropySQLRepository.
source code
string or None
getInstalledPackageRepository(self, package_id)
Reimplemented from EntropySQLRepository.
source code
int or None
getInstalledPackageSource(self, package_id)
Reimplemented from EntropySQLRepositoryBase.
source code
 
getScopeData(self, package_id)
Reimplemented from EntropySQLRepository.
source code
tuple
getStrictData(self, package_id)
Reimplemented from EntropySQLRepository.
source code
tuple
getStrictScopeData(self, package_id)
Reimplemented from EntropySQLRepository.
source code
tuple
getVersioningData(self, package_id)
Reimplemented from EntropySQLRepository.
source code
 
handlePackage(self, pkg_data, revision=None, formattedContent=False)
Reimplemented from EntropySQLRepository.
source code
 
initializeRepository(self)
Reimplemented from EntropySQLRepository.
source code
 
insertDependencies(self, package_id, depdata)
Reimplemented from EntropySQLRepository.
source code
 
integrity_check(self)
Reimplemented from EntropyRepositoryBase.
source code
frozenset
listAllCategories(self, order_by=None)
Reimplemented from EntropySQLRepository.
source code
tuple or frozenset
listAllExtraDownloads(self, do_sort=True)
Reimplemented from EntropySQLRepository.
source code
tuple
listAllPreservedLibraries(self)
Reimplemented from EntropySQLRepository.
source code
frozenset
listPackageIdsInCategory(self, category, order_by=None)
Reimplemented from EntropySQLRepository.
source code
 
lock_path(self)
Overridden from EntropyBaseRepository.
source code
float
mtime(self)
Reimplemented from EntropyRepositoryBase.
source code
bool
readonly(self)
Reimplemented from EntropySQLRepository.
source code
 
release_exclusive(self, opaque)
Reimplemented from EntropyBaseRepository.
source code
 
release_shared(self, opaque)
Reimplemented from EntropyBaseRepository.
source code
 
removeDependencies(self, package_id)
Reimplemented from EntropySQLRepository.
source code
dict
retrieveBranchMigration(self, to_branch)
Reimplemented from EntropySQLRepository.
source code
string or None
retrieveCategory(self, package_id)
Reimplemented from EntropySQLRepository.
source code
string or None
retrieveChangelog(self, package_id)
Reimplemented from EntropySQLRepository.
source code
 
retrieveCompileFlags(self, package_id)
Reimplemented from EntropySQLRepository.
source code
dict
retrieveContentSafety(self, package_id)
Reimplemented from EntropySQLRepository.
source code
iterator
retrieveContentSafetyIter(self, package_id)
Reimplemented from EntropySQLRepository.
source code
tuple or frozenset
retrieveDependencies(self, package_id, extended=False, deptype=None, exclude_deptypes=None, resolve_conditional_deps=True)
Reimplemented from EntropyRepositoryBase.
source code
list
retrieveDesktopMime(self, package_id)
Reimplemented from EntropySQLRepository.
source code
string or None
retrieveDigest(self, package_id)
Reimplemented from EntropySQLRepository.
source code
tuple
retrieveExtraDownload(self, package_id, down_type=None)
Reimplemented from EntropySQLRepository.
source code
 
retrieveKeySlot(self, package_id)
Reimplemented from EntropyRepositoryBase.
source code
string or None
retrieveKeySlotAggregated(self, package_id)
Reimplemented from EntropyRepositoryBase.
source code
tuple
retrieveKeySlotTag(self, package_id)
Reimplemented from EntropyRepositoryBase.
source code
 
retrieveKeySplit(self, package_id)
Reimplemented from EntropySQLRepository.
source code
frozenset
retrievePreservedLibraries(self, library, elfclass)
Reimplemented from EntropySQLRepository.
source code
frozenset
retrieveProvidedMime(self, package_id)
Reimplemented from EntropySQLRepository.
source code
int or None
retrieveRevision(self, package_id)
Reimplemented from EntropySQLRepository.
source code
string or None
retrieveSlot(self, package_id)
Reimplemented from EntropySQLRepository.
source code
buffer
retrieveSpmMetadata(self, package_id)
Reimplemented from EntropySQLRepository.
source code
string or None
retrieveTag(self, package_id)
Reimplemented from EntropySQLRepository.
source code
frozenset
retrieveUseflags(self, package_id)
Reimplemented from EntropySQLRepository.
source code
string or None
retrieveVersion(self, package_id)
Reimplemented from EntropySQLRepository.
source code
frozenset
searchCategory(self, keyword, like=False, just_id=True)
Reimplemented from EntropySQLRepository.
source code
frozenset
searchKeySlot(self, key, slot)
Reimplemented from EntropySQLRepository.
source code
frozenset
searchKeySlotTag(self, key, slot, tag)
Reimplemented from EntropySQLRepository.
source code
frozenset
searchLicense(self, keyword, just_id=False)
Reimplemented from EntropySQLRepository.
source code
frozenset
searchNameCategory(self, name, category, just_id=False)
Reimplemented from EntropySQLRepository.
source code
tuple
searchProvidedMime(self, mimetype)
Reimplemented from EntropySQLRepository.
source code
frozenset
searchSets(self, keyword)
Reimplemented from EntropySQLRepository.
source code
 
setAtom(self, package_id, atom)
Reimplemented from EntropySQLRepository.
source code
 
setCategory(self, package_id, category)
Reimplemented from EntropySQLRepository.
source code
 
setDependency(self, iddependency, dependency)
Reimplemented from EntropySQLRepository.
source code
 
setInstalledPackageSource(self, package_id, source)
Reimplemented from EntropySQLRepository.
source code
 
setName(self, package_id, name)
Reimplemented from EntropySQLRepository.
source code
 
setRevision(self, package_id, revision)
Reimplemented from EntropySQLRepository.
source code
 
setSlot(self, package_id, slot)
Reimplemented from EntropySQLRepository.
source code
 
storeInstalledPackage(self, package_id, repoid, source=0)
Reimplemented from EntropySQLRepository.
source code
object or None
try_acquire_exclusive(self)
Reimplemented from EntropyBaseRepository.
source code
object or None
try_acquire_shared(self)
Reimplemented from EntropyBaseRepository.
source code
 
vacuum(self)
Reimplemented from EntropySQLRepository.
source code

Inherited from sql.EntropySQLRepository: acceptLicense, addPackage, addRepositoryUpdatesActions, arePackageIdsAvailable, bumpTreeUpdatesActions, clean, clearCache, clearPackageSets, clearTreeupdatesEntries, commit, contentDiff, dropChangelog, dropContent, dropGpgSignatures, getApi, getDependency, getFakeSpmUid, getPackageIdFromDownload, getPackageIds, getSetting, insertAutomergefiles, insertBranchMigration, insertConflicts, insertContent, insertPackageSets, insertPreservedLibrary, insertSpmUid, insertTreeUpdatesActions, isBranchMigrationAvailable, isFileAvailable, isInjected, isLicenseAccepted, isLicenseDataKeyAvailable, isPackageIdAvailable, isPackageScopeAvailable, isSpmUidAvailable, isSpmUidTrashed, isSystemPackage, listAllDependencies, listAllDownloads, listAllFiles, listAllInjectedPackageIds, listAllPackageIds, listAllPackages, listAllSpmUids, listAllSystemPackageIds, listAllTrashedSpmUids, listAllTreeUpdatesActions, listConfigProtectEntries, moveSpmUidsToBranch, regenerateSpmUidMapping, removeConflicts, removePackage, removePreservedLibrary, removeTrashedUids, removeTreeUpdatesActions, resetTreeupdatesDigests, resolveNeeded, retrieveApi, retrieveAtom, retrieveAutomergefiles, retrieveBranch, retrieveBuildDependencies, retrieveCategoryDescription, retrieveChangelogByKey, retrieveConflicts, retrieveContent, retrieveContentIter, retrieveCreationDate, retrieveDependenciesList, retrieveDescription, retrieveDownloadURL, retrieveHomepage, retrieveKeywords, retrieveLicense, retrieveLicenseData, retrieveLicenseDataKeys, retrieveLicenseText, retrieveManualDependencies, retrieveMirrorData, retrieveName, retrieveNeeded, retrieveNeededLibraries, retrieveOnDiskSize, retrievePackageSet, retrievePackageSets, retrievePostDependencies, retrieveProtect, retrieveProtectMask, retrieveProvide, retrieveProvidedLibraries, retrieveRepositoryUpdatesDigest, retrieveReverseDependencies, retrieveRuntimeDependencies, retrieveSignatures, retrieveSize, retrieveSources, retrieveSpmPhases, retrieveSpmRepository, retrieveSpmUid, retrieveTreeUpdatesActions, retrieveTrigger, retrieveUnusedPackageIds, rollback, searchBelongs, searchConflict, searchContentSafety, searchDependency, searchDescription, searchHomepage, searchName, searchNeeded, searchPackageIdFromDependencyId, searchPackages, searchProvidedVirtualPackage, searchRevisionedPackages, searchSimilarPackages, searchSlotted, searchTaggedPackages, searchUseflag, setBranchMigrationPostUpgradeMd5sum, setCategoryDescription, setContentSafety, setCreationDate, setDigest, setDownloadURL, setIndexing, setInjected, setRepositoryUpdatesDigest, setSignatures, setSpmUid, setTrashedUid, storeSpmMetadata, switchBranch, validate

Inherited from skel.EntropyRepositoryBase: alignDatabases, atomMatch, atomMatchCacheKey, cache_policy, cache_policy_all, cache_policy_none, caching, direct, directed, exclusive, filterTreeUpdatesActions, getPackageData, getPackageXmlData, getPackagesToRemove, getTriggerData, maskFilter, repository_id, runTreeUpdatesActions, shared, temporary

Inherited from skel.EntropyRepositoryPluginStore: add_plugin, get_plugin_metadata, get_plugins, get_plugins_metadata, remove_plugin, set_plugin_metadata

Inherited from core.EntropyPluginStore: drop_plugins, has_plugin

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

Class Methods

Inherited from sql.EntropySQLRepository: isMainThread

Inherited from output.TextInterface: ask_question, edit_file, input_box, output, set_title

Static Methods
int
importRepository(dumpfile, db, data=None)
Reimplemented from EntropyRepositoryBase.
source code

Inherited from sql.EntropySQLRepository: remote_revision, revision, update

Inherited from skel.EntropyRepositoryPluginStore: add_permanent_plugin, get_permanent_plugins, remove_permanent_plugin

Class Variables
  SETTING_KEYS = ('arch', 'on_delete_cascade', 'schema_revision'...

Inherited from sql.EntropySQLRepository: GENERIC_NAME

Inherited from skel.EntropyRepositoryBase: REPOSITORY_ALREADY_UPTODATE, REPOSITORY_CHECKSUM_ERROR, REPOSITORY_GENERIC_ERROR, REPOSITORY_NOT_AVAILABLE, REPOSITORY_PERMISSION_DENIED_ERROR, REPOSITORY_UPDATED_OK, VIRTUAL_META_PACKAGE_CATEGORY

Inherited from output.TextInterface: OUTPUT_LOCK

Properties

Inherited from object: __class__

Method Details

__init__(self, readOnly=False, dbFile=None, xcache=False, name=None, indexing=True, skipChecks=False, temporary=False, direct=False, cache_policy=None)
(Constructor)

source code 

EntropySQLiteRepository constructor.

Parameters:
  • readOnly (bool) - open file in read-only mode
  • dbFile (string) - path to database to open
  • xcache (bool) - enable on-disk cache
  • name (string) - repository identifier
  • indexing (bool) - enable database indexes
  • skipChecks (bool) - if True, skip integrity checks
  • temporary (bool) - if True, dbFile will be automatically removed on close()
  • direct (bool) - True, if direct mode should be always enabled
  • cache_policy (EntropyRepositoryCachePolicies attribute) - set the cache policy that should be used
Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

acquire_exclusive(self)

source code 

Reimplemented from EntropyBaseRepository.

Returns: object
an opaque that must be used to release the lock.
Overrides: skel.EntropyRepositoryBase.acquire_exclusive

acquire_shared(self)

source code 

Reimplemented from EntropyBaseRepository.

Returns: object
an opaque that must be used to release the lock.
Overrides: skel.EntropyRepositoryBase.acquire_shared

checksum(self, do_order=False, strict=True, include_signatures=False, include_dependencies=False)

source code 

Reimplemented from EntropySQLRepository. We have to handle _baseinfo_extrainfo_2010. We must use the in-memory cache to do some memoization.

Parameters:
  • do_order - order metadata collection alphabetically
  • strict - improve checksum accuracy
  • include_signatures - also include packages signatures (GPG, SHA1, SHA2, etc) into the returned hash
  • include_dependencies - also include package dependencies into the returned hash
Returns: string
repository checksum
Overrides: skel.EntropyRepositoryBase.checksum

close(self, safe=False)

source code 

Reimplemented from EntropySQLRepository. Needs to call superclass method.

Parameters:
  • safe - if True, the MainThread resources won't be released. This is vital if both MainThread and a random thread access the Repository concurrently. With safe=False (original behaviour) MainThread cursors may become invalid and cause random exceptions in a racey fashion. But on the other hand, if closing all the resources is what is really wanted, safe must be False, or the MainThread ones will be never released.
Overrides: skel.EntropyRepositoryBase.close

createAllIndexes(self)

source code 

Reimplemented from EntropySQLRepository. We must handle _baseinfo_extrainfo_2010.

Overrides: skel.EntropyRepositoryBase.createAllIndexes

dropAllIndexes(self)

source code 

Reimplemented from EntropyRepositoryBase.

Overrides: skel.EntropyRepositoryBase.dropAllIndexes

dropContentSafety(self)

source code 

Reimplemented from EntropySQLRepository. We must handle backward compatibility.

Overrides: skel.EntropyRepositoryBase.dropContentSafety

dropInstalledPackageFromStore(self, package_id)

source code 

Reimplemented from EntropySQLRepository. We must handle live cache.

Parameters:
  • package_id - package indentifier
Overrides: skel.EntropyRepositoryBase.dropInstalledPackageFromStore

exportRepository(self, dumpfile)

source code 

Reimplemented from EntropyRepositoryBase.

Parameters:
  • dumpfile - dump file object to write to
Overrides: skel.EntropyRepositoryBase.exportRepository

getBaseData(self, package_id)

source code 

Reimplemented from EntropySQLRepository. We must handle backward compatibility.

Parameters:
  • package_id - package indentifier
Returns: tuple
tuple of length 19 composed by (atom, name, version, tag, description, category name, CHOST, CFLAGS, CXXFLAGS, homepage, license, branch, download path, digest, slot, api, creation date, package size, revision,) belonging to package_id
Overrides: skel.EntropyRepositoryBase.getBaseData

getInstalledPackageRepository(self, package_id)

source code 

Reimplemented from EntropySQLRepository. We must use the in-memory cache to do some memoization.

Parameters:
  • package_id - package indentifier
Returns: string or None
repository identifier
Overrides: skel.EntropyRepositoryBase.getInstalledPackageRepository

getInstalledPackageSource(self, package_id)

source code 

Reimplemented from EntropySQLRepositoryBase. We must use the in-memory cache to do some memoization.

Parameters:
  • package_id - package indentifier
Returns: int or None
install source identifier
Overrides: skel.EntropyRepositoryBase.getInstalledPackageSource

getScopeData(self, package_id)

source code 

Reimplemented from EntropySQLRepository. We must handle backward compatibility.

Overrides: skel.EntropyRepositoryBase.getScopeData

getStrictData(self, package_id)

source code 

Reimplemented from EntropySQLRepository. We must use the in-memory cache to do some memoization.

Parameters:
  • package_id - package indentifier
Returns: tuple
tuple of length 6 composed by (package key, slot, version, tag, revision, atom) belonging to package_id
Overrides: skel.EntropyRepositoryBase.getStrictData

getStrictScopeData(self, package_id)

source code 

Reimplemented from EntropySQLRepository. We must use the in-memory cache to do some memoization.

Parameters:
  • package_id - package indentifier
Returns: tuple
tuple of length 3 composed by (atom, slot, revision,) belonging to package_id
Overrides: skel.EntropyRepositoryBase.getStrictScopeData

getVersioningData(self, package_id)

source code 

Reimplemented from EntropySQLRepository. We must use the in-memory cache to do some memoization.

Parameters:
  • package_id - package indentifier
Returns: tuple
tuple of length 3 composed by (version, tag, revision,) belonging to package_id
Overrides: skel.EntropyRepositoryBase.getVersioningData

handlePackage(self, pkg_data, revision=None, formattedContent=False)

source code 

Reimplemented from EntropySQLRepository.

Raises:
  • NotImplementedError - guess what, you need to implement this.
Overrides: skel.EntropyRepositoryBase.handlePackage

importRepository(dumpfile, db, data=None)
Static Method

source code 

Reimplemented from EntropyRepositoryBase.

Parameters:
  • dumpfile - dump file to read
  • dbfile - database file path or reference name
  • data - connection data (dict object)
Returns: int
import return code (0 = OK)
Raises:
  • AttributeError - if given paths are invalid
Overrides: skel.EntropyRepositoryBase.importRepository

To Do: remove /usr/bin/sqlite3 dependency

initializeRepository(self)

source code 

Reimplemented from EntropySQLRepository.

Overrides: skel.EntropyRepositoryBase.initializeRepository

insertDependencies(self, package_id, depdata)

source code 

Reimplemented from EntropySQLRepository. We must handle live cache.

Parameters:
  • package_id - package indentifier
  • depdata - dependency dictionary {'app-foo/foo': dep_type_integer, ...}
Overrides: skel.EntropyRepositoryBase.insertDependencies

integrity_check(self)

source code 

Reimplemented from EntropyRepositoryBase.

Raises:
Overrides: skel.EntropyRepositoryBase.integrity_check

listAllCategories(self, order_by=None)

source code 

Reimplemented from EntropySQLRepository. We must handle _baseinfo_extrainfo_2010.

Parameters:
  • order_by - order by "category"
Returns: frozenset
list (frozenset) of available package categories
Raises:
  • AttributeError - if order_by value is invalid
Overrides: skel.EntropyRepositoryBase.listAllCategories

listAllExtraDownloads(self, do_sort=True)

source code 

Reimplemented from EntropySQLRepository. We must handle backward compatibility.

Parameters:
  • do_sort - sort by name
  • full_path - return full URL (not just package file name)
Returns: tuple or frozenset
tuple (or set if do_sort is True) of package download URLs
Overrides: skel.EntropyRepositoryBase.listAllExtraDownloads

listAllPreservedLibraries(self)

source code 

Reimplemented from EntropySQLRepository.

Returns: tuple
a list (tuple) of tuples composed by (library, elfclass, path, atom).
Overrides: skel.EntropyRepositoryBase.listAllPreservedLibraries

listPackageIdsInCategory(self, category, order_by=None)

source code 

Reimplemented from EntropySQLRepository. We must handle _baseinfo_extrainfo_2010.

Parameters:
  • category_id - cateogory name
  • order_by - order by "atom", "idpackage", "package_id", "branch", "name", "version", "versiontag", "revision", "slot"
Returns: frozenset
list (frozenset) of available package identifiers in category.
Raises:
  • AttributeError - if order_by value is invalid
Overrides: skel.EntropyRepositoryBase.listPackageIdsInCategory

lock_path(self)

source code 

Overridden from EntropyBaseRepository.

Overrides: skel.EntropyRepositoryBase.lock_path

mtime(self)

source code 

Reimplemented from EntropyRepositoryBase.

Returns: float
mtime
Raises:
  • IOError - if mtime cannot be retrieved
  • OSError - if mtime cannot be retrieved (Operating System error)
Overrides: skel.EntropyRepositoryBase.mtime

readonly(self)

source code 

Reimplemented from EntropySQLRepository.

Returns: bool
True, if repository is read-only
Overrides: skel.EntropyRepositoryBase.readonly

release_exclusive(self, opaque)

source code 

Reimplemented from EntropyBaseRepository.

Parameters:
  • opaque - the opaque object returned by *acquire_exclusive methods.
Overrides: skel.EntropyRepositoryBase.release_exclusive

release_shared(self, opaque)

source code 

Reimplemented from EntropyBaseRepository.

Parameters:
  • opaque - the opaque object returned by *acquire_shared methods.
Overrides: skel.EntropyRepositoryBase.release_shared

removeDependencies(self, package_id)

source code 

Reimplemented from EntropySQLRepository. We must handle live cache.

Parameters:
  • package_id - package indentifier
Overrides: skel.EntropyRepositoryBase.removeDependencies

retrieveBranchMigration(self, to_branch)

source code 

Reimplemented from EntropySQLRepository. We must handle backward compatibility.

Parameters:
  • to_branch - usually the current branch string
Returns: dict
branch migration metadata contained in database
Overrides: skel.EntropyRepositoryBase.retrieveBranchMigration

retrieveCategory(self, package_id)

source code 

Reimplemented from EntropySQLRepository. We must handle _baseinfo_extrainfo_2010. We must use the in-memory cache to do some memoization.

Parameters:
  • package_id - package indentifier
Returns: string or None
category where package is in
Overrides: skel.EntropyRepositoryBase.retrieveCategory

retrieveChangelog(self, package_id)

source code 

Reimplemented from EntropySQLRepository. We must handle _baseinfo_extrainfo_2010.

Parameters:
  • package_id - package indentifier
Returns: string or None
ChangeLog content
Overrides: skel.EntropyRepositoryBase.retrieveChangelog

retrieveCompileFlags(self, package_id)

source code 

Reimplemented from EntropySQLRepository. We must handle _baseinfo_extrainfo_2010.

Overrides: skel.EntropyRepositoryBase.retrieveCompileFlags

retrieveContentSafety(self, package_id)

source code 

Reimplemented from EntropySQLRepository. We must handle backward compatibility.

Parameters:
  • package_id - package indentifier
Returns: dict
content safety metadata
Overrides: skel.EntropyRepositoryBase.retrieveContentSafety

retrieveContentSafetyIter(self, package_id)

source code 

Reimplemented from EntropySQLRepository. We must handle backward compatibility.

Parameters:
  • package_id - package indentifier
  • order_by - order by string, valid values are: "type" (if extended is True), "file" or "package_id"
Returns: iterator
contentsafety metadata
Overrides: skel.EntropyRepositoryBase.retrieveContentSafetyIter

retrieveDependencies(self, package_id, extended=False, deptype=None, exclude_deptypes=None, resolve_conditional_deps=True)

source code 

Reimplemented from EntropyRepositoryBase. We must use the in-memory cache to do some memoization.

Parameters:
  • package_id - package indentifier
  • extended - return in extended format (list of tuples of length 2 composed by dependency name and dependency type)
  • deptype - return only given type of dependencies see etpConst['dependency_type_ids']['*depend_id'] for dependency type identifiers
  • exclude_deptypes - exclude given dependency types from returned data. Please see etpConst['dependency_type_ids'] for valid values. Anything != int will raise AttributeError
  • resolve_conditional_deps - resolve conditional dependencies automatically by default, stuff like ( app-foo/foo | app-foo/bar ) & bar-baz/foo
Returns: tuple or frozenset
dependencies of given package
Raises:
  • AttributeError - if exclude_deptypes contains illegal values
Overrides: skel.EntropyRepositoryBase.retrieveDependencies

retrieveDesktopMime(self, package_id)

source code 

Reimplemented from EntropySQLRepository. We must handle backward compatibility.

Parameters:
  • package_id - package indentifier
Returns: list
list of dict() containing file association information
Overrides: skel.EntropyRepositoryBase.retrieveDesktopMime

retrieveDigest(self, package_id)

source code 

Reimplemented from EntropySQLRepository. We must use the in-memory cache to do some memoization.

Parameters:
  • package_id - package indentifier
Returns: string or None
md5 checksum for given package identifier
Overrides: skel.EntropyRepositoryBase.retrieveDigest

retrieveExtraDownload(self, package_id, down_type=None)

source code 

Reimplemented from EntropySQLRepository. We must handle backward compatibility.

Parameters:
  • package_id - package indentifier
  • down_type - retrieve data for a given entry type. Currently supported entry types are: "debug", "data".
Returns: tuple
list (tuple) of dict containing "download", "type", "size", "disksize, "md5", "sha1","sha256", "sha512", "gpg" keys. "download" contains the relative URL (like the one returned by retrieveDownloadURL())
Raises:
  • AttributeError - if provided down_type value is invalid
Overrides: skel.EntropyRepositoryBase.retrieveExtraDownload

retrieveKeySlot(self, package_id)

source code 

Reimplemented from EntropyRepositoryBase. We must use the in-memory cache to do some memoization. We must handle _baseinfo_extrainfo_2010.

Parameters:
  • package_id - package indentifier
Returns:
tuple of length 2 composed by (package_key, package_slot,)
Overrides: skel.EntropyRepositoryBase.retrieveKeySlot

retrieveKeySlotAggregated(self, package_id)

source code 

Reimplemented from EntropyRepositoryBase.

Parameters:
  • package_id - package indentifier
Returns: string or None
package key + ":" + slot string
Overrides: skel.EntropyRepositoryBase.retrieveKeySlotAggregated

retrieveKeySlotTag(self, package_id)

source code 

Reimplemented from EntropyRepositoryBase.

Parameters:
  • package_id - package indentifier
Returns: tuple
tuple of length 3 providing (package_key, slot, package_tag,)
Overrides: skel.EntropyRepositoryBase.retrieveKeySlotTag

retrieveKeySplit(self, package_id)

source code 

Reimplemented from EntropySQLRepository. We must use the in-memory cache to do some memoization. We must handle _baseinfo_extrainfo_2010.

Parameters:
  • package_id - package indentifier
Returns:
tuple of length 2 composed by (package_category, package_name,)
Overrides: skel.EntropyRepositoryBase.retrieveKeySplit

retrievePreservedLibraries(self, library, elfclass)

source code 

Reimplemented from EntropySQLRepository.

Returns: frozenset
the list (tuple) of paths associated with a SONAME and its ELF class.
Overrides: skel.EntropyRepositoryBase.retrievePreservedLibraries

retrieveProvidedMime(self, package_id)

source code 

Reimplemented from EntropySQLRepository. We must handle backward compatibility.

Parameters:
  • package_id - package indentifier
Returns: frozenset
list (frozenset) of mimetypes
Overrides: skel.EntropyRepositoryBase.retrieveProvidedMime

retrieveRevision(self, package_id)

source code 

Reimplemented from EntropySQLRepository. We must use the in-memory cache to do some memoization.

Parameters:
  • package_id - package indentifier
Returns: int or None
Entropy-revision for given package indentifier
Overrides: skel.EntropyRepositoryBase.retrieveRevision

retrieveSlot(self, package_id)

source code 

Reimplemented from EntropySQLRepository. We must use the in-memory cache to do some memoization.

Parameters:
  • package_id - package indentifier
Returns: string or None
package slot
Overrides: skel.EntropyRepositoryBase.retrieveSlot

retrieveSpmMetadata(self, package_id)

source code 

Reimplemented from EntropySQLRepository. We must handle backward compatibility.

Parameters:
  • package_id - package indentifier
Returns: buffer
stored metadata
Overrides: skel.EntropyRepositoryBase.retrieveSpmMetadata

retrieveTag(self, package_id)

source code 

Reimplemented from EntropySQLRepository. We must use the in-memory cache to do some memoization.

Parameters:
  • package_id - package indentifier
Returns: string or None
tag string
Overrides: skel.EntropyRepositoryBase.retrieveTag

retrieveUseflags(self, package_id)

source code 

Reimplemented from EntropySQLRepository. We must use the in-memory cache to do some memoization.

Parameters:
  • package_id - package indentifier
Returns: frozenset
list (frozenset) of USE flags for given package identifier.
Overrides: skel.EntropyRepositoryBase.retrieveUseflags

retrieveVersion(self, package_id)

source code 

Reimplemented from EntropySQLRepository. We must use the in-memory cache to do some memoization.

Parameters:
  • package_id - package indentifier
Returns: string or None
package version
Overrides: skel.EntropyRepositoryBase.retrieveVersion

searchCategory(self, keyword, like=False, just_id=True)

source code 

Reimplemented from EntropySQLRepository. We must handle _baseinfo_extrainfo_2010.

Parameters:
  • keyword - category name
  • like - do not match exact case
  • just_id - return list of package identifiers (set()) otherwise return a list of tuples of length 2 containing atom and package_id values
Returns: frozenset
list (frozenset) of tuples of length 2 containing atom and package_id values
Overrides: skel.EntropyRepositoryBase.searchCategory

searchKeySlot(self, key, slot)

source code 

Reimplemented from EntropySQLRepository. We must handle _baseinfo_extrainfo_2010. We must use the in-memory cache to do some memoization.

Parameters:
  • key - package key
  • slot - package slot
Returns: frozenset
list (frozenset) of package identifiers
Overrides: skel.EntropyRepositoryBase.searchKeySlot

searchKeySlotTag(self, key, slot, tag)

source code 

Reimplemented from EntropySQLRepository. We must handle _baseinfo_extrainfo_2010. We must use the in-memory cache to do some memoization.

Parameters:
  • key - package key
  • slot - package slot
  • tag - restrict search using tag, if provided
Returns: frozenset
list (frozenset) of package identifiers
Overrides: skel.EntropyRepositoryBase.searchKeySlotTag

searchLicense(self, keyword, just_id=False)

source code 

Reimplemented from EntropySQLRepository. We must handle _baseinfo_extrainfo_2010.

Parameters:
  • keyword - license name to search
  • just_id - just return package identifiers, otherwise a frozenset of tuples of length 2 is returned
Returns: frozenset
list (frozenset) of packages using given license
Overrides: skel.EntropyRepositoryBase.searchLicense

searchNameCategory(self, name, category, just_id=False)

source code 

Reimplemented from EntropySQLRepository. We must handle _baseinfo_extrainfo_2010. We must use the in-memory cache to do some memoization.

Parameters:
  • name - package name to search
  • category - package category to search
  • just_id - return list of package identifiers (set()) otherwise return a list of tuples of length 2 containing atom and package_id values
Returns: frozenset
list (frozenset) of packages found
Overrides: skel.EntropyRepositoryBase.searchNameCategory

searchProvidedMime(self, mimetype)

source code 

Reimplemented from EntropySQLRepository. We must handle backward compatibility.

Parameters:
  • mimetype - mimetype to search
Returns: tuple
list (tuple) of package indentifiers owning given mimetype.
Overrides: skel.EntropyRepositoryBase.searchProvidedMime

searchSets(self, keyword)

source code 

Reimplemented from EntropySQLRepository. We must handle backward compatibility.

Parameters:
  • keyword - package set name to search
Returns: frozenset
list (frozenset) of package sets available matching given keyword
Overrides: skel.EntropyRepositoryBase.searchSets

setAtom(self, package_id, atom)

source code 

Reimplemented from EntropySQLRepository. We must handle live cache.

Parameters:
  • package_id - package indentifier
  • atom - atom string
Overrides: skel.EntropyRepositoryBase.setAtom

setCategory(self, package_id, category)

source code 

Reimplemented from EntropySQLRepository. We must handle _baseinfo_extrainfo_2010 and live cache.

Parameters:
  • package_id - package indentifier
  • category - category to set
Overrides: skel.EntropyRepositoryBase.setCategory

setDependency(self, iddependency, dependency)

source code 

Reimplemented from EntropySQLRepository. We must handle live cache.

Parameters:
  • iddependency - dependency string identifier
  • dependency - dependency string
Overrides: skel.EntropyRepositoryBase.setDependency

setInstalledPackageSource(self, package_id, source)

source code 

Reimplemented from EntropySQLRepository. We must handle live cache.

Parameters:
  • package_id - package indentifier
  • source - install source identified
Overrides: skel.EntropyRepositoryBase.setInstalledPackageSource

setName(self, package_id, name)

source code 

Reimplemented from EntropySQLRepository. We must handle live cache.

Parameters:
  • package_id - package indentifier
  • name - package name
Overrides: skel.EntropyRepositoryBase.setName

setRevision(self, package_id, revision)

source code 

Reimplemented from EntropySQLRepository. We must handle live cache.

Parameters:
  • package_id - package indentifier
  • revision - new revision
Overrides: skel.EntropyRepositoryBase.setRevision

setSlot(self, package_id, slot)

source code 

Reimplemented from EntropySQLRepository. We must handle live cache.

Parameters:
  • package_id - package indentifier
  • slot - slot string
Overrides: skel.EntropyRepositoryBase.setSlot

storeInstalledPackage(self, package_id, repoid, source=0)

source code 

Reimplemented from EntropySQLRepository.

Parameters:
  • package_id - package indentifier
  • repoid - repository identifier
  • source - source identifier (pleas see: etpConst['install_sources'])
Overrides: skel.EntropyRepositoryBase.storeInstalledPackage

try_acquire_exclusive(self)

source code 

Reimplemented from EntropyBaseRepository.

Returns: object or None
an opaque object that must be used to release the lock, None otherwise.
Overrides: skel.EntropyRepositoryBase.try_acquire_exclusive

try_acquire_shared(self)

source code 

Reimplemented from EntropyBaseRepository.

Returns: object or None
an opaque object that must be used to release the lock, None otherwise.
Overrides: skel.EntropyRepositoryBase.try_acquire_shared

vacuum(self)

source code 

Reimplemented from EntropySQLRepository.

Overrides: skel.EntropyRepositoryBase.vacuum

Class Variable Details

SETTING_KEYS

Value:
('arch',
 'on_delete_cascade',
 'schema_revision',
 '_baseinfo_extrainfo_2010')