diff options
author | kennyballou <kballou@onyx.boisestate.edu> | 2013-06-21 17:15:24 -0600 |
---|---|---|
committer | kennyballou <kballou@onyx.boisestate.edu> | 2013-06-21 17:15:24 -0600 |
commit | 9b91725fa3c986f92ef85d00ae591a5d9e95915a (patch) | |
tree | 4b7af2d45a7f0965ce11dc7f9c00fe4d60bd04f4 /xnt | |
parent | f10e7e3b1588fc3b2d29cfb3a6e9ff0afb0b685c (diff) | |
download | xnt-9b91725fa3c986f92ef85d00ae591a5d9e95915a.tar.gz xnt-9b91725fa3c986f92ef85d00ae591a5d9e95915a.tar.xz |
Add PATH assertions for 'dependent' programs
Diffstat (limited to 'xnt')
-rw-r--r-- | xnt/build/cc.py | 5 | ||||
-rw-r--r-- | xnt/build/make.py | 4 | ||||
-rw-r--r-- | xnt/vcs/cvs.py | 3 | ||||
-rw-r--r-- | xnt/vcs/git.py | 2 | ||||
-rw-r--r-- | xnt/vcs/hg.py | 2 |
5 files changed, 16 insertions, 0 deletions
diff --git a/xnt/build/cc.py b/xnt/build/cc.py index 967608f..d993653 100644 --- a/xnt/build/cc.py +++ b/xnt/build/cc.py @@ -32,6 +32,7 @@ def gcc(src, flags=None): :param src: C source file to compile with default `gcc` :param flags: List of flags to pass onto the compiler """ + assert which("gcc") return _gcc(src, flags) def gpp(src, flags=None): @@ -40,6 +41,7 @@ def gpp(src, flags=None): :param src: C++ source file to compile with default `g++` :param flags: List of flags to pass onto the compiler """ + assert which("g++") return _gcc(src, flags, "g++") def gcc_o(src, output, flags=None): @@ -49,6 +51,7 @@ def gcc_o(src, output, flags=None): :param output: Name of resulting object or executable :param flags: List of flags to pass onto the compiler """ + assert which("gcc") return _gcc_o(src, output, flags) def gpp_o(src, output, flags=None): @@ -58,6 +61,7 @@ def gpp_o(src, output, flags=None): :param output: Name of resulting object or executable :param flags: List of flags to pass onto the compiler """ + assert which("g++") return _gcc_o(src, output, flags, "g++") def javac(src, flags=None): @@ -66,6 +70,7 @@ def javac(src, flags=None): :param src: Java source file to compile with default `javac` :param flags: List of flags to pass onto the compiler """ + assert which("javac") LOGGER.info("Compiling %s", src) cmd = __generate_command(src, flags, "javac") return __compile(cmd) diff --git a/xnt/build/make.py b/xnt/build/make.py index df4fb85..28c17b0 100644 --- a/xnt/build/make.py +++ b/xnt/build/make.py @@ -19,6 +19,7 @@ import os import subprocess +from xnt.tasks import which def ant(target, path="", flags=None, pkeys=None, pvalues=None): """Wrapper around Apache Ant @@ -32,6 +33,7 @@ def ant(target, path="", flags=None, pkeys=None, pvalues=None): :param pkeys: List of keys to combine with pvalues to pass to Ant :param pvalues: List of values to combine with pkeys to pass to Ant """ + assert which("ant") cmd = __add_params(["ant"], __build_param_list(pkeys, pvalues), lambda x: "-D%s" % x) @@ -51,6 +53,7 @@ def make(target, path="", flags=None, pkeys=None, pvalues=None): :param pkeys: List of keys, zipped with pvalues, to pass to Make :param pvalues: List of values, zipped with pkeys, to pass to Make """ + assert which("make") cmd = __add_params(["make"], __build_param_list(pkeys, pvalues)) cmd = __add_flags(cmd, flags) cmd.append(target) @@ -68,6 +71,7 @@ def nant(target, path="", flags=None, pkeys=None, pvalues=None): :param pkeys: List of keys, zipped with pvalues, to pass to NAnt :param pvalues: List of values, zipped with pkeys, to pass to NAnt """ + assert which("nant") cmd = __add_params(["nant"], __build_param_list(pkeys, pvalues), lambda x: "-D:%s" % x) diff --git a/xnt/vcs/cvs.py b/xnt/vcs/cvs.py index fa596c8..ccdabcd 100644 --- a/xnt/vcs/cvs.py +++ b/xnt/vcs/cvs.py @@ -19,6 +19,7 @@ import os import subprocess +from xnt.tasks import which def cvsco(module, rev="", dest=""): """Run CVS Checkout @@ -27,6 +28,7 @@ def cvsco(module, rev="", dest=""): :param rev: Revision to checkout :param dest: Destination directory or name of checked out module """ + assert which("cvs") cmd = ["cvs", "co", "-P"] if rev: cmd.append("-r") @@ -42,6 +44,7 @@ def cvsupdate(path): :param path: Directory path to module to update """ + assert which("cvs") cwd = os.path.abspath(os.getcwd()) os.chdir(path) cmd = ["cvs", "update"] diff --git a/xnt/vcs/git.py b/xnt/vcs/git.py index 00e2828..222ebda 100644 --- a/xnt/vcs/git.py +++ b/xnt/vcs/git.py @@ -28,6 +28,7 @@ def gitclone(url, dest=None, branch=None): :param dest: Destination directory or name of the cloned repository :param branch: Branch to clone """ + assert xnt.tasks.which("git") command = ["git", "clone"] command = xnt.vcs.clone_options(command, url, branch, dest) xnt.tasks.call(command) @@ -39,6 +40,7 @@ def gitpull(path, source="origin", branch="master"): :param source: Repository's upstream source :param branch: Repository's upstream branch to pull from """ + assert xnt.tasks.which("git") cwd = os.getcwd() os.chdir(path) command = ["git", "pull", source, branch] diff --git a/xnt/vcs/hg.py b/xnt/vcs/hg.py index 092c01d..6956d57 100644 --- a/xnt/vcs/hg.py +++ b/xnt/vcs/hg.py @@ -29,6 +29,7 @@ def hgclone(url, dest=None, rev=None, branch=None): :param rev: Revision to clone :param branch: Branch to clone """ + assert xnt.tasks.which("hg") command = ["hg", "clone"] if rev: command.append("--rev") @@ -42,6 +43,7 @@ def hgfetch(path, source='default'): :param path: Directory to the repository for which to pull changes :param source: Repository's upstream source """ + assert xnt.tasks.which("hg") command = ["hg", "pull", "-u", source] cwd = os.getcwd() os.chdir(path) |