[zi-cvs] packages/com.zzoss.installer.lib Registry.php,1.21,1.22

Sandro Zic <[email protected]> Fri, 26 Mar 2004 10:15:44 +0000
Newsgroups gmane.comp.php.zzoss.installer.cvs
Message-ID <[email protected]>
Update of /cvsroot/zzossinstaller/packages/com.zzoss.installer.lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21632

Modified Files:
	Registry.php 
Log Message:
process packages/plugins only if they have been changed in sources

Index: Registry.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.installer.lib/Registry.php,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** Registry.php	25 Mar 2004 12:26:26 -0000	1.21
--- Registry.php	26 Mar 2004 10:15:42 -0000	1.22
***************
*** 1198,1212 ****
      }
      
      function installPackage($name)
      {
          $pkg_src = $this->application_path.$this->package_type.'s'.DIRECTORY_SEPARATOR.$name.DIRECTORY_SEPARATOR;
!         $pkg_installed = $this->application_path.$this->package_type.'s_installed'.DIRECTORY_SEPARATOR.$name.DIRECTORY_SEPARATOR;
  
          if(!is_dir($pkg_src)){
              return PEAR::raiseError('Internal Error: Unknow '.$this->package_type.' source path. Seems like the '.$this->package_type.' registry has not been refreshed properly.');
          }
          // Post-processing
          System::mkDir(array('-p', $pkg_installed));
!         $this->log .= '* Created directory '.$pkg_installed."\n";
          copy(
              $pkg_src.'package.xml', 
--- 1198,1221 ----
      }
      
+     function getPkgInstalledDir($name)
+     {
+         return $this->application_path.$this->package_type.'s_installed'.DIRECTORY_SEPARATOR.$name.DIRECTORY_SEPARATOR;
+     }
+     
      function installPackage($name)
      {
          $pkg_src = $this->application_path.$this->package_type.'s'.DIRECTORY_SEPARATOR.$name.DIRECTORY_SEPARATOR;
!         $pkg_installed = $this->getPkgInstalledDir($name);
  
          if(!is_dir($pkg_src)){
              return PEAR::raiseError('Internal Error: Unknow '.$this->package_type.' source path. Seems like the '.$this->package_type.' registry has not been refreshed properly.');
          }
+         if(is_dir($pkg_installed)){
+             System::rm(array('-rf', $pkg_installed));
+             $this->log .= '* Removed '.$pkg_installed."\n";
+         }
          // Post-processing
          System::mkDir(array('-p', $pkg_installed));
!         $this->log .= '* Created '.$pkg_installed."\n";
          copy(
              $pkg_src.'package.xml', 



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click