#NEWLINE# def _write_spec_file( self , instance , rpm_name , template_name , params ) : #NEWLINE# #INDENT# requires_what = params . get ( 'requires' , [ ] ) #NEWLINE# conflicts_what = params . get ( 'conflicts' , [ ] ) #NEWLINE# test_requires_what = params . get ( 'test_requires' , [ ] ) #NEWLINE# test_conflicts_what = params . get ( 'test_conflicts' , [ ] ) #NEWLINE# egg_info = getattr ( instance , 'egg_info' , None ) #NEWLINE# if egg_info : #NEWLINE# #INDENT# def ei_names( key ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# requires_python = [ str ( req ) for req in egg_info [ key ] ] #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# return ( [ ] , [ ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return self . py2rpm_helper . names_to_rpm_deps ( requires_python ) #NEWLINE# #UNINDENT# #UNINDENT# ( rpm_requires , rpm_conflicts ) = ei_names ( 'dependencies' ) #NEWLINE# requires_what . extend ( rpm_requires ) #NEWLINE# conflicts_what . extend ( rpm_conflicts ) #NEWLINE# ( rpm_test_requires , rpm_test_conflicts ) = ei_names ( 'test_dependencies' ) #NEWLINE# test_requires_what . extend ( rpm_test_requires ) #NEWLINE# test_conflicts_what . extend ( rpm_test_conflicts ) #NEWLINE# #UNINDENT# params [ 'requires' ] = requires_what #NEWLINE# params [ 'conflicts' ] = conflicts_what #NEWLINE# params [ 'test_requires' ] = test_requires_what #NEWLINE# params [ 'test_conflicts' ] = test_conflicts_what #NEWLINE# params [ 'epoch' ] = self . OPENSTACK_EPOCH #NEWLINE# params [ 'part_fn' ] = ( lambda filename : sh . joinpths ( settings . TEMPLATE_DIR , self . SPEC_TEMPLATE_DIR , filename ) ) #NEWLINE# parsed_version = pkg_resources . parse_version ( params [ 'version' ] ) #NEWLINE# params . update ( self . _make_spec_functors ( parsed_version ) ) #NEWLINE# content = utils . load_template ( self . SPEC_TEMPLATE_DIR , template_name ) [ 1 ] #NEWLINE# spec_filename = sh . joinpths ( self . rpmbuild_dir , 'SPECS' , ( '%s.spec' % rpm_name ) ) #NEWLINE# sh . write_file ( spec_filename , utils . expand_template ( content , params ) , tracewriter = self . tracewriter ) #NEWLINE# return spec_filename