diff options
| -rw-r--r-- | build.xml | 2 | ||||
| -rw-r--r-- | build28.xml | 4 | ||||
| -rw-r--r-- | buildtool.cpp | 74 |
3 files changed, 77 insertions, 3 deletions
@@ -209,7 +209,7 @@ <copy file="${gtk}/bin/libgmodule-2.0-0.dll" todir="${dist}"/>
<copy file="${gtk}/bin/libgobject-2.0-0.dll" todir="${dist}"/>
<copy file="${gtk}/bin/libgtk-win32-2.0-0.dll" todir="${dist}"/>
- <copy file="${gtk}/bin/libgthread-2.0-0.dlll" todir="${dist}"/>
+ <copy file="${gtk}/bin/libgthread-2.0-0.dll" todir="${dist}"/>
<copy file="${gtk}/bin/libcairo-2.dll" todir="${dist}"/>
<copy file="${gtk}/bin/libpangocairo-1.0-0.dll" todir="${dist}"/>
<copy file="${gtk}/bin/libpango-1.0-0.dll" todir="${dist}"/>
diff --git a/build28.xml b/build28.xml index fcae72ee9..8906be17b 100644 --- a/build28.xml +++ b/build28.xml @@ -183,7 +183,7 @@ <strip file="${build}/inkscape.exe"/>
</target>
- <target name="dist" depends="link"
+ <target name="dist" depends="link,i18n"
description="generate the distribution" >
<!-- Create the distribution directory -->
<copy file="${build}/inkscape.exe" todir="${dist}"/>
@@ -207,7 +207,7 @@ <copy file="${gtk}/bin/libgmodule-2.0-0.dll" todir="${dist}"/>
<copy file="${gtk}/bin/libgobject-2.0-0.dll" todir="${dist}"/>
<copy file="${gtk}/bin/libgtk-win32-2.0-0.dll" todir="${dist}"/>
- <copy file="${gtk}/bin/libgthread-2.0-0.dlll" todir="${dist}"/>
+ <copy file="${gtk}/bin/libgthread-2.0-0.dll" todir="${dist}"/>
<copy file="${gtk}/bin/libcairo-2.dll" todir="${dist}"/>
<copy file="${gtk}/bin/libpangocairo-1.0-0.dll" todir="${dist}"/>
<copy file="${gtk}/bin/libpango-1.0-0.dll" todir="${dist}"/>
diff --git a/buildtool.cpp b/buildtool.cpp index 11d6b7fa9..d738e03a2 100644 --- a/buildtool.cpp +++ b/buildtool.cpp @@ -2088,6 +2088,16 @@ protected: 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 */ bool isNewerThan(const String &fileA, const String &fileB); @@ -3030,6 +3040,8 @@ bool MakeBase::copyFile(const String &srcFile, const String &destFile) } //# 3 do the data copy +#ifndef __WIN32__ + FILE *srcf = fopen(srcNative.c_str(), "rb"); if (!srcf) { @@ -3054,7 +3066,59 @@ bool MakeBase::copyFile(const String &srcFile, const String &destFile) 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; } @@ -4925,6 +4989,11 @@ public: 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; @@ -5010,6 +5079,11 @@ public: 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; |
