Index: pym/portage.py
===================================================================
--- pym/portage.py	(revision 4538)
+++ pym/portage.py	(revision 4933)
@@ -465,7 +465,7 @@
 	fns.sort()
 	templist = []
 	for x in fns:
-		if len(x) <= 3:
+		if len(x) < 3:
 			continue
 		if not x[0].isdigit() or not x[1].isdigit():
 			continue
@@ -509,7 +509,7 @@
 		mylist = []
 		for myconfig in config_list:
 			if var in myconfig:
-				mylist.extend(myconfig[var].split())
+				mylist.extend(filter(None, myconfig[var].split()))
 				del myconfig[var] # prepare for env.update(myconfig)
 		if mylist:
 			env[var] = " ".join(mylist)
@@ -519,7 +519,7 @@
 		mylist = []
 		for myconfig in config_list:
 			if var in myconfig:
-				mylist.extend(myconfig[var].split(":"))
+				mylist.extend(filter(None, myconfig[var].split(":")))
 				del myconfig[var] # prepare for env.update(myconfig)
 		if mylist:
 			env[var] = ":".join(mylist)
Index: pym/cache/util.py
===================================================================
--- pym/cache/util.py	(revision 4538)
+++ pym/cache/util.py	(revision 4933)
@@ -3,7 +3,10 @@
 # License: GPL2
 # $Id$
 
-import cache_errors
+if not hasattr(__builtins__, "set"):
+	from sets import Set as set
+from itertools import chain
+from cache import cache_errors
 
 def mirror_cache(valid_nodes_iterable, src_cache, trg_cache, eclass_cache=None, verbose_instance=None):
 
@@ -33,6 +36,7 @@
 			del e
 			continue
 		write_it = True
+		trg = None
 		try:
 			trg = trg_cache[x]
 			if long(trg["_mtime_"]) == long(entry["_mtime_"]) and eclass_cache.is_eclass_data_valid(trg["_eclasses_"]):
@@ -40,6 +44,19 @@
 		except (cache_errors.CacheError, KeyError):
 			pass
 
+		if trg and not write_it:
+			""" We don't want to skip the write unless we're really sure that
+			the existing cache is identical, so don't trust _mtime_ and
+			_eclasses_ alone."""
+			for d in (entry, trg):
+				if "EAPI" in d and d["EAPI"] in ("", "0"):
+					del d["EAPI"]
+			for k in set(chain(entry, trg)).difference(
+				("_mtime_", "_eclasses_")):
+				if trg.get(k, "") != entry.get(k, ""):
+					write_it = True
+					break
+
 		if write_it:
 			try:
 				inherited = entry.get("INHERITED", None)
Index: bin/ebuild.sh
===================================================================
--- bin/ebuild.sh	(revision 4538)
+++ bin/ebuild.sh	(revision 4933)
@@ -1493,8 +1493,8 @@
 #syntax from getting expanded :)
 #check eclass rdepends also.
 set -f
-if [ "${RDEPEND-unset}" == "unset" ] && [ "${E_RDEPEND-unset}" == "unset" ] ; then
-	export RDEPEND="${DEPEND} ${E_DEPEND}"
+if [ "${RDEPEND-unset}" == "unset" ] ; then
+	export RDEPEND=${DEPEND}
 	debug-print "RDEPEND: not set... Setting to: ${DEPEND}"
 fi