[zi-cvs] packages/com.zzoss.plugin.lib Plugin.php,1.11,1.12

Sandro Zic <[email protected]> Fri, 26 Mar 2004 10:16:10 +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-serv21734

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

Index: Plugin.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.plugin.lib/Plugin.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** Plugin.php	25 Mar 2004 01:02:30 -0000	1.11
--- Plugin.php	26 Mar 2004 10:16:07 -0000	1.12
***************
*** 216,219 ****
--- 216,234 ----
          //return true;
          */
+         
+         // Upon install or update, we check if the src package is newer then
+         // the installed package, only then we perform the filerole routines
+         $pkg_installed_dir = $this->registry->getPkgInstalledDir($this->package["name"].'-'.$this->package["release"]["version"]);
+         //$this->log .= "Check if $pkg_installed_dir exists.\n";
+         if(is_dir($pkg_installed_dir)){
+             $pkg_src_dir = ZZOSS_InstallerUtils::fixPath($this->package["install"]["path"].DIRECTORY_SEPARATOR);
+             //$this->log .= "Check if $pkg_src_dir is newer then $pkg_installed_dir.\n";
+             if(filemtime($pkg_src_dir) < filemtime($pkg_installed_dir)){
+                 $this->log .= "Package has not changed since last installation.\n";
+                 return true;
+             }
+         }
+         
+         
          //$this->log .= 'Files: '.var_export($files, true);
          if(isset($this->package["release"]["filelist"])){
***************
*** 224,229 ****
          }
          
-         $packages_installed_dir = $this->registry->getApplicationPath().'packages_installed'.DIRECTORY_SEPARATOR.$this->package["name"].'-'.$this->package["release"]["version"].DIRECTORY_SEPARATOR;
-         
          switch($this->action) {
              case 'install':
--- 239,242 ----



-------------------------------------------------------
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