Raise a ParseError if the profile has a parent file containing anything other than...
authorZac Medico <zmedico@gentoo.org>
Sun, 4 Jun 2006 03:29:01 +0000 (03:29 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 4 Jun 2006 03:29:01 +0000 (03:29 -0000)
svn path=/main/trunk/; revision=3454

pym/portage.py

index 20ce4224aed56b8f71efedb88c3f80643ad077c7..da3394b09f18e8bbc720d31ad2f7ff4da8dc3e4a 100644 (file)
@@ -1025,8 +1025,14 @@ class config:
                                self.profiles = [os.path.realpath(self.profile_path)]
                                mypath = self.profiles[0]
                                while os.path.exists(os.path.join(mypath, "parent")):
+                                       parents_file = os.path.join(mypath, "parent")
+                                       parents = grabfile(parents_file)
+                                       if len(parents) != 1:
+                                               raise portage_exception.ParseError(
+                                                       "Expected 1 parent and got %i: '%s'" % \
+                                                       (len(parents), parents_file))
                                        mypath = os.path.normpath(os.path.join(
-                                               mypath, grabfile(os.path.join(mypath, "parent"))[0]))
+                                               mypath, parents[0]))
                                        if os.path.exists(mypath):
                                                self.profiles.insert(0, mypath)