[zi-cvs] packages/com.zzoss.plugin.lib Plugin.php,1.3,1.4

[email protected] Wed, 11 Feb 2004 06:42:00 -0800
Newsgroups gmane.comp.php.zzoss.installer.cvs
Message-ID <[email protected]>
Update of /cvsroot/zzossinstaller/packages/com.zzoss.plugin.lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30863/com.zzoss.plugin.lib

Modified Files:
	Plugin.php 
Log Message:
clean up dependency query before new installation

Index: Plugin.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.plugin.lib/Plugin.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Plugin.php	9 Feb 2004 18:54:30 -0000	1.3
--- Plugin.php	11 Feb 2004 14:41:58 -0000	1.4
***************
*** 171,177 ****
      function execRole()
      {
-         $files = $this->package["release"]["filelist"]["file"];
          //$this->log .= 'Files: '.var_export($files, true);
!         if(is_array($files)) {
              foreach($files as $file) {
                  $this->file = $file;
--- 171,177 ----
      function execRole()
      {
          //$this->log .= 'Files: '.var_export($files, true);
!         if(isset($this->package["release"]["filelist"]) && is_array($this->package["release"]["filelist"])) {
!             $files = $this->package["release"]["filelist"]["file"];
              foreach($files as $file) {
                  $this->file = $file;
***************
*** 188,208 ****
          }
          
          switch($this->action) {
              case 'install':
              case 'update':
                  // Post-processing
-                 $packages_installed_dir = $this->registry->getApplicationPath().'packages_installed'.DIRECTORY_SEPARATOR.$this->package["name"].'-'.$this->package["release"]["version"].DIRECTORY_SEPARATOR;
                  System::mkDir(array('-p', $packages_installed_dir));
                  copy(
                      $this->package["install"]["path"].'package.xml', 
                      $packages_installed_dir.'package.xml'
                      );
                  break;
              case 'remove':
!                  // remove package.xml of installed package
!                 @unlink($GLOBALS['ZI']['package_src'].'package.xml');
!                 
!                 // unlink directory
!                 // ZZOSS_InstallerUtils::rmdir('data'.DIRECTORY_SEPARATOR.'packages_installed'.DIRECTORY_SEPARATOR.$this->package["name"].'-'.$this->package["release"]["version"]);
                  break;
          }
--- 188,216 ----
          }
          
+         $packages_installed_dir = $this->registry->getApplicationPath().'packages_installed'.DIRECTORY_SEPARATOR.$this->package["name"].'-'.$this->package["release"]["version"].DIRECTORY_SEPARATOR;
+ 
          switch($this->action) {
              case 'install':
              case 'update':
+                 if(!isset($this->package["install"]["path"])){
+                     PEAR::raiseError('Internal Error: Unknow package source path. Seems like the package registry has not been refreshed properly.');
+                     break;
+                 }
                  // Post-processing
                  System::mkDir(array('-p', $packages_installed_dir));
+                 $this->log .= '* Created directory '.$packages_installed_dir."\n";
                  copy(
                      $this->package["install"]["path"].'package.xml', 
                      $packages_installed_dir.'package.xml'
                      );
+                 $this->log .= '* Copied '.$this->package["install"]["path"].'package.xml to '.$packages_installed_dir.'package.xml'."\n";
+                 // remove the extracted package
+                 System::rm(array('-rf',$this->package["install"]["path"]));
+                 $this->log .= '* Removed extracted package ('.$this->package["install"]["path"].')'."\n";
                  break;
              case 'remove':
!                 // remove directory of installed package
!                 System::rm(array('-rf',$packages_installed_dir));
!                 $this->log .= '* Removed installed package registry directory ('.$packages_installed_dir.')'."\n";
                  break;
          }
***************
*** 247,251 ****
                              if(file_exists($include)){
                                  $this->log .= "* Initializing global plugin variables.\n";
!                                 $this->initGlobalVariables($params['name']);
                                  $is_included = true;
                                  include($include);
--- 255,259 ----
                              if(file_exists($include)){
                                  $this->log .= "* Initializing global plugin variables.\n";
!                                 $this->initGlobalVariables();
                                  $is_included = true;
                                  include($include);
***************
*** 253,257 ****
                              }
                          } else {
!                             $this->initGlobalVariables($params['name']);
                              include($include);
                              $is_included = true;
--- 261,265 ----
                              }
                          } else {
!                             $this->initGlobalVariables();
                              include($include);
                              $is_included = true;
***************
*** 371,375 ****
      }
      
!     function initGlobalVariables($plugin_name)
      {
          
--- 379,383 ----
      }
      
!     function initGlobalVariables()
      {
          
***************
*** 437,441 ****
      function initGlobalVariablesBuild()
      {
!         $GLOBALS['ZI']['plugin_data_dir'] = $this->registry->getApplicationPath().'data'.DIRECTORY_SEPARATOR.$plugin_name.DIRECTORY_SEPARATOR;
          
          $GLOBALS['ZI']['build_dir'] =
--- 445,449 ----
      function initGlobalVariablesBuild()
      {
!         $GLOBALS['ZI']['plugin_data_dir'] = $this->registry->getApplicationPath().'data'.DIRECTORY_SEPARATOR.$this->package['name'].DIRECTORY_SEPARATOR;
          
          $GLOBALS['ZI']['build_dir'] =



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn