[Cmake-commits] [cmake-commits] david.cole committed cmCPackBundleGenerator.cxx 1.8 1.9 cmCPackBundleGenerator.h 1.3 1.4 cmCPackLog.cxx 1.7 1.8 cpack.cxx 1.45 1.46
cmake-commits at cmake.org
cmake-commits at cmake.org
Thu Jan 22 13:56:16 EST 2009
Update of /cvsroot/CMake/CMake/Source/CPack
In directory public:/mounts/ram/cvs-serv5944/Source/CPack
Modified Files:
cmCPackBundleGenerator.cxx cmCPackBundleGenerator.h
cmCPackLog.cxx cpack.cxx
Log Message:
BUG: Fix issue #8383. Avoid crashing when using the Bundle CPack generator and CPACK_BUNDLE_NAME is not set. Instead, fail gracefully giving an informative error message and non-zero exit code.
Index: cmCPackBundleGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CPack/cmCPackBundleGenerator.cxx,v
retrieving revision 1.8
retrieving revision 1.9
diff -C 2 -d -r1.8 -r1.9
*** cmCPackBundleGenerator.cxx 22 Jan 2009 17:12:44 -0000 1.8
--- cmCPackBundleGenerator.cxx 22 Jan 2009 18:56:13 -0000 1.9
***************
*** 33,36 ****
--- 33,52 ----
//----------------------------------------------------------------------
+ int cmCPackBundleGenerator::InitializeInternal()
+ {
+ const char* name = this->GetOption("CPACK_BUNDLE_NAME");
+ if(0 == name)
+ {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "CPACK_BUNDLE_NAME must be set to use the Bundle generator."
+ << std::endl);
+
+ return 0;
+ }
+
+ return this->Superclass::InitializeInternal();
+ }
+
+ //----------------------------------------------------------------------
const char* cmCPackBundleGenerator::GetPackagingInstallPrefix()
{
Index: cmCPackLog.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CPack/cmCPackLog.cxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -C 2 -d -r1.7 -r1.8
*** cmCPackLog.cxx 10 Mar 2006 18:06:26 -0000 1.7
--- cmCPackLog.cxx 22 Jan 2009 18:56:13 -0000 1.8
***************
*** 19,22 ****
--- 19,23 ----
#include "cmGeneratedFileStream.h"
+ #include "cmSystemTools.h"
//----------------------------------------------------------------------
***************
*** 222,224 ****
--- 223,230 ----
this->NewLine = true;
}
+
+ if ( error )
+ {
+ cmSystemTools::SetErrorOccured();
+ }
}
Index: cpack.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CPack/cpack.cxx,v
retrieving revision 1.45
retrieving revision 1.46
diff -C 2 -d -r1.45 -r1.46
*** cpack.cxx 24 Sep 2008 14:01:32 -0000 1.45
--- cpack.cxx 22 Jan 2009 18:56:13 -0000 1.46
***************
*** 475,478 ****
--- 475,483 ----
}
+ if (cmSystemTools::GetErrorOccuredFlag())
+ {
+ return 1;
+ }
+
return 0;
}
Index: cmCPackBundleGenerator.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CPack/cmCPackBundleGenerator.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C 2 -d -r1.3 -r1.4
*** cmCPackBundleGenerator.h 22 Jan 2009 17:12:44 -0000 1.3
--- cmCPackBundleGenerator.h 22 Jan 2009 18:56:13 -0000 1.4
***************
*** 35,38 ****
--- 35,39 ----
protected:
+ virtual int InitializeInternal();
virtual const char* GetPackagingInstallPrefix();
int CompressFiles(const char* outFileName, const char* toplevel,
More information about the Cmake-commits
mailing list