Mercurial > projects > doodle
changeset 59:860e18c87255
Stylistics
author | "David Bryant <bagnose@gmail.com>" |
---|---|
date | Mon, 09 Aug 2010 21:50:16 +0930 |
parents | c63719604adb |
children | e64baac3efb2 |
files | configure.d |
diffstat | 1 files changed, 17 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/configure.d Mon Aug 09 21:43:24 2010 +0930 +++ b/configure.d Mon Aug 09 21:50:16 2010 +0930 @@ -34,56 +34,56 @@ int main(string[] args) { - string source_path = getcwd; + string sourcePath = getcwd; // parse command-line options if (args.length < 2) { writefln("Error - usage is: rdmd <configure.d-path> <build-path>"); return -1; } - string target_path = args[1]; + string targetPath = args[1]; // check that source_path looks like a source tree by making sure // that a README and options file are present writefln("Examining source"); - if (!source_path.join("README").exists || !source_path.join("options").exists) { + if (!sourcePath.join("README").exists || !sourcePath.join("options").exists) { writefln("Error - current directory must contain README and options"); return -1; } // ensure that target_path exists writefln("Establishing build directory"); - if (target_path.exists) { - writefln("Error - %s exists - abandoning configure", target_path); + if (targetPath.exists) { + writefln("Error - %s exists - abandoning configure", targetPath); return -1; } - target_path.mkdirRecurse; - string bin_path = target_path.join("bin"); - bin_path.mkdir; + targetPath.mkdirRecurse; + string binPath = targetPath.join("bin"); + binPath.mkdir; // compile builder into bin_path writefln("Building the builder"); int ret = system(format("dmd -w -wi %s -O -of%s", - source_path.join("builder.d"), bin_path.join("builder"))); + sourcePath.join("builder.d"), binPath.join("builder"))); if (ret) { writefln("Error - builder failed to compile"); return -1; } - bin_path.join("builder.o").remove; + binPath.join("builder.o").remove; // set up scripts { - auto file = File(target_path.join("environment"), "w"); - file.writefln("SOURCE_PATH=%s", source_path); - file.writefln("TARGET_PATH=%s", target_path); + auto file = File(targetPath.join("environment"), "w"); + file.writefln("SOURCE_PATH=%s", sourcePath); + file.writefln("TARGET_PATH=%s", targetPath); } { - auto file = File(target_path.join("build"), "w"); + auto file = File(targetPath.join("build"), "w"); file.writefln("#!/bin/bash"); - file.writefln("source %s", target_path.join("environment")); - file.writefln("%s %s %s", bin_path.join("builder"), source_path, target_path); + file.writefln("source %s", targetPath.join("environment")); + file.writefln("%s %s %s", binPath.join("builder"), sourcePath, targetPath); } - system("chmod +x " ~ target_path.join("build")); + system("chmod +x " ~ targetPath.join("build")); writefln("All done"); return 0;