diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2014-06-22 19:38:47 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2014-06-22 19:38:47 +0300 |
commit | 923ad8ab9b27fcbf30f7142d2aa88e6c036c1cd1 (patch) | |
tree | 2d556537145592017fd1d09a86cc2e864e2bbf03 /rustrunner.py | |
parent | 147e04ac80dccc1a19ec94338472a2cd3989f055 (diff) | |
download | meson-923ad8ab9b27fcbf30f7142d2aa88e6c036c1cd1.zip meson-923ad8ab9b27fcbf30f7142d2aa88e6c036c1cd1.tar.gz meson-923ad8ab9b27fcbf30f7142d2aa88e6c036c1cd1.tar.bz2 |
Invoke Rust via wrapper script.
Diffstat (limited to 'rustrunner.py')
-rwxr-xr-x | rustrunner.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/rustrunner.py b/rustrunner.py index 18700c1..4af196b 100755 --- a/rustrunner.py +++ b/rustrunner.py @@ -28,12 +28,11 @@ def delete_old_crates(target_name, target_type): if target_type == 'dylib': (base, suffix) = os.path.splitext(target_name) crates = glob.glob(base + '-*' + suffix) - crates = [(os.stat(i).st_ctime, i) for i in crates] + crates = [(os.stat(i).st_mtime, i) for i in crates] [os.unlink(c[1]) for c in sorted(crates)[:-1]] def invoke_rust(rustc_command): - return 0 - #return subprocess.call(rustc_command, shell=False) + return subprocess.call(rustc_command, shell=False) def touch_file(fname): try: @@ -53,6 +52,8 @@ if __name__ == '__main__': retval = invoke_rust(rustc_command) if retval != 0: sys.exit(retval) - delete_old_crates(target_name, target_type) - touch_file(target_name) + if target_type != "bin": + delete_old_crates(target_name, target_type) + touch_file(target_name) + |