public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Paul Varner" <fuzzyray@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/
Date: Mon, 18 Apr 2011 18:28:51 +0000 (UTC)	[thread overview]
Message-ID: <6e7df927a6225066de1c4f100cd4e8541b5aa3f0.fuzzyray@gentoo> (raw)

commit:     6e7df927a6225066de1c4f100cd4e8541b5aa3f0
Author:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 18 18:27:17 2011 +0000
Commit:     Paul Varner <fuzzyray <AT> gentoo <DOT> org>
CommitDate: Mon Apr 18 18:27:17 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=6e7df927

Change eprefix.py to only look at portage for the value of EPREFIX

---
 pym/gentoolkit/eprefix.py |   28 +++++++++-------------------
 1 files changed, 9 insertions(+), 19 deletions(-)

diff --git a/pym/gentoolkit/eprefix.py b/pym/gentoolkit/eprefix.py
index 9a04e4b..48bd140 100644
--- a/pym/gentoolkit/eprefix.py
+++ b/pym/gentoolkit/eprefix.py
@@ -10,25 +10,15 @@
 used in all gentoolkit modules
 
 Example useage:  from gentoolkit.eprefix import EPREFIX
-then in code add it to the filepath eg.:  
+then in code add it to the filepath eg.:
 	exclude_file = "%s/etc/%s/%s.exclude" % (EPREFIX,__productname__ , action)
 
 """
-
-import os
-
-
-EPREFIX = ''
-
-# the following code is used to set it when
-# non-installed code is being run
-if 'EPREFIX' in os.environ:
-	EPREFIX = os.environ['EPREFIX']
-else:
-	try:
-		import portage.const
-		EPREFIX = portage.BPREFIX
-	except AttributeError:
-		EPREFIX = ''
-
-#print("EPREFIX set to:", EPREFIX)
+# Load EPREFIX from Portage, fall back to the empty string if it fails
+try:
+	from portage.const import EPREFIX
+except ImportError:
+	EPREFIX = ''
+
+if __name__ == "__main__":
+	print("EPREFIX set to:", EPREFIX)



             reply	other threads:[~2011-04-18 18:29 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-18 18:28 Paul Varner [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-06-02 22:10 [gentoo-commits] proj/gentoolkit:gentoolkit commit in: pym/gentoolkit/ Paul Varner
2014-02-22 19:28 Brian Dolbec
2013-03-12 16:06 Mike Frysinger
2013-01-04 22:23 Paul Varner
2012-12-30 20:25 Brian Dolbec
2012-11-13 20:40 Paul Varner
2012-11-13 20:40 Paul Varner
2012-11-13 20:40 Paul Varner
2012-11-13 20:40 Paul Varner
2012-11-13 20:40 Paul Varner
2012-11-13 20:40 Paul Varner
2012-11-13 20:40 Paul Varner
2012-11-13 20:40 Paul Varner
2012-11-13 20:40 Paul Varner
2012-11-13 20:40 Paul Varner
2012-11-13 20:40 Paul Varner
2012-11-13 20:40 Paul Varner
2012-11-13 20:40 Paul Varner
2012-11-13 20:40 Paul Varner
2012-11-13 20:40 Paul Varner
2012-11-13 20:40 Paul Varner
2012-10-09 21:35 Paul Varner
2012-08-01  3:34 Brian Dolbec
2012-07-24 17:18 Paul Varner
2012-05-16 21:18 Paul Varner
2012-03-02  0:01 Brian Dolbec
2011-12-23  6:05 Brian Dolbec
2011-07-16  4:04 Paul Varner
2011-07-16  3:21 Paul Varner
2011-07-15 20:02 Paul Varner
2011-05-23  3:45 Brian Dolbec
2011-05-20  5:54 Brian Dolbec
2011-05-18 21:18 Brian Dolbec
2011-03-31 21:53 Paul Varner
2011-02-23  9:10 Brian Dolbec

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=6e7df927a6225066de1c4f100cd4e8541b5aa3f0.fuzzyray@gentoo \
    --to=fuzzyray@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