I really meant NEWS_LIB_PATH (/var/lib/gentoo) but decent idea to have a timestamp...
authorAlec Warner <antarus@gentoo.org>
Thu, 18 Jan 2007 17:37:27 +0000 (17:37 -0000)
committerAlec Warner <antarus@gentoo.org>
Thu, 18 Jan 2007 17:37:27 +0000 (17:37 -0000)
svn path=/main/trunk/; revision=5704

pym/portage_news.py

index 4434c1294e9d2a37ed579cfc8ab5e9212d87b62b..5cbb7c1a350b2c0b0061c6b37ce4716c9ce44ee4 100644 (file)
@@ -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 ):