[entropy.db] add order_by="date" support to listAllPackageIds
This commit is contained in:
@@ -4484,15 +4484,21 @@ class EntropyRepository(EntropyRepositoryBase):
|
||||
order_by_string = ''
|
||||
if order_by is not None:
|
||||
valid_order_by = ("atom", "idpackage", "package_id", "branch",
|
||||
"name", "version", "versiontag", "revision", "slot")
|
||||
"name", "version", "versiontag", "revision", "slot", "date")
|
||||
if order_by not in valid_order_by:
|
||||
raise AttributeError("invalid order_by argument")
|
||||
if order_by == "package_id":
|
||||
order_by = "idpackage"
|
||||
order_by_string = ' order by %s' % (order_by,)
|
||||
|
||||
cur = self._cursor().execute("""
|
||||
SELECT idpackage FROM baseinfo""" + order_by_string)
|
||||
if order_by == "date":
|
||||
cur = self._cursor().execute("""
|
||||
SELECT baseinfo.idpackage FROM baseinfo, extrainfo
|
||||
WHERE baseinfo.idpackage = extrainfo.idpackage
|
||||
ORDER BY extrainfo.datecreation DESC""")
|
||||
else:
|
||||
cur = self._cursor().execute("""
|
||||
SELECT idpackage FROM baseinfo""" + order_by_string)
|
||||
|
||||
try:
|
||||
if order_by:
|
||||
|
||||
@@ -3272,7 +3272,7 @@ class EntropyRepositoryBase(TextInterface, EntropyRepositoryPluginStore):
|
||||
List all package identifiers available in repository.
|
||||
|
||||
@keyword order_by: order by "atom", "idpackage", "package_id", "branch",
|
||||
"name", "version", "versiontag", "revision", "slot"
|
||||
"name", "version", "versiontag", "revision", "slot", "date"
|
||||
@type order_by: string
|
||||
@return: tuple (if order_by) or frozenset of package identifiers
|
||||
@rtype: tuple or frozenset
|
||||
|
||||
Reference in New Issue
Block a user