#NEWLINE# def resolveEraseByKeeping( self , trvSrc , cannotResolve , uJob , jobSet ) : #NEWLINE# #INDENT# oldIdx = { #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# #UNINDENT# restoreSet = set ( ) #NEWLINE# keepList = [ ] #NEWLINE# for resolveInfo in cannotResolve [ : ] : #NEWLINE# #INDENT# ( reqInfo , depSet , provInfoList ) = resolveInfo #NEWLINE# for provInfo in provInfoList : #NEWLINE# #INDENT# if ( provInfo not in oldIdx ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# job = oldIdx [ provInfo ] #NEWLINE# if ( job in restoreSet ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# if ( ( job [ 0 ] , job [ 1 ] , ( None , None ) , False ) in uJob . getPrimaryJobs ( ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( job [ 2 ] [ 0 ] is None ) : #NEWLINE# #INDENT# keepList . append ( ( job , depSet , reqInfo ) ) #NEWLINE# cannotResolve . remove ( resolveInfo ) #NEWLINE# restoreSet . add ( job ) #NEWLINE# depSet = '\n               ' . join ( str ( depSet ) . split ( '\n' ) ) #NEWLINE# msg = 'Resolved (undoing erasure)\n    %s=%s[%s]    Required: %s    Keeping: %s=%s[%s]' #NEWLINE# args = ( reqInfo [ 0 ] , reqInfo [ 1 ] . trailingRevision ( ) , reqInfo [ 2 ] , depSet , job [ 0 ] , job [ 1 ] [ 0 ] . trailingRevision ( ) , job [ 1 ] [ 1 ] ) #NEWLINE# log . debug ( msg , * args ) #NEWLINE# break #NEWLINE# #UNINDENT# oldTrv = self . db . getTrove ( * provInfo , withFiles = False , pristine = False ) #NEWLINE# newTrv = trvSrc . getTrove ( job [ 0 ] , job [ 2 ] [ 0 ] , job [ 2 ] [ 1 ] , withFiles = False ) #NEWLINE# if oldTrv . compatibleWith ( newTrv ) : #NEWLINE# #INDENT# restoreSet . add ( job ) #NEWLINE# keepList . append ( ( job , depSet , reqInfo ) ) #NEWLINE# cannotResolve . remove ( resolveInfo ) #NEWLINE# msg = 'Resolved (installing side-by-side)\n    %s=%s[%s]    Required: %s    Keeping: %s=%s[%s]' #NEWLINE# args = ( reqInfo [ 0 ] , reqInfo [ 1 ] . trailingRevision ( ) , reqInfo [ 2 ] , depSet , job [ 0 ] , job [ 1 ] [ 0 ] . trailingRevision ( ) , job [ 1 ] [ 1 ] ) #NEWLINE# log . debug ( msg , * args ) #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if self . cfg . autoResolvePackages : #NEWLINE# #INDENT# jobsByOld = dict ( ( ( ( x [ 0 ] , x [ 1 ] ) , x ) for x in jobSet if ( ':' not in x [ 0 ] ) ) ) #NEWLINE# for job in list ( restoreSet ) : #NEWLINE# #INDENT# if ( ':' in job [ 0 ] ) : #NEWLINE# #INDENT# pkgJob = jobsByOld . get ( ( job [ 0 ] . split ( ':' ) [ 0 ] , job [ 1 ] ) , None ) #NEWLINE# if pkgJob : #NEWLINE# #INDENT# restoreSet . add ( pkgJob ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# for job in restoreSet : #NEWLINE# #INDENT# jobSet . remove ( job ) #NEWLINE# if ( job [ 2 ] [ 0 ] is not None ) : #NEWLINE# #INDENT# jobSet . add ( ( job [ 0 ] , ( None , None ) , job [ 2 ] , False ) ) #NEWLINE# #UNINDENT# #UNINDENT# return ( cannotResolve , keepList )