Revert "[entropy.db] drop isPackageScopeAvailable(), unused"
This reverts commit 492ace12e8.
This commit is contained in:
@@ -4787,6 +4787,21 @@ class EntropyRepository(EntropyRepositoryBase):
|
||||
return frozenset((y for x, y in data))
|
||||
return data
|
||||
|
||||
def isPackageScopeAvailable(self, atom, slot, revision):
|
||||
"""
|
||||
Reimplemented from EntropyRepositoryBase.
|
||||
"""
|
||||
searchdata = (atom, slot, revision,)
|
||||
cur = self._cursor().execute("""
|
||||
SELECT idpackage FROM baseinfo
|
||||
where atom = (?) AND slot = (?) AND revision = (?) LIMIT 1
|
||||
""", searchdata)
|
||||
rslt = cur.fetchone()
|
||||
|
||||
if rslt: # check if it's masked
|
||||
return self.maskFilter(rslt[0])
|
||||
return -1, 0
|
||||
|
||||
def isBranchMigrationAvailable(self, repository, from_branch, to_branch):
|
||||
"""
|
||||
Reimplemented from EntropyRepositoryBase.
|
||||
|
||||
@@ -3517,6 +3517,23 @@ class EntropyRepositoryBase(TextInterface, EntropyRepositoryPluginStore):
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def isPackageScopeAvailable(self, atom, slot, revision):
|
||||
"""
|
||||
Return whether given package scope is available.
|
||||
Also check if package found is masked and return masking reason
|
||||
identifier.
|
||||
|
||||
@param atom: package atom string
|
||||
@type atom: string
|
||||
@param slot: package slot string
|
||||
@type slot: string
|
||||
@param revision: entropy package revision
|
||||
@type revision: int
|
||||
@return: tuple composed by (package_id or -1, idreason or 0,)
|
||||
@rtype: tuple
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def isBranchMigrationAvailable(self, repository, from_branch, to_branch):
|
||||
"""
|
||||
Returns whether branch migration metadata given by the provided key
|
||||
|
||||
Reference in New Issue
Block a user