diff --git a/lib/entropy/db/skel.py b/lib/entropy/db/skel.py index 5a9db1655..523a70485 100644 --- a/lib/entropy/db/skel.py +++ b/lib/entropy/db/skel.py @@ -2003,6 +2003,7 @@ class EntropyRepositoryBase(TextInterface, EntropyRepositoryPluginStore): audience. List all the available "treeupdates" (package names/slots changes directives) actions. + Actions must be sorted by date (FLOAT). @keyword no_ids_repos: if True, it will just return a tuple of 3-length tuples containing ((command, branch, unix_time,), ...) @@ -2018,6 +2019,7 @@ class EntropyRepositoryBase(TextInterface, EntropyRepositoryPluginStore): audience. Return all the available "treeupdates (package names/slots changes directives) actions for provided repository. + Actions must be sorted by date (FLOAT). @param repository: repository identifier @type repository: string diff --git a/lib/entropy/db/sql.py b/lib/entropy/db/sql.py index eae201924..065a78553 100644 --- a/lib/entropy/db/sql.py +++ b/lib/entropy/db/sql.py @@ -2581,11 +2581,12 @@ class EntropySQLRepository(EntropyRepositoryBase): if no_ids_repos: cur = self._cursor().execute(""" SELECT command, branch, date FROM treeupdatesactions + ORDER BY CAST(date AS FLOAT) """) else: cur = self._cursor().execute(""" SELECT idupdate, repository, command, branch, date - FROM treeupdatesactions + FROM treeupdatesactions ORDER BY CAST(date AS FLOAT) """) return tuple(cur) @@ -2597,7 +2598,7 @@ class EntropySQLRepository(EntropyRepositoryBase): cur = self._cursor().execute(""" SELECT command FROM treeupdatesactions WHERE - repository = ? ORDER BY date""", params) + repository = ? ORDER BY CAST(date AS FLOAT)""", params) return self._cur2tuple(cur) def bumpTreeUpdatesActions(self, updates):