Allow relative paths (starting with ./) on the cmd line
authorSebastian Luther <SebastianLuther@gmx.de>
Mon, 31 Jan 2011 17:40:08 +0000 (18:40 +0100)
committerZac Medico <zmedico@gentoo.org>
Wed, 2 Feb 2011 23:24:39 +0000 (15:24 -0800)
bug 352208

pym/_emerge/depgraph.py

index 2b9ce50518a0ef3198a9d7158226cee732cd3d66..37615a1eedf4d36bf5983d1ff404b67cf9dbb1bc 100644 (file)
@@ -1650,6 +1650,13 @@ class depgraph(object):
                                # Queue these up since it's most efficient to handle
                                # multiple files in a single iter_owners() call.
                                lookup_owners.append(x)
+                       elif x.startswith("." + os.path.sep):
+                               f = os.path.abspath(x)
+                               if not f.startswith(myroot):
+                                       portage.writemsg(("\n\n!!! '%s' (resolved from '%s') does not start with" + \
+                                               " $ROOT.\n") % (f, x), noiselevel=-1)
+                                       return 0, []
+                               lookup_owners.append(f)
                        else:
                                if x in ("system", "world"):
                                        x = SETPREFIX + x