summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 32c9db3)
raw | patch | inline | side by side (parent: 32c9db3)
author | ishmal <ishmal@users.sourceforge.net> | |
Fri, 17 Nov 2006 05:37:21 +0000 (05:37 +0000) | ||
committer | ishmal <ishmal@users.sourceforge.net> | |
Fri, 17 Nov 2006 05:37:21 +0000 (05:37 +0000) |
build.xml | patch | blob | history | |
build28.xml | patch | blob | history | |
buildtool.cpp | patch | blob | history |
diff --git a/build.xml b/build.xml
index 1ffee9d10fc0383018dd82f6f8bc9ba832a56c16..f8d8002a0cdb7095957e2be50578c11574afbacf 100644 (file)
--- a/build.xml
+++ b/build.xml
<copy file="${gtk}/bin/libgmodule-2.0-0.dll" todir="${dist}"/>\r
<copy file="${gtk}/bin/libgobject-2.0-0.dll" todir="${dist}"/>\r
<copy file="${gtk}/bin/libgtk-win32-2.0-0.dll" todir="${dist}"/>\r
- <copy file="${gtk}/bin/libgthread-2.0-0.dlll" todir="${dist}"/>\r
+ <copy file="${gtk}/bin/libgthread-2.0-0.dll" todir="${dist}"/>\r
<copy file="${gtk}/bin/libcairo-2.dll" todir="${dist}"/>\r
<copy file="${gtk}/bin/libpangocairo-1.0-0.dll" todir="${dist}"/>\r
<copy file="${gtk}/bin/libpango-1.0-0.dll" todir="${dist}"/>\r
diff --git a/build28.xml b/build28.xml
index fcae72ee9607bd972fecc6bdeab6c4776a2575c0..8906be17b16dc913cf16505e731698723712f40a 100644 (file)
--- a/build28.xml
+++ b/build28.xml
<strip file="${build}/inkscape.exe"/>\r
</target>\r
\r
- <target name="dist" depends="link"\r
+ <target name="dist" depends="link,i18n"\r
description="generate the distribution" >\r
<!-- Create the distribution directory -->\r
<copy file="${build}/inkscape.exe" todir="${dist}"/>\r
<copy file="${gtk}/bin/libgmodule-2.0-0.dll" todir="${dist}"/>\r
<copy file="${gtk}/bin/libgobject-2.0-0.dll" todir="${dist}"/>\r
<copy file="${gtk}/bin/libgtk-win32-2.0-0.dll" todir="${dist}"/>\r
- <copy file="${gtk}/bin/libgthread-2.0-0.dlll" todir="${dist}"/>\r
+ <copy file="${gtk}/bin/libgthread-2.0-0.dll" todir="${dist}"/>\r
<copy file="${gtk}/bin/libcairo-2.dll" todir="${dist}"/>\r
<copy file="${gtk}/bin/libpangocairo-1.0-0.dll" todir="${dist}"/>\r
<copy file="${gtk}/bin/libpango-1.0-0.dll" todir="${dist}"/>\r
diff --git a/buildtool.cpp b/buildtool.cpp
index 11d6b7fa990d52b6da5c9660af73142777238d36..d738e03a24c47422765dc8c987bb05abab7f18dd 100644 (file)
--- a/buildtool.cpp
+++ b/buildtool.cpp
*/
bool copyFile(const String &srcFile, const String &destFile);
+ /**
+ * Tests if the file exists and is a regular file
+ */
+ bool isRegularFile(const String &fileName);
+
+ /**
+ * Tests if the file exists and is a directory
+ */
+ bool isDirectory(const String &fileName);
+
/**
* Tests is the modification date of fileA is newer than fileB
*/
}
//# 3 do the data copy
+#ifndef __WIN32__
+
FILE *srcf = fopen(srcNative.c_str(), "rb");
if (!srcf)
{
fclose(destf);
fclose(srcf);
+#else
+
+ if (!CopyFile(srcNative.c_str(), destNative.c_str(), false))
+ {
+ error("copyFile from %s to %s failed",
+ srcNative.c_str(), destNative.c_str());
+ return false;
+ }
+
+#endif /* __WIN32__ */
+
+
+ return true;
+}
+
+
+/**
+ * Tests if the file exists and is a regular file
+ */
+bool MakeBase::isRegularFile(const String &fileName)
+{
+ String native = getNativePath(fileName);
+ struct stat finfo;
+
+ //Exists?
+ if (stat(native.c_str(), &finfo)<0)
+ return false;
+
+
+ //check the file mode
+ if (!S_ISREG(finfo.st_mode))
+ return false;
+
+ return true;
+}
+
+/**
+ * Tests if the file exists and is a directory
+ */
+bool MakeBase::isDirectory(const String &fileName)
+{
+ String native = getNativePath(fileName);
+ struct stat finfo;
+
+ //Exists?
+ if (stat(native.c_str(), &finfo)<0)
+ return false;
+
+
+ //check the file mode
+ if (!S_ISDIR(finfo.st_mode))
+ return false;
return true;
}
String fullDest = parent.resolve(toFileName);
//trace("copy %s to file %s", fullSource.c_str(),
// fullDest.c_str());
+ if (!isRegularFile(fullSource))
+ {
+ error("copy : file %s does not exist", fullSource.c_str());
+ return false;
+ }
if (!isNewerThan(fullSource, fullDest))
{
return true;
String fullDest = parent.resolve(destPath);
//trace("copy %s to new dir : %s", fullSource.c_str(),
// fullDest.c_str());
+ if (!isRegularFile(fullSource))
+ {
+ error("copy : file %s does not exist", fullSource.c_str());
+ return false;
+ }
if (!isNewerThan(fullSource, fullDest))
{
return true;