[zi-cvs] packages/com.zzoss.plugin.lib Plugin.php,1.18,1.19 package.xml,1.1.1.1,1.2

Sandro Zic <[email protected]> Sat, 24 Apr 2004 15:36:42 +0000
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-serv25355/com.zzoss.plugin.lib

Modified Files:
	Plugin.php package.xml 
Log Message:
create package tgz with dir in filelist

Index: Plugin.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.plugin.lib/Plugin.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** Plugin.php	7 Apr 2004 06:11:57 -0000	1.18
--- Plugin.php	24 Apr 2004 15:36:40 -0000	1.19
***************
*** 231,242 ****
          }
          
-         
          //$this->log .= 'Files: '.var_export($files, true);
!         if(isset($this->package["release"]["filelist"])){
              // clean up previous filelist
              $this->filelist_dirs = array();
              $this->filelist_dirs_roles = array();
              $this->execRoleFilelist($this->package["release"]["filelist"]);
!         }
          
          switch($this->action) {
--- 231,267 ----
          }
          
          //$this->log .= 'Files: '.var_export($files, true);
!         //if(isset($this->package["release"]["filelist"])){
!         include_once 'ZZOSS_Package/Descriptor.php';
!         $descr = new ZZOSS_PackageDescriptor;
!         $descr->setArray($this->package);
!         if(!$files = $descr->getFilelist('flat')){
!             $this->log .= "No files.\n";
!         } else {
!             foreach($files as $this->file){
!                 // execute plugins
!                 $this->log .= "* Dealing with role '".$this->file["@"]["role"]."'\n";
!                 //$this->log .= "  performing on '".var_export($this->plugins['role']['role'], true)."'\n";
!                 if(!isset($this->plugins['role']['role'][$this->file["@"]["role"]])){
!                     $this->execPluginRole();
!                 } else {
!                     if(!$this->includePlugins($this->plugins['role']['role'][$this->file["@"]["role"]])){
!                         $this->log .= "* ERROR: A handler for this role does not exist.\n";
!                     }
!                 }
!                 
!                 // remember baseinstalldir of file in case it is a plugin file
!                 // which we register later
!                 if(isset($this->file["@"]["baseinstalldir"])){
!                     $this->file_baseinstalldir[$this->file["@"]["name"]] = $this->file["@"]["baseinstalldir"];
!                 }
!             }
!         }
!             /*
              // clean up previous filelist
              $this->filelist_dirs = array();
              $this->filelist_dirs_roles = array();
              $this->execRoleFilelist($this->package["release"]["filelist"]);
!         }*/
          
          switch($this->action) {
***************
*** 259,390 ****
      }
      
-     function execRoleFilelist($filelist, $role = null)
-     {
-         if(!is_array($filelist) || !count($filelist)){
-             $this->log .= "No files.\n";
-             return false;
-         } else {
-             // path of previous dir
-             $path_prev = '';
-             if(isset($filelist['@']['baseinstalldir'])){
-                 $path_prev = $filelist['@']['baseinstalldir'];
-             }
-             if(isset($filelist['@']['name']) && $filelist['@']['name'] != '/' && $filelist['@']['name'] != '\\'){
-                 $path_prev .= DIRECTORY_SEPARATOR.$filelist['@']['name'];
-             }
-             foreach($filelist as $type => $items){
-                 switch($type){
-                     case 'dir':
-                         foreach($items as $dir){
-                             $path = '';
-                             $path = null;
-                             $role = null;
-                             
-                             if(isset($dir['@']['baseinstalldir'])){
-                                 $path = $dir['@']['baseinstalldir'];
-                             }
-                             if(isset($dir['@']['name']) && $dir['@']['name'] != '/' && $dir['@']['name'] != '\\'){
-                                 $path .= DIRECTORY_SEPARATOR.$dir['@']['name'];
-                             }
-                             
-                             if(isset($dir['@']['role'])){
-                                 $role = $dir['@']['role'];
-                             }
-                             
-                             $this->updateDirsStack($path_prev);
-                             array_push($this->filelist_dirs, $path);
-                             
-                             $this->execRoleFilelist($dir, $role);
-                         }
-                     break;
-                     case 'file':
-                         $this->updateDirsStack($path_prev);
-                         $dir_path = '';
-                         if(count($this->filelist_dirs)){
-                             $dir_path = ZZOSS_InstallerUtils::fixPath(implode(DIRECTORY_SEPARATOR,$this->filelist_dirs));
-                             //echo "Path: $dir_path <br/>";
-                         }
-                         
-                         foreach($items as $key => $file) {
-                             if(!is_array($file)){
-                                 $this->file["@"]["name"] = $file;
-                                 if(!is_null($role)){
-                                     $this->file["@"]["role"] = $role;
-                                 }
-                             } else {
-                                 $this->file = $file;
-                             }
-                             
-                             if(!isset($this->file["@"]["name"])){
-                                 $this->file["@"]["name"] = $this->file["#"];
-                             }
-                             
-                             if(isset($this->file["@"]["baseinstalldir"])){
-                                 $this->file_baseinstalldir[$this->file["@"]["name"]] = $dir_path.$this->file["@"]["baseinstalldir"];
-                             } else {
-                                 $this->file_baseinstalldir[$this->file["@"]["name"]] = $dir_path;
-                             }
-                             
-                             if(!isset($this->file["@"]["role"])){
-                                 // check if we have a role association defined by the directory
-                                 if(!is_null($role)){
-                                     $this->file["@"]["role"] = $role;
-                                 } else {
-                                     $this->file["@"]["role"] = '';
-                                 }
-                             }
-                             
-                             //echo "Filename: {$this->file["@"]["name"]} <br/>";
-                             //echo "Role: {$this->file["@"]["role"]} <br/>";
-                             //echo "Path: {$this->file_baseinstalldir[$this->file["@"]["name"]]}".DIRECTORY_SEPARATOR."{$this->file["@"]["name"]} <br/>";
-                             
-                             // execute plugins
-                             $this->log .= "* Dealing with role '".$this->file["@"]["role"]."'\n";
-                             //$this->log .= "  performing on '".var_export($this->plugins['role']['role'], true)."'\n";
-                             if(!isset($this->plugins['role']['role'][$this->file["@"]["role"]])){
-                                 $this->execPluginRole();
-                             } else {
-                                 if(!$this->includePlugins($this->plugins['role']['role'][$this->file["@"]["role"]])){
-                                     $this->log .= "* ERROR: A handler for this role does not exist.\n";
-                                 }
-                             }
-                         }
-                     break;
-                 }
-             }
-         }
-         
-         return true;
-     }
-     
-     function updateDirsStack($path_prev)
-     {
-         // if the current dir is within previous dirs, we truncate the array,
-         // but only if the current directory is not the last one in our stack
-         if(strlen($path_prev) && end($this->filelist_dirs) != $path_prev){
-             //reset($this->fielist_dirs);
-             $filelist_dirs = array();
-             /*
-             echo '<pre>1';
-             print_r($this->filelist_dirs);
-             echo '</pre>';
-             */
-             // rearrange the array with values only until we hit
-             // the current directory
-             foreach($this->filelist_dirs as $filelist_dir){
-                 $filelist_dirs[] = $filelist_dir;
-                 if($filelist_dir == $path_prev){
-                     break;
-                 }
-             }
-             /*
-             echo '<pre>2';
-             print_r($filelist_dirs);
-             echo '</pre>';
-             */
-             $this->filelist_dirs = $filelist_dirs;
-         }
-     }
-     
      function execPluginRole()
      {
--- 284,287 ----

Index: package.xml
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.plugin.lib/package.xml,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** package.xml	22 Dec 2003 17:00:44 -0000	1.1.1.1
--- package.xml	24 Apr 2004 15:36:40 -0000	1.2
***************
*** 33,36 ****
--- 33,37 ----
          <deps>
              <dep type="pkg" rel="ge" version="1.0">com.zzoss.installer.lib</dep>
+             <dep type="pkg" rel="ge" version="1.0.0">com.zzoss.package.descriptor.lib</dep>
          </deps>
      </release>



-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297