#NEWLINE# def resolveEraseByUpdating( self , trvSrc , cannotResolve , uJob , jobSet , ineligible , check ) : #NEWLINE# #INDENT# '\n            Attempt to resolve broken erase dependencies by updating the\n            package that has the dependency on the trove that is being\n            erased.\n            @param ineligible: Ineligible troves are troves that were\n            involved in resolveEraseByUpdating before.\n        ' #NEWLINE# oldIdx = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# newIdx = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for job in jobSet : #NEWLINE# #INDENT# if ( job [ 1 ] [ 0 ] is not None ) : #NEWLINE# #INDENT# oldIdx [ ( job [ 0 ] , job [ 1 ] [ 0 ] , job [ 1 ] [ 1 ] ) ] = job #NEWLINE# #UNINDENT# if ( job [ 2 ] [ 0 ] is not None ) : #NEWLINE# #INDENT# newIdx [ ( job [ 0 ] , job [ 2 ] [ 0 ] , job [ 2 ] [ 1 ] ) ] = job #NEWLINE# #UNINDENT# #UNINDENT# potentialUpdateList = [ ] #NEWLINE# for resolveInfo in cannotResolve : #NEWLINE# #INDENT# ( reqInfo , depSet , provInfoList ) = resolveInfo #NEWLINE# if ( reqInfo in newIdx ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# found = False #NEWLINE# for provInfo in provInfoList : #NEWLINE# #INDENT# if ( provInfo in ineligible ) : #NEWLINE# #INDENT# found = True #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# if found : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# for provInfo in provInfoList : #NEWLINE# #INDENT# if ( provInfo not in oldIdx ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# job = oldIdx [ provInfo ] #NEWLINE# if ( not job [ 2 ] [ 0 ] ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# ineligible . add ( reqInfo ) #NEWLINE# potentialUpdateList . append ( ( reqInfo , depSet , provInfoList ) ) #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# if ( not potentialUpdateList ) : #NEWLINE# #INDENT# return ( cannotResolve , set ( ) ) #NEWLINE# #UNINDENT# log . debug ( 'Attempting to update the following packages in order to remove their dependency on something being erased:\n   %s' , '\n   ' . join ( sorted ( ( x [ 0 ] [ 0 ] . split ( ':' ) [ 0 ] for x in potentialUpdateList ) ) ) ) #NEWLINE# updateJobs = [ ( x [ 0 ] [ 0 ] . split ( ':' ) [ 0 ] , ( None , None ) , ( None , None ) , True ) for x in potentialUpdateList ] #NEWLINE# try : #NEWLINE# #INDENT# newJob = self . client . newUpdateJob ( closeDatabase = False ) #NEWLINE# self . client . prepareUpdateJob ( newJob , updateJobs , keepExisting = False , resolveDeps = False , split = False ) #NEWLINE# newJobSet = newJob . getJobs ( ) #NEWLINE# jobs = ( ( x for x in jobSet if ( ( x [ 0 ] , x [ 2 ] [ 0 ] , x [ 2 ] [ 1 ] ) not in newIdx ) ) for jobSet in newJobSet ) #NEWLINE# newJobSet = set ( itertools . chain ( * newJob ) ) #NEWLINE# uJob . getTroveSource ( ) . merge ( newJob . getTroveSource ( ) ) #NEWLINE# check . setTroveSource ( uJob . getTroveSource ( ) ) #NEWLINE# newResult = check . depCheck ( ( jobSet | newJobSet ) , criticalJobs = [ ] ) #NEWLINE# check . done ( ) #NEWLINE# if ( cannotResolve != newResult . unresolveableList ) : #NEWLINE# #INDENT# cannotResolve = newResult . unresolveableList #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# newJobSet = set ( ) #NEWLINE# #UNINDENT# #UNINDENT# except ( errors . ClientError , errors . TroveNotFound ) : #NEWLINE# #INDENT# newJobSet = set ( ) #NEWLINE# #UNINDENT# if newJobSet : #NEWLINE# #INDENT# log . debug ( 'updated %s troves:\n   %s' , len ( newJobSet ) , '\n   ' . join ( sorted ( ( ( '%s=%s/%s[%s]' % ( x [ 0 ] , x [ 2 ] [ 0 ] . branch ( ) . label ( ) , x [ 2 ] [ 0 ] . trailingRevision ( ) , x [ 2 ] [ 1 ] ) ) for x in newJobSet if x [ 2 ] [ 0 ] ) ) ) ) #NEWLINE# #UNINDENT# return ( cannotResolve , newJobSet )