spec2yocto: use env variable to find files 39/34539/1
authorPatrick Ohly <patrick.ohly@intel.com>
Tue, 27 Jan 2015 21:07:06 +0000 (13:07 -0800)
committerPatrick Ohly <patrick.ohly@intel.com>
Wed, 28 Jan 2015 16:58:48 +0000 (08:58 -0800)
gitCloneAll.sh changes the directory before calling spec2yocto,
so we have to use absolute paths for the auxiliary files. For that
we need to add support for env variable substitution in all
usages of the "uri" properties.

Change-Id: I9f14bfed67e44d01205fac7478871d7fba2ac063

proto-meta-Tizen_generic/spec2yoctorc
tools/spec2yocto.py

index 2c60cf2..6028d1c 100644 (file)
@@ -29,12 +29,12 @@ priority=1
 buildtarget=atom
 
 [tizen_common_fix]
-uri=proto-meta-Tizen_generic/manifest_fix.xml
+uri=${YOCTO_WORKDIR}/tizen/proto-meta-Tizen_generic/manifest_fix.xml
 default_git_src=review.tizen.org
 priority=2
 
 [whitelist_tizen_common]
-uri=proto-meta-Tizen_generic/recipes_path.txt
+uri=${YOCTO_WORKDIR}/tizen/proto-meta-Tizen_generic/recipes_path.txt
 
 [substitute]
 pkgconfig(zlib)=zlib-devel
index c52927e..90ff2b0 100755 (executable)
@@ -181,7 +181,7 @@ class Spec2yoctoConfig( object ):
         packages_dico={}
         whitelist_list=self.__get_list(project,"whitelist", None)
         for whitelist_v in whitelist_list:
-            whitelist_uri = self.__get_value(whitelist_v,"uri", None )            
+            whitelist_uri = os.path.expanduser(os.path.expandvars(self.__get_value(whitelist_v,"uri", None )))
             
             if whitelist_uri.startswith( "http" ):
                 whitelist_file=download_url( whitelist_uri )
@@ -2437,13 +2437,15 @@ class manifestCollection:
                 with open( meta_manifest_path, "w" ) as manifest_xml_file:
                     manifest_xml_file.write( manifest_xml )
             else:
-                if not os.path.isfile( meta_manifest_uri ):
+                filename = os.path.expanduser(os.path.expandvars(meta_manifest_uri))
+
+                if not os.path.isfile( filename ):
                     msg = "In the project \"%s\" the manifest \"%s\" is not a valid file."
                     msg = msg % ( self.__my_project, meta_manifest_uri )
                     print >> sys.stderr, colorize( msg, "red" )
                     sys.exit( 1 )
                 else:
-                    meta_manifest_path = meta_manifest_uri
+                    meta_manifest_path = filename
 
             self.__my_manifest_file_list[ meta_manifest ] = meta_manifest_path