From: Marius Mauch Date: Sun, 21 Oct 2007 10:34:35 +0000 (-0000) Subject: ignore "permission denied" errors when changing perms of news skipfile that happen... X-Git-Tag: v2.2_pre1~570 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=96a91dcdacff053d896782f2ac9656f1c2ba082e;p=portage.git 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 --- 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): """