summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-04-25 04:40:12 +0000
committerZac Medico <zmedico@gentoo.org>2006-04-25 04:40:12 +0000
commit8b234267b46885f9c17ec1979a05a1ee55d5bc22 (patch)
tree247d47449a00f2e23f394feaf45ffbfeb71d86f0
parent6f34180e053d44d4842b9a31eea2fa42d1d60c60 (diff)
downloadportage-8b234267b46885f9c17ec1979a05a1ee55d5bc22.tar.gz
portage-8b234267b46885f9c17ec1979a05a1ee55d5bc22.tar.bz2
portage-8b234267b46885f9c17ec1979a05a1ee55d5bc22.zip
Split a config.validate() method and move PORTAGE_TMPDIR sanity check to doebuild.
svn path=/main/trunk/; revision=3224
-rw-r--r--pym/portage.py29
1 files changed, 17 insertions, 12 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 8ab65b1f0..e69310d9f 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -1263,6 +1263,13 @@ class config:
self["CBUILD"] = self["CHOST"]
self.backup_changes("CBUILD")
+ if mycpv:
+ self.setcpv(mycpv)
+
+ def validate(self):
+ """Validate miscellaneous settings and display warnings if necessary.
+ (This code was previously in the global scope of portage.py)"""
+
groups = self["ACCEPT_KEYWORDS"].split()
archlist = self.archlist()
if not archlist:
@@ -1278,9 +1285,6 @@ class config:
writemsg("!!! It should point into a profile within %s/profiles/\n" % self["PORTDIR"])
writemsg("!!! (You can safely ignore this message when syncing. It's harmless.)\n\n\n")
- if mycpv:
- self.setcpv(mycpv)
-
def loadVirtuals(self,root):
"""Not currently used by portage."""
writemsg("DEPRECATED: portage.config.loadVirtuals\n")
@@ -2563,6 +2567,15 @@ def doebuild(myebuild,mydo,myroot,mysettings,debug=0,listonly=0,fetchonly=0,clea
retval = spawn(EBUILD_SH_BINARY+" depend",mysettings)
return retval
+ if not os.path.exists(mysettings["PORTAGE_TMPDIR"]):
+ writemsg("The directory specified in your PORTAGE_TMPDIR variable, '%s',\n" % mysettings["PORTAGE_TMPDIR"])
+ writemsg("does not exist. Please create this directory or correct your PORTAGE_TMPDIR setting.\n")
+ return 1
+ elif not os.path.isdir(mysettings["PORTAGE_TMPDIR"]):
+ writemsg("portage: the directory specified in your PORTAGE_TMPDIR variable, '%s',\n" % mysettings["PORTAGE_TMPDIR"])
+ writemsg("is not a directory. Please correct your PORTAGE_TMPDIR setting.\n")
+ return 1
+
logfile=None
# Build directory creation isn't required for any of these.
if mydo not in ["fetch","digest","manifest"]:
@@ -6786,6 +6799,7 @@ settings.reset() # XXX: Regenerate use after we get a vartree -- GLOBAL
portdb=portdbapi(settings["PORTDIR"])
settings.lock()
+settings.validate()
if 'selinux' in settings["USE"].split(" "):
try:
@@ -6856,15 +6870,6 @@ if root!="/":
thirdpartymirrors = settings.thirdpartymirrors()
-if not os.path.exists(settings["PORTAGE_TMPDIR"]):
- writemsg("portage: the directory specified in your PORTAGE_TMPDIR variable, \""+settings["PORTAGE_TMPDIR"]+",\"\n")
- writemsg("does not exist. Please create this directory or correct your PORTAGE_TMPDIR setting.\n")
- sys.exit(1)
-if not os.path.isdir(settings["PORTAGE_TMPDIR"]):
- writemsg("portage: the directory specified in your PORTAGE_TMPDIR variable, \""+settings["PORTAGE_TMPDIR"]+",\"\n")
- writemsg("is not a directory. Please correct your PORTAGE_TMPDIR setting.\n")
- sys.exit(1)
-
# COMPATABILITY -- This shouldn't be used.
pkglines = settings.packages