Don't discard root_config information when resolving SetArgs

SetArgs include which ROOT they are destined for, so use that information
when resolving the initial_arg_list rather than assuming the SetArg is
meant for the default ROOT.

This change means lakitu no longer fails with a collision between udev
and systemd when libcap is uprevved.

TEST=`emerge-lakitu -pgDu --with-bdeps=y --rebuild-if-new-rev target-os`

Change-Id: Ifded0753a3a6952f01b39f46b15cc734320b7f70
Tested-by: Chris McDonald <>
Reviewed-by: Mike Frysinger <>
Commit-Queue: Chris McDonald <>
diff --git a/lib/_emerge/ b/lib/_emerge/
index 6be1b3e..1058b5d 100644
--- a/lib/_emerge/
+++ b/lib/_emerge/
@@ -4324,6 +4324,10 @@
 		for arg in self._expand_set_args(args, add_to_digraph=True):
 			for atom in arg.pset.getAtoms():
+				if isinstance(arg, SetArg):
+					myroot = arg.root_config.root
+				else:
+					myroot = self._frozen_config.target_root
 				dep = Dependency(atom=atom, onlydeps=onlydeps,
 					root=myroot, parent=arg)