public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoopm:master commit in: gentoopm/portagepm/, gentoopm/basepm/
Date: Tue, 12 Jul 2011 08:43:40 +0000 (UTC)	[thread overview]
Message-ID: <5bcd5b16d08ae263e9973196f144b72b8c7b7d0a.mgorny@gentoo> (raw)

commit:     5bcd5b16d08ae263e9973196f144b72b8c7b7d0a
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 12 08:44:18 2011 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Jul 12 08:44:18 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoopm.git;a=commit;h=5bcd5b16

Portage: support grabbing userpriv from config.

---
 gentoopm/basepm/config.py    |   27 ++++++++++++++++++++++++++-
 gentoopm/portagepm/config.py |   14 ++++++++++++++
 2 files changed, 40 insertions(+), 1 deletions(-)

diff --git a/gentoopm/basepm/config.py b/gentoopm/basepm/config.py
index 90dbb67..d011001 100644
--- a/gentoopm/basepm/config.py
+++ b/gentoopm/basepm/config.py
@@ -8,4 +8,29 @@ from abc import abstractproperty
 from gentoopm.util import ABCObject
 
 class PMConfig(ABCObject):
-	pass
+	@abstractproperty
+	def userpriv_enabled(self):
+		"""
+		Check whether root privileges are dropped for build-time.
+
+		@type: bool
+		"""
+		pass
+
+	@abstractproperty
+	def userpriv_uid(self):
+		"""
+		The UID used for userpriv.
+
+		@type: string/numeric
+		"""
+		pass
+
+	@abstractproperty
+	def userpriv_gid(self):
+		"""
+		The GID used for userpriv.
+
+		@type: string/numeric
+		"""
+		pass

diff --git a/gentoopm/portagepm/config.py b/gentoopm/portagepm/config.py
index 5f80506..5bb697d 100644
--- a/gentoopm/portagepm/config.py
+++ b/gentoopm/portagepm/config.py
@@ -3,8 +3,22 @@
 # (c) 2011 Michał Górny <mgorny@gentoo.org>
 # Released under the terms of the 2-clause BSD license.
 
+import portage.data
+
 from gentoopm.basepm.config import PMConfig
 
 class PortageConfig(PMConfig):
 	def __init__(self, settings):
 		self._settings = settings
+
+	@property
+	def userpriv_enabled(self):
+		return 'userpriv' in self._settings.features
+
+	@property
+	def userpriv_uid(self):
+		return portage.data.portage_uid
+
+	@property
+	def userpriv_gid(self):
+		return portage.data.portage_gid



             reply	other threads:[~2011-07-12  8:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-12  8:43 Michał Górny [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-07-07 19:55 [gentoo-commits] proj/gentoopm:master commit in: gentoopm/portagepm/, gentoopm/basepm/ Michał Górny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5bcd5b16d08ae263e9973196f144b72b8c7b7d0a.mgorny@gentoo \
    --to=mgorny@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox