[Cmake-commits] [cmake-commits] hoffman committed cmCPackCygwinBinaryGenerator.cxx 1.3 1.4 cmCPackGenerator.cxx 1.4 1.5

cmake-commits at cmake.org cmake-commits at cmake.org
Fri Mar 7 11:06:46 EST 2008


Update of /cvsroot/CMake/CMake/Source/CPack
In directory public:/mounts/ram/cvs-serv18307

Modified Files:
	cmCPackCygwinBinaryGenerator.cxx cmCPackGenerator.cxx 
Log Message:
ENH: fix crash in cygwin package stuff


Index: cmCPackCygwinBinaryGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CPack/cmCPackCygwinBinaryGenerator.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -C 2 -d -r1.3 -r1.4
*** cmCPackCygwinBinaryGenerator.cxx	31 Oct 2007 12:50:17 -0000	1.3
--- cmCPackCygwinBinaryGenerator.cxx	7 Mar 2008 16:06:44 -0000	1.4
***************
*** 99,103 ****
  {
    this->OutputExtension = "-";
!   this->OutputExtension += this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
    this->OutputExtension += ".tar.bz2";
    return this->OutputExtension.c_str();
--- 99,111 ----
  {
    this->OutputExtension = "-";
!   const char* patchNumber =this->GetOption("CPACK_CYGWIN_PATCH_NUMBER");
!   if(!patchNumber)
!     {
!     patchNumber = "1";  
!     cmCPackLogger(cmCPackLog::LOG_WARNING, 
!                   "CPACK_CYGWIN_PATCH_NUMBER not specified using 1"
!                   << std::endl);
!     }
!   this->OutputExtension += 
    this->OutputExtension += ".tar.bz2";
    return this->OutputExtension.c_str();

Index: cmCPackGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CPack/cmCPackGenerator.cxx,v
retrieving revision 1.4
retrieving revision 1.5
diff -C 2 -d -r1.4 -r1.5
*** cmCPackGenerator.cxx	18 Feb 2008 15:26:28 -0000	1.4
--- cmCPackGenerator.cxx	7 Mar 2008 16:06:44 -0000	1.5
***************
*** 60,64 ****
  //----------------------------------------------------------------------
  int cmCPackGenerator::PrepareNames()
! {
  
    std::string tempDirectory = this->GetOption("CPACK_PACKAGE_DIRECTORY");
--- 60,66 ----
  //----------------------------------------------------------------------
  int cmCPackGenerator::PrepareNames()
! {  
!   cmCPackLogger(cmCPackLog::LOG_DEBUG,
!     "Create temp directory." << std::endl);
  
    std::string tempDirectory = this->GetOption("CPACK_PACKAGE_DIRECTORY");
***************
*** 72,85 ****
    tempDirectory += this->GetOption("CPACK_GENERATOR");
    std::string topDirectory = tempDirectory;
! 
!   std::string outName = this->GetOption("CPACK_PACKAGE_FILE_NAME");
    tempDirectory += "/" + outName;
    outName += this->GetOutputExtension();
  
!   std::string destFile = this->GetOption("CPACK_PACKAGE_DIRECTORY");
    destFile += "/" + outName;
- 
    std::string outFile = topDirectory + "/" + outName;
- 
    bool setDestDir = cmSystemTools::IsOn(this->GetOption("CPACK_SET_DESTDIR"));
    std::string installPrefix = tempDirectory;
--- 74,105 ----
    tempDirectory += this->GetOption("CPACK_GENERATOR");
    std::string topDirectory = tempDirectory;
!   this->GetOption("CPACK_PACKAGE_FILE_NAME");
!   const char* pfname = this->GetOption("CPACK_PACKAGE_FILE_NAME");
!   if(!pfname)
!     {
!     cmCPackLogger(cmCPackLog::LOG_ERROR,
!                   "CPACK_PACKAGE_FILE_NAME not specified" << std::endl);
!     return 0;
!     }
!   std::string outName = pfname; 
    tempDirectory += "/" + outName;
+   if(!this->GetOutputExtension())
+     {
+     cmCPackLogger(cmCPackLog::LOG_ERROR,
+                   "No output extension specified" << std::endl);
+     return 0;
+     }
    outName += this->GetOutputExtension();
+   const char* pdir = this->GetOption("CPACK_PACKAGE_DIRECTORY");
+   if(!pdir)
+     {
+     cmCPackLogger(cmCPackLog::LOG_ERROR,
+                   "CPACK_PACKAGE_DIRECTORY not specified" << std::endl);
+     return 0;
+     }
  
!   std::string destFile = pdir;
    destFile += "/" + outName;
    std::string outFile = topDirectory + "/" + outName;
    bool setDestDir = cmSystemTools::IsOn(this->GetOption("CPACK_SET_DESTDIR"));
    std::string installPrefix = tempDirectory;
***************
*** 654,657 ****
--- 674,678 ----
      return 0;
      }
+ 
    if ( cmSystemTools::IsOn(
        this->GetOption("CPACK_REMOVE_TOPLEVEL_DIRECTORY")) )
***************
*** 673,680 ****
--- 694,707 ----
        }
      }
+   cmCPackLogger(cmCPackLog::LOG_DEBUG,
+                 "About to install project " << std::endl);
+ 
    if ( !this->InstallProject() )
      {
      return 0;
      }
+   cmCPackLogger(cmCPackLog::LOG_DEBUG,
+                 "Done install project " << std::endl);
+ 
  
    const char* tempPackageFileName = this->GetOption(
***************
*** 790,794 ****
  //----------------------------------------------------------------------
  const char* cmCPackGenerator::GetOption(const char* op)
! {
    return this->MakefileMap->GetDefinition(op);
  }
--- 817,821 ----
  //----------------------------------------------------------------------
  const char* cmCPackGenerator::GetOption(const char* op)
! { 
    return this->MakefileMap->GetDefinition(op);
  }



More information about the Cmake-commits mailing list