From 4f9aed1255e6e766ff1c53ea64965a3a66467376 Mon Sep 17 00:00:00 2001 From: =?utf8?q?K=C3=A9vin=20THIERRY?= Date: Tue, 8 Jul 2014 17:11:48 +0200 Subject: [PATCH] Factorize some code MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: Ie94f919ccddd4520b05b22ab88902f79b447174f Signed-off-by: Kévin THIERRY --- tools/spec2yocto.py | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/tools/spec2yocto.py b/tools/spec2yocto.py index 97b3d2b..f8330ae 100755 --- a/tools/spec2yocto.py +++ b/tools/spec2yocto.py @@ -273,23 +273,11 @@ class Spec2yoctoConfig( object ): ''' return self.__get_list( 'depends', 'inherit_gettext', [] ) - def get_inherit_perl( self ): - ''' - some buildRequire mean inherit_perl package not depends runtime. - ''' - return ["perl"] - - def get_inherit_python( self ): - ''' - some buildRequire mean inherit_perl package not depends runtime. - ''' - return ["python"] - - def get_inherit_tizen_cmake( self ): + def get_inherit(self, package): ''' some buildRequire mean inherit_cmake package not depends runtime. ''' - return ["cmake"] + return [package] def get_group_uri( self, project ): @@ -1934,9 +1922,9 @@ class MetaSpec: if res is None: if pp_provide not in SPEC2YOCTO_CONFIG.get_inherit_gettext() and \ - pp_provide not in SPEC2YOCTO_CONFIG.get_inherit_python() and \ - pp_provide not in SPEC2YOCTO_CONFIG.get_inherit_tizen_cmake() and \ - pp_provide not in SPEC2YOCTO_CONFIG.get_inherit_perl() and \ + pp_provide not in SPEC2YOCTO_CONFIG.get_inherit("python") and \ + pp_provide not in SPEC2YOCTO_CONFIG.get_inherit("cmake") and \ + pp_provide not in SPEC2YOCTO_CONFIG.get_inherit("perl") and \ pp_provide not in ignore_depend_list and \ pp_provide not in native_depend_list and \ pp_provide not in cross_depend_list: @@ -1969,9 +1957,9 @@ class MetaSpec: pass elif pkg_yocto_name in SPEC2YOCTO_CONFIG.get_libtool_cross(): file_d.write( "DEPENDS += \"libtool-cross\"\n" ) - elif pkg_yocto_name in SPEC2YOCTO_CONFIG.get_inherit_perl(): + elif pkg_yocto_name in SPEC2YOCTO_CONFIG.get_inherit("perl"): file_d.write( "inherit perlnative\n" ) - elif pkg_yocto_name in SPEC2YOCTO_CONFIG.get_inherit_python(): + elif pkg_yocto_name in SPEC2YOCTO_CONFIG.get_inherit("python"): file_d.write( "inherit pythonnative\n" ) else: file_d.write( "DEPENDS += \"%s\"\n" % pkg_yocto_name ) -- 2.7.4