Changeset 4640 for trunk/GSASIIpath.py


Ignore:
Timestamp:
Nov 2, 2020 9:42:45 PM (3 years ago)
Author:
toby
Message:

workarounds for Mac svn checksum problem

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpath.py

    r4515 r4640  
    11# -*- coding: utf-8 -*-
     2#GSASIIpath - file location & update routines
     3########### SVN repository information ###################
     4# $Date$
     5# $Author$
     6# $Revision$
     7# $URL$
     8# $Id$
     9########### SVN repository information ###################
    210'''
    311*GSASIIpath: locations & updates*
     
    474482            else:
    475483                return
     484        if 'Checksum' in err:  # deal with Checksum problem
     485            err = svnChecksumPatch(svn,fpath,verstr)
     486            if err:
     487                print('error from svnChecksumPatch\n\t',err)
     488            else:
     489                return
    476490        raise Exception('svn update failed')
    477491    elif verbose:
    478492        print(out)
    479493
     494def svnChecksumPatch(svn,fpath,verstr):
     495    '''This performs a fix when svn cannot finish an update because of
     496    a Checksum mismatch error. This seems to be happening on OS X for
     497    unclear reasons.
     498    '''
     499    print('\nAttempting patch for svn Checksum mismatch error\n')
     500    svnCleanup(fpath)
     501    cmd = ['svn','update','--set-depth','empty',
     502               os.path.join(fpath,'bindist')]
     503    s = subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
     504    out,err = MakeByte2str(s.communicate())
     505    #if err: print('error=',err)
     506    DownloadG2Binaries(g2home,verbose=True)
     507    cmd = ['svn','update','--set-depth','infinity',
     508               os.path.join(fpath,'bindist')]
     509    s = subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
     510    out,err = MakeByte2str(s.communicate())
     511    #if err: print('error=',err)
     512    cmd = [svn,'update',fpath,verstr,
     513                       '--non-interactive',
     514                       '--accept','theirs-conflict','--force']
     515    if svnVersionNumber() >= 1.6:
     516        cmd += ['--trust-server-cert']
     517    if proxycmds: cmd += proxycmds
     518    #print(cmd)
     519    s = subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
     520    out,err = MakeByte2str(s.communicate())
     521    #if err: print('error=',err)
     522    return err
     523       
    480524def svnUpgrade(fpath=os.path.split(__file__)[0]):
    481525    '''This reformats subversion files, which may be needed if an upgrade of subversion is
Note: See TracChangeset for help on using the changeset viewer.