示例#1
0
    def exec_cmd(self, cmd, config):
        cmd = self.inject_env(cmd, config)
        dir = None

        if (config.build_cwd is not None):
            dir = self.inject_env(config.build_cwd, config)

        utils.execute(cmd, dir)
示例#2
0
文件: nodejs.py 项目: bergi9/J2V8
def store_diff(args):
    print "[store-diff]"

    patch_file = os.path.join("..", "node.patches", settings.NODE_VERSION + ".diff")
    print "Storing local changes to patch-file: " + patch_file

    utils.execute("git diff > " + patch_file, "node")
    print "Done"
示例#3
0
文件: nodejs.py 项目: aschrijver/J2V8
def store_diff():
    print "[store-diff]"

    patch_file = os.path.join("..", "node.patches",
                              settings.NODE_VERSION + ".diff")
    print "Storing local changes to patch-file: " + patch_file

    utils.execute("git diff > " + patch_file, "node")
    print "Done"
示例#4
0
文件: nodejs.py 项目: bergi9/J2V8
def apply_diff(args, silent = False):
    if not silent:
        print "[apply-diff]"

    patch_file = os.path.join("node.patches", settings.NODE_VERSION + ".diff")

    if (os.path.exists(patch_file)):
        print "Applying Node.js patch: " + patch_file
        utils.execute("git apply " + os.path.join("..", patch_file), "node")
    else:
        print "No special Node.js patch present for this version"

    if not silent:
        print "Done"
示例#5
0
文件: nodejs.py 项目: aschrijver/J2V8
def apply_diff(silent=False):
    if not silent:
        print "[apply-diff]"

    patch_file = os.path.join("node.patches", settings.NODE_VERSION + ".diff")

    if (os.path.exists(patch_file)):
        print "Applying Node.js patch: " + patch_file
        utils.execute("git apply " + os.path.join("..", patch_file), "node")
    else:
        print "No special Node.js patch present for this version"

    if not silent:
        print "Done"
示例#6
0
文件: nodejs.py 项目: bergi9/J2V8
def git_checkout(args):
    print "[git-checkout]"

    flush_cache(silent=True)

    if (os.path.exists("node")):
        print "Checkout Node.js version: " + settings.NODE_VERSION

        # TODO: is there a way to fetch/checkout only a single remote tag
        utils.execute("git fetch -v --progress --tags --depth 1 origin", "node")
        utils.execute("git checkout --progress tags/v" + settings.NODE_VERSION + " -b v" + settings.NODE_VERSION, "node")
    else:
        print "ERROR: Node.js source-code was not yet cloned into the './node' directory, run 'python nodejs.py git-clone' first."

    print "Done"
示例#7
0
文件: nodejs.py 项目: bergi9/J2V8
def git_clone(args):
    print "[git-clone]"

    # TODO: add CLI overide options
    # - Node version
    # - J2V8 version

    flush_cache(silent=True)

    if (not os.path.exists("node")):
        print "Cloning Node.js version: " + settings.NODE_VERSION
        # NOTE: autocrlf=false is very important for linux based cross-compiles of Node.js to work on a windows docker host
        utils.execute("git clone https://github.com/nodejs/node --config core.autocrlf=false --depth 1 --branch v" + settings.NODE_VERSION)
    else:
        print "Skipped git-clone: Node.js source-code is already cloned & checked out at the './node' directory."

    print "Done"
示例#8
0
def git_checkout(args):
    print "[git-checkout]"

    flush_cache(silent=True)

    if (os.path.exists("node")):
        print "Checkout Node.js version: " + settings.NODE_VERSION

        # TODO: is there a way to fetch/checkout only a single remote tag
        utils.execute("git fetch -v --progress --tags --depth 1 origin",
                      "node")
        utils.execute(
            "git checkout --progress tags/v" + settings.NODE_VERSION +
            " -b v" + settings.NODE_VERSION, "node")
    else:
        print "ERROR: Node.js source-code was not yet cloned into the './node' directory, run 'python nodejs.py git-clone' first."

    print "Done"
示例#9
0
def git_clone(args):
    print "[git-clone]"

    # TODO: add CLI overide options
    # - Node version
    # - J2V8 version

    flush_cache(silent=True)

    if (not os.path.exists("node")):
        print "Cloning Node.js version: " + settings.NODE_VERSION
        # NOTE: autocrlf=false is very important for linux based cross-compiles of Node.js to work on a windows docker host
        utils.execute(
            "git clone https://github.com/nodejs/node --config core.autocrlf=false --depth 1 --branch v"
            + settings.NODE_VERSION)
    else:
        print "Skipped git-clone: Node.js source-code is already cloned & checked out at the './node' directory."

    print "Done"
示例#10
0
文件: nodejs.py 项目: aschrijver/J2V8
def git_init():
    print "[git-init]"

    # TODO: add CLI overide options
    # - Node version
    # - J2V8 version

    utils.store_nodejs_output(None, ".")

    if (not os.path.exists("node")):
        print "Cloning Node.js version: " + settings.NODE_VERSION
        # NOTE: autocrlf=false is very important for linux based cross-compiles of Node.js to work on a windows docker host
        utils.execute(
            "git clone https://github.com/nodejs/node --config core.autocrlf=false --depth 1 --branch v"
            + settings.NODE_VERSION)
    else:
        print "Node.js is already cloned & checked out"
        apply_diff(True)

    print "Done"
示例#11
0
import os

import build_system.build_utils as utils

branch = utils.get_node_branch_version()

print "Determined branch version name: " + branch

branch_patch_file = os.path.join("..", "node.patches", branch + ".diff")

print "Storing local changes to patch-file: " + branch_patch_file

utils.execute("git diff > " + branch_patch_file, "node")

print "Done"
示例#12
0
import sys

import build_system.build_utils as utils
import build_settings as settings

# TODO: add CLI overide options
# - Node version
# - J2V8 version

utils.store_nodejs_output(None, ".")

if (not os.path.exists("node")):
    print "Cloning Node.js version: " + settings.NODE_VERSION
    # NOTE: autocrlf=false is very important for linux based cross-compiles of Node.js to work on a windows docker host
    utils.execute(
        "git clone https://github.com/nodejs/node --config core.autocrlf=false --depth 1 --branch v"
        + settings.NODE_VERSION)
else:
    print "Node.js is already cloned & checked out"
    branch = utils.get_node_branch_version()

    if (branch != settings.NODE_VERSION):
        sys.exit(
            "ERROR: The checked out Node.js version (" + branch +
            ") does not match the version specified in build_settings.py (" +
            settings.NODE_VERSION + ")")

branch_patch_file = os.path.join("node.patches",
                                 settings.NODE_VERSION + ".diff")

if (os.path.exists(branch_patch_file)):