summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Mauch <genone@gentoo.org>2007-10-21 10:34:35 +0000
committerMarius Mauch <genone@gentoo.org>2007-10-21 10:34:35 +0000
commit96a91dcdacff053d896782f2ac9656f1c2ba082e (patch)
tree200e3be37cf62c89d007e0a85969c7aecb719ff0
parent6f208bd2ec6cc1ef57b2e9efe143dacb9a5cd3fe (diff)
downloadportage-96a91dcdacff053d896782f2ac9656f1c2ba082e.tar.gz
portage-96a91dcdacff053d896782f2ac9656f1c2ba082e.tar.bz2
portage-96a91dcdacff053d896782f2ac9656f1c2ba082e.zip
ignore "permission denied" errors when changing perms of news skipfile that happen when running with user priviledges in pretend mode
svn path=/main/trunk/; revision=8202
-rw-r--r--pym/portage/news.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/pym/portage/news.py b/pym/portage/news.py
index 6f2eac2b2..b9326c94d 100644
--- a/pym/portage/news.py
+++ b/pym/portage/news.py
@@ -100,8 +100,17 @@ class NewsManager(object):
finally:
unlockfile(unread_lock)
write_atomic(skipfile, "\n".join(skiplist)+"\n")
- apply_permissions(filename=skipfile,
+ try:
+ apply_permissions(filename=skipfile,
uid=int(self.config["PORTAGE_INST_UID"]), gid=portage_gid, mode=0664)
+ except OSError, e:
+ import errno
+ # skip "permission denied" errors as we're likely running in pretend mode
+ # with reduced priviledges
+ if e.errno == errno.EPERM:
+ pass
+ else:
+ raise
def getUnreadItems(self, repoid, update=False):
"""