#NEWLINE# @ _ensure_index_lock #NEWLINE# @ accepts ( Self ( ) , basestring , basestring , int , bool ) #NEWLINE# def update_distribution( self , distribution_name , bundle_name , bundle_version , save_previous = True ) : #NEWLINE# #INDENT# if save_previous : #NEWLINE# #INDENT# cur_version = self . index . version_for_bundle ( bundle_name , distribution_name ) #NEWLINE# if ( ( cur_version is not None ) and ( cur_version != bundle_version ) ) : #NEWLINE# #INDENT# prev_distro = helpers . distro_previous_name ( distribution_name ) #NEWLINE# self . index . update_distribution ( prev_distro , bundle_name , cur_version ) #NEWLINE# #UNINDENT# #UNINDENT# self . index . update_distribution ( distribution_name , bundle_name , bundle_version )