From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id AB689138A6C for ; Tue, 18 Nov 2014 10:57:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 038FDE08E0; Tue, 18 Nov 2014 10:57:54 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8B0A0E08DF for ; Tue, 18 Nov 2014 10:57:53 +0000 (UTC) Received: from big_daddy.dol-sen.ca (S010634bdfa9ecf80.vc.shawcable.net [96.49.31.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dolsen) by smtp.gentoo.org (Postfix) with ESMTPSA id 9BA983401B3 for ; Tue, 18 Nov 2014 10:57:52 +0000 (UTC) Date: Tue, 18 Nov 2014 02:57:43 -0800 From: Brian Dolbec To: gentoo-portage-dev@lists.gentoo.org Subject: Re: [gentoo-portage-dev] [PATCH] emerge: check for writable /var/db/pkg (490732) Message-ID: <20141118025743.45199dce.dolsen@gentoo.org> In-Reply-To: <1416302341-18857-1-git-send-email-zmedico@gentoo.org> References: <1416302341-18857-1-git-send-email-zmedico@gentoo.org> Organization: Gentoo Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Archives-Salt: 54ae12dd-f2e0-46ab-a349-5a7f46bffa24 X-Archives-Hash: c15d31cce03a055cdbe9cebdbeb8eacd On Tue, 18 Nov 2014 01:19:01 -0800 Zac Medico wrote: > If there are packages to be merged or unmerge, then bail out early if > /var/db/pkg is not writable. > ... > diff --git a/pym/portage/dbapi/vartree.py > b/pym/portage/dbapi/vartree.py index 0fd1bd9..64b0ff6 100644 > --- a/pym/portage/dbapi/vartree.py > +++ b/pym/portage/dbapi/vartree.py > @@ -33,6 +33,7 @@ portage.proxy.lazyimport.lazyimport(globals(), > 'portage.util.env_update:env_update', > 'portage.util.listdir:dircache,listdir', > 'portage.util.movefile:movefile', > + 'portage.util.path:first_existing', > 'portage.util.writeable_check:get_ro_checker', ^^^^^^^^^^^^^^^^^^^^^^^^ That's what this was suppose to fix I thought > 'portage.util._dyn_libs.PreservedLibsRegistry:PreservedLibsRegistry', > 'portage.util._dyn_libs.LinkageMapELF:LinkageMapELF@LinkageMap', > @@ -189,6 +190,14 @@ class vardbapi(dbapi): > self._cached_counter = None > > @property > + def writable(self): > + """ > + @rtype: bool > + @return: True if var/db/pkg is writable, False > otherwise > + """ > + return os.access(first_existing(self._dbroot), > os.W_OK) + > + @property > def root(self): > warnings.warn("The root attribute of " > "portage.dbapi.vartree.vardbapi" -- Brian Dolbec