예제 #1
0
파일: core.py 프로젝트: shilang/buildc
    def config_make(cmode,
                    force_update,
                    lib_root_path=None,
                    project_root_path=None):
        result = Cache.check_consistency()
        if result == False:
            return result

        return Makerules.config_make(cmode, force_update, lib_root_path,
                                     project_root_path)
예제 #2
0
파일: pack.py 프로젝트: shilang/buildc
    def __build_component_src(build_home, url, cmode, force_update):
        if not os.path.exists(build_home + os.sep + '.build'):
            Util.execute_and_output('mkdir -p ' + build_home + os.sep +
                                    '.build')
        os.chdir(build_home + os.sep + '.build')
        print "Create dir [.build] OK!"

        Util.execute_and_output('rm -rf ' + url[url.rindex("/") + 1:])
        SvnLocalOper.export(url, None, None, Glo.source_svn_user(),
                            Glo.source_svn_passwd(), False)
        print "Export [" + url + "] OK!"

        source_home = build_home + '/.build/' + url[url.rindex("/") + 1:]
        os.chdir(source_home)
        print "Cd " + source_home

        is_valid = Makerules.config_make(cmode, force_update,
                                         "$(shell cd ../.; pwd)/deps",
                                         "$(shell cd .; pwd)")
        if is_valid == False:
            os.chdir(build_home)
            print "Cd " + build_home
            return False

        print "Config Make.rules OK!"
        Util.execute_and_output('rm -f buildc.cfg')
        print "Remove buildc.cfg OK!"

        cmd_str =\
"""#! /bin/sh

topdir=`pwd`
parentdir=`cd ../.; pwd`
sed -e "1,$ s%=.*@topdir@%= $topdir#@topdir@%g" Make.rules |\
sed -e "1,$ s%\$(shell cd ../.; pwd)/deps%$parentdir/deps%g"\
> .Make.rules
mv .Make.rules Make.rules

echo "config Make.rules OK!"
"""
        f = open("configure", "w")
        f.write(cmd_str)
        f.close()
        Util.execute_and_output('chmod +x configure')
        print "Create configure OK!"

        os.chdir(build_home)
        print "Cd " + build_home

        print 'Build src [' + url + '] OK!'
        return True
예제 #3
0
파일: pack.py 프로젝트: bigwhite/buildc
    def __build_component_src(build_home, url, cmode, force_update):
        if not os.path.exists(build_home + os.sep + '.build'):
            Util.execute_and_output('mkdir -p ' + build_home + os.sep + '.build')
        os.chdir(build_home + os.sep + '.build')
        print "Create dir [.build] OK!"

        Util.execute_and_output('rm -rf ' + url[url.rindex("/")+1:])
        SvnLocalOper.export(url, None, None, Glo.source_svn_user(), Glo.source_svn_passwd(), False)
        print "Export [" + url + "] OK!"

        source_home = build_home + '/.build/' + url[url.rindex("/")+1:]
        os.chdir(source_home)
        print "Cd " + source_home

        is_valid = Makerules.config_make(cmode, force_update, "$(shell cd ../.; pwd)/deps", "$(shell cd .; pwd)")
        if is_valid == False:
            os.chdir(build_home)
            print "Cd " + build_home
            return False

        print "Config Make.rules OK!"
        Util.execute_and_output('rm -f buildc.cfg')
        print "Remove buildc.cfg OK!"

        cmd_str =\
"""#! /bin/sh

topdir=`pwd`
parentdir=`cd ../.; pwd`
sed -e "1,$ s%=.*@topdir@%= $topdir#@topdir@%g" Make.rules |\
sed -e "1,$ s%\$(shell cd ../.; pwd)/deps%$parentdir/deps%g"\
> .Make.rules
mv .Make.rules Make.rules

echo "config Make.rules OK!"
"""
        f = open("configure", "w")
        f.write(cmd_str)
        f.close()
        Util.execute_and_output('chmod +x configure')
        print "Create configure OK!"

        os.chdir(build_home)
        print "Cd " + build_home

        print 'Build src [' + url + '] OK!'
        return True
예제 #4
0
파일: pack.py 프로젝트: shilang/buildc
    def __build_source(build_home, url, cmode, force_update, binary_prefix,
                       pack_path):
        Util.execute_and_output('mkdir -p ' + build_home + os.sep + '.build')
        os.chdir(build_home + os.sep + '.build')
        print "Create dir [.build] OK!"

        SvnLocalOper.export(url, None, None, Glo.source_svn_user(),
                            Glo.source_svn_passwd(), False)
        print "Export [" + url + "] OK!"

        source_home = build_home + os.sep + '.build' + os.sep + url[
            url.rindex("/") + 1:]
        os.chdir(source_home)
        print "Cd " + source_home

        result = Makerules.config_make(cmode, force_update)
        if result == False:
            print "Config Make.rules Error!"
            os.chdir(build_home)
            print "Cd " + build_home
            return False

        print "Config Make.rules OK!"

        Pack.__make(cmode)
        print "Make OK!"

        if pack_path != "":
            des_path = build_home + os.sep + 'src' + os.sep + pack_path
            if not os.path.exists(des_path):
                os.mkdir(des_path)
            Util.execute_and_output('cp ' + binary_prefix + '* ' + des_path)
            print "Copy binary file to [" + build_home + os.sep + 'src' + os.sep + pack_path + ']' + " OK!"

        os.chdir(build_home)
        print "Cd " + build_home

        print 'Build source [' + url + '] OK!'
        return True
예제 #5
0
파일: pack.py 프로젝트: bigwhite/buildc
    def __build_source(build_home, url, cmode, force_update, binary_prefix, pack_path):
        Util.execute_and_output('mkdir -p ' + build_home + os.sep + '.build')
        os.chdir(build_home + os.sep + '.build')
        print "Create dir [.build] OK!"

        SvnLocalOper.export(url, None, None, Glo.source_svn_user(), Glo.source_svn_passwd(), False)
        print "Export [" + url + "] OK!"

        source_home = build_home + os.sep + '.build' + os.sep + url[url.rindex("/")+1:]
        os.chdir(source_home)
        print "Cd " + source_home

        result = Makerules.config_make(cmode, force_update)
        if result == False:
            print "Config Make.rules Error!"
            os.chdir(build_home)
            print "Cd " + build_home
            return False

        print "Config Make.rules OK!"

        Pack.__make(cmode)
        print "Make OK!"

        if pack_path != "":
            des_path = build_home + os.sep + 'src' + os.sep + pack_path
            if not os.path.exists(des_path):
                os.mkdir(des_path)
            Util.execute_and_output('cp ' + binary_prefix + '* ' + des_path)
            print "Copy binary file to [" + build_home + os.sep + 'src' + os.sep + pack_path + ']' + " OK!"

        os.chdir(build_home)
        print "Cd " + build_home

        print 'Build source [' + url + '] OK!'
        return True
예제 #6
0
파일: core.py 프로젝트: bigwhite/buildc
    def config_make(cmode, force_update, lib_root_path = None, project_root_path = None):
        result = Cache.check_consistency()
        if result == False:
            return result

        return Makerules.config_make(cmode, force_update, lib_root_path, project_root_path)