From 96a91dcdacff053d896782f2ac9656f1c2ba082e Mon Sep 17 00:00:00 2001 From: Marius Mauch Date: Sun, 21 Oct 2007 10:34:35 +0000 Subject: [PATCH] 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 --- pym/portage/news.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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): """ -- 2.26.2