def move_configure_log(framework):
    """Move configure.log to PETSC_ARCH/lib/petsc/conf - and update configure.log.bkp in both locations appropriately"""
    global petsc_arch
    if hasattr(framework, 'arch'):
        petsc_arch = framework.arch
    if hasattr(framework, 'logName'):
        curr_file = framework.logName
    else:
        curr_file = 'configure.log'
    if petsc_arch:
        import shutil
        import os
        lib_dir = os.path.join(petsc_arch, 'lib')
        petsc_dir = os.path.join(petsc_arch, 'lib', 'petsc')
        conf_dir = os.path.join(petsc_arch, 'lib', 'petsc', 'conf')
        if not os.path.isdir(petsc_arch):
            os.mkdir(petsc_arch)
        if not os.path.isdir(lib_dir):
            os.mkdir(lib_dir)
        if not os.path.isdir(petsc_dir):
            os.mkdir(petsc_dir)
        if not os.path.isdir(conf_dir):
            os.mkdir(conf_dir)
        curr_bkp = curr_file + '.bkp'
        new_file = os.path.join(conf_dir, curr_file)
        new_bkp = new_file + '.bkp'
        if os.path.isfile(new_bkp):
            os.remove(new_bkp)
        if os.path.isfile(new_file):
            os.rename(new_file, new_bkp)
        if os.path.isfile(curr_file):
            shutil.copyfile(curr_file, new_file)
            os.remove(curr_file)
        if os.path.isfile(new_file):
            os.symlink(new_file, curr_file)
        if os.path.realpath(curr_bkp) == os.path.realpath(new_file):
            if os.path.isfile(curr_bkp):
                os.remove(curr_bkp)
            if os.path.isfile(new_bkp):
                os.symlink(new_bkp, curr_bkp)
    return
