Tests: resolver/ResolverPlayground: Create a proper profile
authorSebastian Luther <SebastianLuther@gmx.de>
Mon, 9 Aug 2010 10:05:54 +0000 (12:05 +0200)
committerZac Medico <zmedico@gentoo.org>
Thu, 12 Aug 2010 08:17:25 +0000 (01:17 -0700)
pym/portage/tests/resolver/ResolverPlayground.py

index f77216b568793479ff3217fb60e1b81f1f1fdc56..d1ec55b82c1ca14502be14ad34c7dd7eaf8c37dc 100644 (file)
@@ -152,13 +152,36 @@ class ResolverPlayground(object):
                        f.write(cat + "\n")
                f.close()
                
-               #Create $PORTDIR/eclass (we fail to digest the ebuilds if it's not there)
+               #Create $profile_dir/eclass (we fail to digest the ebuilds if it's not there)
                os.makedirs(os.path.join(self.portdir, "eclass"))
+
+               sub_profile_dir = os.path.join(profile_dir, "default", "linux", "x86", "test_profile")
+               os.makedirs(sub_profile_dir)
+               
+               eapi_file = os.path.join(sub_profile_dir, "eapi")
+               f = open(eapi_file, "w")
+               f.write("0\n")
+               f.close()
+               
+               make_defaults_file = os.path.join(sub_profile_dir, "make.defaults")
+               f = open(make_defaults_file, "w")
+               f.write("ARCH=\"x86\"\n")
+               f.write("ACCEPT_KEYWORDS=\"x86\"\n")
+               f.close()
                
+               use_force_file = os.path.join(sub_profile_dir, "use.force")
+               f = open(use_force_file, "w")
+               f.write("x86\n")
+               f.close()
+
                if profile:
                        #This is meant to allow the consumer to set up his own profile,
                        #with package.mask and what not.
                        raise NotImplentedError()
+               
+               #Create profile symlink
+               os.makedirs(os.path.join(self.root, "etc"))
+               os.symlink(sub_profile_dir, os.path.join(self.root, "etc", "make.profile"))
 
        def _load_config(self):
                env = {