diff --git a/libraries/entropy/db/__init__.py b/libraries/entropy/db/__init__.py index 72d38b8f6..d01bf3fea 100644 --- a/libraries/entropy/db/__init__.py +++ b/libraries/entropy/db/__init__.py @@ -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: diff --git a/libraries/entropy/db/skel.py b/libraries/entropy/db/skel.py index 53f72dfcc..b3a297853 100644 --- a/libraries/entropy/db/skel.py +++ b/libraries/entropy/db/skel.py @@ -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