From 57cc59493942036e0db40aa12e24b9603fe3da7d Mon Sep 17 00:00:00 2001 From: Bob Jamison Date: Sat, 3 Mar 2007 19:23:27 +0000 Subject: Add . Fix piping again. (bzr r2521) --- buildtool.cpp | 103 ++++++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 82 insertions(+), 21 deletions(-) (limited to 'buildtool.cpp') diff --git a/buildtool.cpp b/buildtool.cpp index 5a53f745a..34d801c57 100644 --- a/buildtool.cpp +++ b/buildtool.cpp @@ -37,7 +37,7 @@ * */ -#define BUILDTOOL_VERSION "BuildTool v0.6.2, 2007 Bob Jamison" +#define BUILDTOOL_VERSION "BuildTool v0.6.3, 2007 Bob Jamison" #include #include @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -1875,8 +1876,6 @@ Element *Parser::parseFile(const String &fileName) return n; } - - //######################################################################## //######################################################################## //## E N D X M L @@ -1884,6 +1883,10 @@ Element *Parser::parseFile(const String &fileName) //######################################################################## + + + + //######################################################################## //######################################################################## //## U R I @@ -2329,6 +2332,7 @@ URI URI::resolve(const URI &other) const } + /** * This follows the Java URI algorithm: * 1. All "." segments are removed. @@ -2447,6 +2451,7 @@ void URI::trace(const char *fmt, ...) + //######################################################################### //# P A R S I N G //######################################################################### @@ -3470,40 +3475,33 @@ bool MakeBase::executeCommand(const String &command, { //trace("## stderr"); DWORD avail; - if (!PeekNamedPipe(stderrRead, NULL, 0, NULL, &avail, NULL)) - break; + PeekNamedPipe(stderrRead, NULL, 0, NULL, &avail, NULL); if (avail > 0) { DWORD bytesRead = 0; char readBuf[1025]; if (avail>1024) avail = 1024; - if (!ReadFile(stderrRead, readBuf, avail, &bytesRead, NULL) - || bytesRead == 0) + ReadFile(stderrRead, readBuf, avail, &bytesRead, NULL); + if (bytesRead > 0) { - break; + for (unsigned int i=0 ; i 0) { DWORD bytesRead = 0; char readBuf[1025]; if (avail>1024) avail = 1024; - if (!ReadFile(stdoutRead, readBuf, avail, &bytesRead, NULL) - || bytesRead==0) + ReadFile(stdoutRead, readBuf, avail, &bytesRead, NULL); + if (bytesRead > 0) { - break; + for (unsigned int i=0 ; i could not create '%s' : %s", + nativeFile.c_str(), strerror(ret)); + return false; + } + return true; + } + int ret = utime(nativeFile.c_str(), (struct utimbuf *)0); + if (ret != 0) + { + error(" could not update the modification time for '%s' : %s", + nativeFile.c_str(), strerror(ret)); + return false; + } + return true; + } + + virtual bool parse(Element *elem) + { + //trace("touch parse"); + if (!parent.getAttribute(elem, "file", fileName)) + return false; + if (fileName.size() == 0) + { + error(" requires 'file=\"fileName\"' attribute"); + return false; + } + return true; + } + + String fileName; +}; + + /** * */ @@ -7300,6 +7359,8 @@ Task *Task::createTask(Element *elem) task = new TaskStaticLib(parent); else if (tagName == "strip") task = new TaskStrip(parent); + else if (tagName == "touch") + task = new TaskTouch(parent); else if (tagName == "tstamp") task = new TaskTstamp(parent); else -- cgit v1.2.3