コード例 #1
0
ファイル: cmt.py プロジェクト: brettviren/garpi
def build():
    'Build CMT in previously unpacked cmt.srcdir().'
    log.info('building cmt')

    fs.goto(os.path.join(srcdir(),'mgr/'))

    from command import cmd,make,source

    def stupid_hack():
        # quick hack for v1r22.  this really doesn't belong here!
        fp = open("../source/cmt_std.h")
        for line in fp:
            if 'climits' in line: return
            continue
        fp.close()
        fp = open("../source/cmt_std.h","a")
        fp.write("#include <climits>\n")
        fp.close()
        return
    stupid_hack()

    # always run this in case user does something silly like move the
    # installation somewhere else 
    cmd('./INSTALL')

    environ = env()
    cmtexe = '%s/%s/cmt'%(srcdir(),environ['CMTCONFIG'])
    if os.path.exists(cmtexe):
        log.info('CMT appears to already have been built: %s'%cmtexe)
    else:
        log.info('CMT rebuild, not found at: %s'%cmtexe)
        make(env=environ)
    return cmtexe
コード例 #2
0
ファイル: git.py プロジェクト: brettviren/garpi
def build():
    "Build git in previously unpacked git.srcdir()."
    log.info("building git")

    fs.goto(srcdir())

    from command import cmd, make

    instpath = prefix()

    if not os.path.exists("config.status"):
        log.info("configuring git")
        cmd("./configure --prefix=%s" % instpath)

    if os.path.exists("git"):
        log.info("git appears to already have been built")
    else:
        make()

    if os.path.exists(instpath):
        log.info("git appears to already have been installed to %s" % instpath)
    else:
        make("install")
    return