Ticket #14245: trac_14245_clone.patch

File trac_14245_clone.patch, 2.0 KB (added by jhpalmieri, 6 years ago)

scripts repo

  • sage-clone

    # HG changeset patch
    # User J. H. Palmieri <palmieri@math.washington.edu>
    # Date 1362762259 28800
    # Node ID 1bc2fd4d43a91fb91ee86787e38cea0ca1f91333
    # Parent  a6c0f535831699cc3df03be662b8f9bcfe126c94
    Fix cloning: make sure doc output is copied completely, including symlinks.
    
    diff --git a/sage-clone b/sage-clone
    a b  
    7272sys.path.append(os.environ['SAGE_DOC'])
    7373from common.builder import LANGUAGES
    7474for lang in LANGUAGES:
     75    ref = os.path.join('sage', 'doc', lang, 'reference')
    7576    try:
    76         for directory in ['sage', 'sagenb']:
    77             fr = os.path.join('sage', 'doc', lang, 'reference', directory)
    78             if os.path.exists(fr):
    79                 to = os.path.join(branch, 'doc', lang, 'reference', directory)
    80                 cmd = 'cp -pR %s %s' % (fr, to)
    81 #                print cmd
    82                 subprocess.call([cmd], shell=True)
    83 #        shutil.copytree(os.path.join('sage/doc', lang, 'reference/sage'),
    84 #                        os.path.join(branch, 'doc', lang, 'reference/sage'))
     77        for f in os.listdir(ref):
     78            if os.path.isdir(os.path.join(ref, f)):
     79                for directory in ['sage', 'sagenb']:
     80                    fr = os.path.join(ref, f, directory)
     81                    if os.path.exists(fr):
     82                        to = os.path.join(branch, 'doc', lang, 'reference', f, directory)
     83                        cmd = 'cp -pR %s %s' % (fr, to)
     84                        subprocess.call([cmd], shell=True)
    8585    except:
    8686        pass
    8787
    8888print "Copying over documentation output..."
    89 copy_dtree('sage/doc/output', branch + '/doc/output')
     89# Use shutil.copytree instead of copy_dtree to make sure that symlinks
     90# are copied correctly. See #14245.
     91shutil.copytree('sage/doc/output', branch + '/doc/output', symlinks=True)
    9092
    9193print "Building " + branch + "..."
    9294cmd = 'sage -b %s'%sys.argv[1]
     
    101103[diff]
    102104git = true
    103105""")
    104 HGRC.close()         
     106HGRC.close()
    105107
    106108try:
    107109    index = open(os.path.join(SAGE_ROOT, "devel/sage/doc/output/html/en/reference/index.html"))