From d2cf1889624bc7f7e1737deb871bdbbc637ee023 Mon Sep 17 00:00:00 2001 From: Alec Warner Date: Thu, 18 Jan 2007 17:37:27 +0000 Subject: [PATCH] I really meant NEWS_LIB_PATH (/var/lib/gentoo) but decent idea to have a timestamp per repo ;) svn path=/main/trunk/; revision=5704 --- pym/portage_news.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pym/portage_news.py b/pym/portage_news.py index 4434c1294..5cbb7c1a3 100644 --- a/pym/portage_news.py +++ b/pym/portage_news.py @@ -54,11 +54,12 @@ class NewsManager(object): if repoid not in repos: raise ValueError("Invalid repoID: %s" % repoid) - if os.path.exists(self.TIMESTAMP_PATH): + timestamp_file = self.TIMESTAMP_PATH + repoid + if os.path.exists(timestamp_file): # Make sure the timestamp has correct permissions. - apply_permissions( filename=self.TIMESTAMP_FILE, + apply_permissions( filename=timestamp_file, uid=self.config["PORTAGE_INST_UID"], gid=portage_gid, mode=664 ) - timestamp = os.stat(self.TIMESTAMP_PATH).st_mtime + timestamp = os.stat(timestamp_file).st_mtime else: timestamp = 0 @@ -104,7 +105,7 @@ class NewsManager(object): unlockfile(unread_lock) # Touch the timestamp file - f = open(self.TIMESTAMP_PATH, "w") + f = open(timestamp_file, "w") f.close() def getUnreadItems( self, repoid, update=False ): -- 2.26.2