From 6708eb9e7ef584cbfb482ed99fa4b38780a0ab3b Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Mon, 4 Aug 2008 09:19:23 +0000 Subject: [PATCH] Fix 999+ bug of pisi hs --- pisi/db/historydb.py | 2 +- pisi/history.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pisi/db/historydb.py b/pisi/db/historydb.py index 998e9f10..79804418 100644 --- a/pisi/db/historydb.py +++ b/pisi/db/historydb.py @@ -28,7 +28,7 @@ class HistoryDB(lazydb.LazyDB): def __generate_history(self): logs = filter(lambda x:x.endswith(".xml"), os.listdir(ctx.config.history_dir())) - logs.sort() + logs.sort(lambda x,y:int(x.split("_")[0]) - int(y.split("_")[0])) logs.reverse() return logs diff --git a/pisi/history.py b/pisi/history.py index 5d585a4d..6d883492 100644 --- a/pisi/history.py +++ b/pisi/history.py @@ -126,6 +126,6 @@ class History(xmlfile.XmlFile): if not files: return "001" - files.sort() + files.sort(lambda x,y:int(x.split("_")[0]) - int(y.split("_")[0])) no, opxml = files[-1].split("_") return "%03d" % (int(no) + 1)