Upgrade failed, cannot copy lib files

We were just working on doing an upgrade to the newest Matrix version. We have a custom package called puc that I wrote to hold a few of our custom assets. One of the assets has some lib files, which I thought would be moved over automatically. The strange thing is, if we run step_03.php by itself, it complete fine and there is no error, but if we run the upgrade script, and IT runs step_03.php then we get this error:

    ------------------------------------                                                                
    Installing Package_Manager_PUC:                                                                     
    ------------------------------------                                                                
    0 => content_type_fck_editor                                                                        
    +---------------------------------------------------------------------------------------------------
    ----------------------------------------------------------------------------------------+           
    | PHP Warning                                                                                       
                                                                                        |           
    |---------------------------------------------------------------------------------------------------
    ----------------------------------------------------------------------------------------|           
    | File : [SYSTEM_ROOT]/fudge/general/file_system.inc                                                
                                                                                        |           
    | Line : 469                                                                                        
                                                                                        |           
    |---------------------------------------------------------------------------------------------------
    ----------------------------------------------------------------------------------------|           
    | copy([SYSTEM_ROOT]/packages/puc/content_type_fck_editor/[SYSTEM_ROOT]/packages/puc/content_type_fc
    k_editor/lib/fckeditor/fckstyles.xml): failed to open stream: No such file or directory |           
    +---------------------------------------------------------------------------------------------------
    ----------------------------------------------------------------------------------------+           
    *ERROR* '/usr/bin/php' '/opt/matrix/install/step_03.php' '/opt/matrix' returned error code 1
                                                            [ Error ]


Here is what I have in my package manager file:

    require_once SQ_INCLUDE_PATH.'/package_manager.inc';
/**
* Package_Manager_PUC
*
* Purpose
*    Manages the install and upgrade of the PUC package and PUC assets,
*    uses info gleened from the package.xml and asset.xml files
*
* @version $Revision: 1.1.1.1 $
* @package MySource_Matrix_Packages
* @subpackage puc
*/
class Package_Manager_PUC extends Package_Manager
{

	/**
	* Constructor
	*
	*/
	function Package_Manager_PUC()
	{
			$this->_full_path = SQ_PACKAGES_PATH.'/puc';
			$this->Package_Manager();

			// Copy over the extra files that we need
			$path = SQ_LIB_PATH.'/puc_files';
			if (!is_dir($path)) {
				mkdir($path);
			}//end

			// Check on clearbox
			$create_path = $path.'/clearbox';
			$full_path = SQ_PACKAGES_PATH.'/puc/';
			if (!is_dir($create_path) && is_dir($path)) {
				mkdir($create_path);
				$this->recurse_copy($full_path.'lib/clearbox', $create_path);
			}//end

	}//end constructor	
	
	/**
	* Recursivly copy a directory and contents
	*
	*/
	function recurse_copy($src,$dst) { 
		$dir = opendir($src); 
		@mkdir($dst); 
		while(false !== ( $file = readdir($dir)) ) { 
			if (( $file != '.' ) && ( $file != '..' )) { 
				if ( is_dir($src . '/' . $file) ) { 
					$this->recurse_copy($src . '/' . $file,$dst . '/' . $file); 
				} 
				else { 
					copy($src . '/' . $file,$dst . '/' . $file); 
				} 
			} 
		} 
		closedir($dir); 
	}//end
	
}//end class</pre><br />


Ideas why it would have errors only when using the upgrade scripts?

The error you get doesn't look like it's related to the code in package manager file you showed me.


my reasons are:

  • "File : [SYSTEM_ROOT]/fudge/general/file_system.inc line 469" error is throw from a Matrix function copy_file, which is not used in your package manager code
  • The installation step shows you are on content_type_fck_editor sub step, which is after installing package manager



    I would think the error you get is from installing the content_type_fck_editor, probably you can put a var_dump(get_backtrace()) in the copy_file function, so you will get a back trace of what's happening.

[quote]
The error you get doesn't look like it's related to the code in package manager file you showed me.



my reasons are:

  • "File : [SYSTEM_ROOT]/fudge/general/file_system.inc line 469" error is throw from a Matrix function copy_file, which is not used in your package manager code
  • The installation step shows you are on content_type_fck_editor sub step, which is after installing package manager



    I would think the error you get is from installing the content_type_fck_editor, probably you can put a var_dump(get_backtrace()) in the copy_file function, so you will get a back trace of what's happening.

    [/quote]



    Thanks, I ended up just manually putting in the package after the install finished.