summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6cdc566)
raw | patch | inline | side by side (parent: 6cdc566)
author | ishmal <ishmal@users.sourceforge.net> | |
Wed, 14 May 2008 15:36:51 +0000 (15:36 +0000) | ||
committer | ishmal <ishmal@users.sourceforge.net> | |
Wed, 14 May 2008 15:36:51 +0000 (15:36 +0000) |
buildtool.cpp | patch | blob | history |
diff --git a/buildtool.cpp b/buildtool.cpp
index 12f3d63e7c13fdfbef0502e083f3ee1a2f4174d9..414c8e3fc85e30373c3c445a16437e3a77c0d1cb 100644 (file)
--- a/buildtool.cpp
+++ b/buildtool.cpp
*
*/
-#define BUILDTOOL_VERSION "BuildTool v0.9.1"
+#define BUILDTOOL_VERSION "BuildTool v0.9.2"
#include <stdio.h>
#include <fcntl.h>
*/
PkgConfig()
{
- path = ".";
- prefix = "/target";
- init();
- }
+ path = ".";
+ prefix = "/target";
+ init();
+ }
/**
*
if (path.size() > 0)
pkgConfig.setPath(path);
if (prefix.size() > 0)
- pkgConfig.setPrefix(prefix);
+ pkgConfig.setPrefix(prefix);
if (!pkgConfig.query(packageName))
return false;
if (query == 0)
/**
* Analyse a string, looking for any substitutions or other
- * things that need resilution
+ * things that need resolution
*/
bool MakeBase::getSubstitutionsRecursive(const String &str,
String &result, int depth)
{
- if (depth > 4)
+ if (depth > 10)
{
- error("getSubstitutions: nesting of substitutions too deep");
+ error("nesting of substitutions too deep (>10) for '%s'",
+ str.c_str());
return false;
- }
+ }
String s = trim(str);
int len = (int)s.size();
String val;
fileName.c_str(), toFileName.c_str());
String fullSource = parent.resolve(fileName);
String fullDest = parent.resolve(toFileName);
- //trace("copy %s to file %s", fullSource.c_str(),
- // fullDest.c_str());
+ if (verbose)
+ taskstatus("copy %s to file %s", fullSource.c_str(),
+ fullDest.c_str());
if (!isRegularFile(fullSource))
{
error("copy : file %s does not exist", fullSource.c_str());
destPath.append(fileName);
String fullDest = parent.resolve(destPath);
//trace("fileName:%s", fileName.c_str());
- //trace("copy %s to new dir : %s", fullSource.c_str(),
- // fullDest.c_str());
+ if (verbose)
+ taskstatus("copy %s to new dir : %s",
+ fullSource.c_str(), fullDest.c_str());
if (!isNewerThan(fullSource, fullDest))
{
- //trace("copy skipping %s", fullSource.c_str());
+ if (verbose)
+ taskstatus("copy skipping %s", fullSource.c_str());
continue;
}
if (!copyFile(fullSource, fullDest))
}
destPath.append(baseName);
String fullDest = parent.resolve(destPath);
- //trace("copy %s to new dir : %s", fullSource.c_str(),
- // fullDest.c_str());
+ if (verbose)
+ taskstatus("file %s to new dir : %s", fullSource.c_str(),
+ fullDest.c_str());
if (!isRegularFile(fullSource))
{
error("copy : file %s does not exist", fullSource.c_str());
{
case DEL_FILE:
{
- status(" : %s", fileName.c_str());
+ taskstatus("file: %s", fileName.c_str());
String fullName = parent.resolve(fileName);
char *fname = (char *)fullName.c_str();
+ if (!quiet && verbose)
+ taskstatus("path: %s", fname);
//does not exist
if (stat(fname, &finfo)<0)
- return true;
+ {
+ if (failOnError)
+ return false;
+ else
+ return true;
+ }
//exists but is not a regular file
if (!S_ISREG(finfo.st_mode))
{
}
case DEL_DIR:
{
- taskstatus("%s", dirName.c_str());
+ taskstatus("dir: %s", dirName.c_str());
String fullDir = parent.resolve(dirName);
+ if (!quiet && verbose)
+ taskstatus("path: %s", fullDir.c_str());
if (!removeDirectory(fullDir))
return false;
return true;