public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r13219 - in main/branches/2.1.6: bin pym/portage
@ 2009-03-27  4:32 Zac Medico (zmedico)
  0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2009-03-27  4:32 UTC (permalink / raw
  To: gentoo-commits

Author: zmedico
Date: 2009-03-27 04:32:25 +0000 (Fri, 27 Mar 2009)
New Revision: 13219

Modified:
   main/branches/2.1.6/bin/ebuild.sh
   main/branches/2.1.6/pym/portage/__init__.py
Log:
Move checks for /usr/lib/distcc/bin and /usr/lib/ccache/bin to the python
side and don't add distcc to CC and CXX when /usr/lib/distcc/bin doesn't exist
since that won't necessarily work. Thanks to Jeroen Roovers <jer@g.o> for
reporting the issue with adding distcc to CC. (trunk r13198)

Modified: main/branches/2.1.6/bin/ebuild.sh
===================================================================
--- main/branches/2.1.6/bin/ebuild.sh	2009-03-27 04:31:36 UTC (rev 13218)
+++ main/branches/2.1.6/bin/ebuild.sh	2009-03-27 04:32:25 UTC (rev 13219)
@@ -1887,27 +1887,16 @@
 	if ! hasq $EBUILD_SH_ARGS clean depend help info nofetch ; then
 
 		if hasq distcc $FEATURES ; then
-			if [ -d /usr/lib/distcc/bin ] ; then
-				[[ -z ${PATH/*distcc*/} ]] && remove_path_entry distcc
-				export PATH="/usr/lib/distcc/bin:$PATH"
-				[[ -n $DISTCC_LOG ]] && addwrite "${DISTCC_LOG%/*}"
-			elif type -P distcc >/dev/null ; then
-				! hasq distcc $CC && export CC="distcc $CC"
-				! hasq distcc $CXX && export CXX="distcc $CXX"
-			fi
+			[[ -z ${PATH/*distcc*/} ]] && remove_path_entry distcc
+			export PATH="/usr/lib/distcc/bin:$PATH"
+			[[ -n $DISTCC_LOG ]] && addwrite "${DISTCC_LOG%/*}"
 		fi
 
 		if hasq ccache $FEATURES ; then
 			[[ -z ${PATH/*ccache*/} ]] && remove_path_entry ccache
 
-			if [ -d /usr/lib/ccache/bin ] ; then
-				export PATH="/usr/lib/ccache/bin:$PATH"
-			elif [ -d /usr/bin/ccache ] ; then
-				export PATH="/usr/bin/ccache:$PATH"
-			fi
+			export PATH="/usr/lib/ccache/bin:$PATH"
 
-			[[ -z $CCACHE_DIR ]] && export CCACHE_DIR=/var/tmp/ccache
-
 			addread "$CCACHE_DIR"
 			addwrite "$CCACHE_DIR"
 

Modified: main/branches/2.1.6/pym/portage/__init__.py
===================================================================
--- main/branches/2.1.6/pym/portage/__init__.py	2009-03-27 04:31:36 UTC (rev 13218)
+++ main/branches/2.1.6/pym/portage/__init__.py	2009-03-27 04:32:25 UTC (rev 13219)
@@ -5338,10 +5338,12 @@
 
 	features_dirs = {
 		"ccache":{
+			"path_dir": "/usr/lib/ccache/bin",
 			"basedir_var":"CCACHE_DIR",
 			"default_dir":os.path.join(mysettings["PORTAGE_TMPDIR"], "ccache"),
 			"always_recurse":False},
 		"distcc":{
+			"path_dir": "/usr/lib/distcc/bin",
 			"basedir_var":"DISTCC_DIR",
 			"default_dir":os.path.join(mysettings["BUILD_PREFIX"], ".distcc"),
 			"subdirs":("lock", "state"),
@@ -5357,11 +5359,16 @@
 		"userpriv" not in restrict
 	for myfeature, kwargs in features_dirs.iteritems():
 		if myfeature in mysettings.features:
-			basedir = mysettings[kwargs["basedir_var"]]
-			if basedir == "":
+			failure = False
+			basedir = mysettings.get(kwargs["basedir_var"])
+			if basedir is None or not basedir.strip():
 				basedir = kwargs["default_dir"]
 				mysettings[kwargs["basedir_var"]] = basedir
 			try:
+				path_dir = kwargs["path_dir"]
+				if not os.path.isdir(path_dir):
+					raise portage.exception.DirectoryNotFound(path_dir)
+
 				mydirs = [mysettings[kwargs["basedir_var"]]]
 				if "subdirs" in kwargs:
 					for subdir in kwargs["subdirs"]:
@@ -5411,14 +5418,25 @@
 						filemode=filemode, filemask=modemask, onerror=onerror):
 							raise portage.exception.OperationNotPermitted(
 								"Failed to apply recursive permissions for the portage group.")
+
+			except portage.exception.DirectoryNotFound, e:
+				failure = True
+				writemsg("\n!!! Directory does not exist: '%s'\n" % \
+					(e,), noiselevel=-1)
+				writemsg("!!! Disabled FEATURES='%s'\n" % myfeature,
+					noiselevel=-1)
+
 			except portage.exception.PortageException, e:
-				mysettings.features.remove(myfeature)
-				mysettings["FEATURES"] = " ".join(mysettings.features)
-				writemsg("!!! %s\n" % str(e), noiselevel=-1)
+				failure = True
+				writemsg("\n!!! %s\n" % str(e), noiselevel=-1)
 				writemsg("!!! Failed resetting perms on %s='%s'\n" % \
 					(kwargs["basedir_var"], basedir), noiselevel=-1)
 				writemsg("!!! Disabled FEATURES='%s'\n" % myfeature,
 					noiselevel=-1)
+
+			if failure:
+				mysettings.features.remove(myfeature)
+				mysettings['FEATURES'] = ' '.join(sorted(mysettings.features))
 				time.sleep(5)
 
 def _prepare_workdir(mysettings):




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-03-27  4:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-27  4:32 [gentoo-commits] portage r13219 - in main/branches/2.1.6: bin pym/portage Zac Medico (zmedico)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox