[Cmake-commits] [cmake-commits] king committed cmFileCommand.cxx 1.127 1.128 cmFileCommand.h 1.45 1.46

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Apr 29 13:13:01 EDT 2009


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

Modified Files:
	cmFileCommand.cxx cmFileCommand.h 
Log Message:
ENH: Refactor file(INSTALL) implementation

The undocumented file(INSTALL) is implemented by a cmFileInstaller class
inside cmFileCommand.  This refactors the class to split out code not
specific to installation into a cmFileCopier base class.


Index: cmFileCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmFileCommand.h,v
retrieving revision 1.45
retrieving revision 1.46
diff -C 2 -d -r1.45 -r1.46
*** cmFileCommand.h	29 Apr 2009 12:47:13 -0000	1.45
--- cmFileCommand.h	29 Apr 2009 17:12:58 -0000	1.46
***************
*** 180,209 ****
    bool HandleDifferentCommand(std::vector<std::string> const& args);
  
-   // file(INSTALL ...) related functions
    bool HandleInstallCommand(std::vector<std::string> const& args);
-   bool ParseInstallArgs(std::vector<std::string> const& args,
-                         cmFileInstaller& installer,
-                         int& itype,
-                         std::string& destination,
-                         std::string& rename,
-                         std::vector<std::string>& files
-                        );
-   bool DoInstall(cmFileInstaller& installer,
-                  const int itype,
-                  const std::string& rename,
-                  const std::string& destination,
-                  const std::vector<std::string>& files
-                 );
    bool HandleDownloadCommand(std::vector<std::string> const& args);
-   void GetTargetTypeFromString(const std::string& stype, int& itype) const;
-   bool HandleInstallDestination(cmFileInstaller& installer,
-                                 std::string& destination);
-   void HandleInstallPermissions(cmFileInstaller& installer,
-                                 mode_t& permissions_file,
-                                 mode_t& permissions_dir,
-                                 int itype,
-                                 bool use_given_permissions_file,
-                                 bool use_given_permissions_dir,
-                                 bool use_source_permissions) const;
  };
  
--- 180,185 ----

Index: cmFileCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmFileCommand.cxx,v
retrieving revision 1.127
retrieving revision 1.128
diff -C 2 -d -r1.127 -r1.128
*** cmFileCommand.cxx	29 Apr 2009 12:47:13 -0000	1.127
--- cmFileCommand.cxx	29 Apr 2009 17:12:57 -0000	1.128
***************
*** 902,943 ****
  //----------------------------------------------------------------------------
  // File installation helper class.
! struct cmFileInstaller
  {
!   // All instances need the file command and makefile using them.
!   cmFileInstaller(cmFileCommand* command):
!     FileCommand(command), Makefile(command->GetMakefile()),
!     Always(false), Optional(false), DestDirLength(0), MatchlessFiles(true)
!     {
!     // Check whether to copy files always or only if they have changed.
[...1362 lines suppressed...]
!         {
!         return false;
!         }
!       }
!     else if(!installer.Install(fromFile.c_str(), toFile.c_str()))
!       {
!       return false;
!       }
!     }
! 
!   return true;
  }
  
--- 2163,2168 ----
  bool cmFileCommand::HandleInstallCommand(std::vector<std::string> const& args)
  {
    cmFileInstaller installer(this);
!   return installer.Run(args);
  }
  



More information about the Cmake-commits mailing list