Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/
Date: Sat, 07 Sep 2019 06:40:22
Message-Id: 1567838305.466efb88ab3d72b90aff8c6235f22d7cee99fe15.zmedico@gentoo
1 commit: 466efb88ab3d72b90aff8c6235f22d7cee99fe15
2 Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
3 AuthorDate: Sat Sep 7 06:35:03 2019 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 7 06:38:25 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=466efb88
7
8 grab_updates: use key for file name sort
9
10 Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>
11
12 lib/portage/update.py | 6 ++----
13 1 file changed, 2 insertions(+), 4 deletions(-)
14
15 diff --git a/lib/portage/update.py b/lib/portage/update.py
16 index 83fc3d2b4..1920d213a 100644
17 --- a/lib/portage/update.py
18 +++ b/lib/portage/update.py
19 @@ -188,10 +188,8 @@ def grab_updates(updpath, prev_mtimes=None):
20 if len(mylist) == 0:
21 return []
22
23 - # update names are mangled to make them sort properly
24 - mylist = [myfile[3:]+"-"+myfile[:2] for myfile in mylist]
25 - mylist.sort()
26 - mylist = [myfile[5:]+"-"+myfile[:4] for myfile in mylist]
27 + # sort by (year, quarter)
28 + mylist.sort(key=lambda x: (x[3:], x[:2]))
29
30 update_data = []
31 for myfile in mylist: