Changeset 4640 for trunk


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

workarounds for Mac svn checksum problem

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIdataGUI.py

    r4637 r4640  
    374374    else:
    375375        rev = "SVN version {}".format(rev)
    376     print ("This is GSAS-II revision {} ({})\n".format(
     376    print ("Latest GSAS-II revision (from .py files): {} ({})\n".format(
    377377        GSASIIpath.GetVersionNumber(),rev))
     378    # patch 11/2020: warn if GSASII path has not been updated past v4576.
     379    # For unknown reasons on Mac with gsas2full, there have been checksum
     380    # errors in the .so files that prevented svn from completing updates.
     381    # If GSASIIpath.svnChecksumPatch is not present, then the fix for that
     382    # has not been retrieved, so warn. Keep for a year or so.
     383    try:
     384        GSASIIpath.svnChecksumPatch
     385    except:
     386        print('Warning GSAS-II incompletely updated. Please contact toby@anl.gov')
     387    # end patch
    378388
    379389def warnNumpyVersion(application):
  • 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.