fix apply_permissions import and use keyworded args in the call, as well as PORTAGE_I...
authorAlec Warner <antarus@gentoo.org>
Thu, 18 Jan 2007 06:34:52 +0000 (06:34 -0000)
committerAlec Warner <antarus@gentoo.org>
Thu, 18 Jan 2007 06:34:52 +0000 (06:34 -0000)
svn path=/main/trunk/; revision=5699

bin/emerge
pym/portage_news.py

index bf29453a00438ad362b54639465e7ba84b9ecac1..330e8bc6f7304f040333e9b9f24b9c4f551ba11d 100755 (executable)
@@ -200,7 +200,7 @@ options=[
 "--searchdesc",   "--selective",
 "--skipfirst",
 "--tree",
-"--update",       
+"--update",
 "--usepkg",       "--usepkgonly",
 "--verbose",      "--version"
 ]
index c06a726a0163ed063d13aadff4cbe8716406ce13..a0cb885aee88568d634e556d6bfbd5c4f90f561d 100644 (file)
@@ -5,7 +5,7 @@
 
 from portage_const import INCREMENTALS, PROFILE_PATH, NEWS_LIB_PATH
 from portage import config, vartree, vardbapi, portdbapi
-from portage_util import ensure_dirs
+from portage_util import ensure_dirs, apply_permissions
 from portage_data import portage_gid
 from portage_locks import lockfile, unlockfile, lockdir, unlockdir
 
@@ -89,7 +89,8 @@ class NewsManager(object):
                        unread_lock = lockfile( path )
                        # Make sure we have the correct permissions when created
                        unread_file = open( path, "a" )
-                       apply_permissions( unreadfile, 0, portage_gid, 664 )
+                       apply_permissions( filename=unreadfile,
+                               uid=self.config["PORTAGE_INST_UID"], gid=portage_gid, mode=664 )
                
                        for item in updates:
                                unread_file.write( item.path + "\n" )
@@ -113,7 +114,8 @@ class NewsManager(object):
                unreadfile = os.path.join( self.UNREAD_PATH, "news-"+ repoid +".unread" )
                # Set correct permissions on the news-repoid.unread file
                try:
-                       apply_permissions( unreadfile, 0, portage_gid, 664 )
+                       apply_permissions( filename=unreadfile, 
+                               uid=self.config["PORTAGE_INST_UID"], gid=portage_gid, mode=664 )
                except FileNotFound:
                        pass # It may not exist yet, thats ok.