[zi-cvs] packages/com.zzoss.zic TODO,1.6,1.7 application_done.php,1.12,1.13 application_settings.php,1.11,1.12 dev_bundle.php,1.5,1.6 dev_bundle_process.php,1.1,1.2 package.xml,1.9,1.10 packages_confirm.php,1.7,1.8 packages_sources.php,1.6,1.7

Sandro Zic <[email protected]> Thu, 01 Apr 2004 18:59:08 +0000
Newsgroups gmane.comp.php.zzoss.installer.cvs
Message-ID <[email protected]>
Update of /cvsroot/zzossinstaller/packages/com.zzoss.zic
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15800/com.zzoss.zic

Modified Files:
	TODO application_done.php application_settings.php 
	dev_bundle.php dev_bundle_process.php package.xml 
	packages_confirm.php packages_sources.php 
Log Message:
better and wrapped bundle routines

Index: packages_confirm.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/packages_confirm.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** packages_confirm.php	18 Mar 2004 09:41:39 -0000	1.7
--- packages_confirm.php	1 Apr 2004 18:59:05 -0000	1.8
***************
*** 147,151 ****
          if($pkg_type == 'plugin'){
              $_REQUEST['type'] = 'package';
!             $link_next = 'packages.php'.zi_form_querystr();
          } else {
              $link_next = 'packages.php';
--- 147,151 ----
          if($pkg_type == 'plugin'){
              $_REQUEST['type'] = 'package';
!             $link_next = 'packages_reset.php'.zi_form_querystr();
          } else {
              $link_next = 'packages.php';

Index: application_settings.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/application_settings.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** application_settings.php	25 Mar 2004 00:28:27 -0000	1.11
--- application_settings.php	1 Apr 2004 18:59:05 -0000	1.12
***************
*** 203,207 ****
  	$zi_buttons['back'] = 'applications.php'.zi_form_querystr();
      if(isset($_REQUEST['dev']) && $_REQUEST['dev'] == 'bundle'){
!         $zi_buttons['next'] = 'packages_sources.php'.zi_form_querystr();
      } else {
          $zi_buttons['next'] = 'application_profile.php'.zi_form_querystr();
--- 203,207 ----
  	$zi_buttons['back'] = 'applications.php'.zi_form_querystr();
      if(isset($_REQUEST['dev']) && $_REQUEST['dev'] == 'bundle'){
!         $zi_buttons['next'] = 'packages_reset.php'.zi_form_querystr();
      } else {
          $zi_buttons['next'] = 'application_profile.php'.zi_form_querystr();

Index: packages_sources.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/packages_sources.php,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** packages_sources.php	5 Mar 2004 14:25:25 -0000	1.6
--- packages_sources.php	1 Apr 2004 18:59:05 -0000	1.7
***************
*** 173,177 ****
              } else {
                  if(isset($_REQUEST['dev']) && $_REQUEST['dev'] == 'bundle'){
!                     $zi_buttons['next'] = 'dev_bundle_process.php'.zi_form_querystr();
                  } else {
                      if($has_plugins){
--- 173,177 ----
              } else {
                  if(isset($_REQUEST['dev']) && $_REQUEST['dev'] == 'bundle'){
!                     $zi_buttons['next'] = 'dev_bundle.php'.zi_form_querystr().'&action=bundle';
                  } else {
                      if($has_plugins){

Index: package.xml
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/package.xml,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** package.xml	19 Mar 2004 12:18:16 -0000	1.9
--- package.xml	1 Apr 2004 18:59:05 -0000	1.10
***************
*** 156,158 ****
          </release>
      </changelog>
! </package>
\ No newline at end of file
--- 156,158 ----
          </release>
      </changelog>
! </package>

Index: application_done.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/application_done.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** application_done.php	19 Mar 2004 12:18:16 -0000	1.12
--- application_done.php	1 Apr 2004 18:59:05 -0000	1.13
***************
*** 27,30 ****
--- 27,37 ----
  	require_once 'inc/init.php';
  	
+     // let's see if a destination has been provided in the GUI procedure list.
+     if($zi_registry->isProcedure('_dest')){
+         header('Location: '.$zi_registry->getProcedure('_dest'));
+         exit;
+     }
+     
+     
      function zi_process()
  	{

Index: TODO
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/TODO,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** TODO	14 Jan 2004 15:41:27 -0000	1.6
--- TODO	1 Apr 2004 18:59:05 -0000	1.7
***************
*** 465,470 ****
  - make installer re-configurable (especially because of distributions.xml URL)
  
- - rename acronym from ZIC to ZZ/IC and ZZ/IS for ZZ/OSS Installer Client/Server
- 
  - danymically parse inc/config_params.php-dist, also app version from XML
  
--- 465,468 ----
***************
*** 475,478 ****
--- 473,480 ----
  - update from 1.0.1 to 1.1.0 should move plugins.reg from zic-1.0.1/installer/ to /tmp/../installer/
  
+ - ZZOSS_Package/Validate.php class for validation of package, distribution, application XML
+ 
+ - when creating package, allow to define role from drop down list plus option to edit drop-down list with new/modified roles
+ 
  ### Low Priority ###
  

Index: dev_bundle_process.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/dev_bundle_process.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** dev_bundle_process.php	22 Dec 2003 17:19:58 -0000	1.1
--- dev_bundle_process.php	1 Apr 2004 18:59:05 -0000	1.2
***************
*** 23,67 ****
      @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License
      */
- 
- 	// execute init file
- 	require_once 'inc/init.php';
- 
-     $bundle_dir = $zi_registry->getApplicationPath().'bundle'.DIRECTORY_SEPARATOR;
-     $bundle_dir_dest = 'bundles'.DIRECTORY_SEPARATOR.'dev'.DIRECTORY_SEPARATOR;
-     
-     System::mkdir(array('-p', $bundle_dir_dest));
      
!     // copy the distribution XML descriptor to the bundle directory
!     copy($zi_registry->getDistributionPath().'distribution.xml', $bundle_dir.'distribution.xml');
!     // copy the application XML descriptor to the bundle directory
!     copy($zi_registry->getApplicationPath().'application.xml', $bundle_dir.'application.xml');
!     
!     // Create the bundle.tgz
!     $distribution = $zi_registry->getDistribution();
!     $application = $zi_registry->getApplication();
!     $instant_tgz = $application['name'].'-'.$application['release']['version'].'.tgz';
!     $bundle_tgz = $distribution['name'].'.'.$application['name'].'.bundle-'.$application['release']['version'].'.tgz';
      
!     if($dp = @opendir($bundle_dir)) {
!         while (false !== ($entry = readdir($dp))) {
!             // make sure that we do not include the bundle or the instant bundle
!             if($entry != '.' && $entry != '..' && $entry != $bundle_tgz && $entry != $instant_tgz) {
!                 $tar_list[] = $entry;
!             }
          }
-         closedir($dp);
      }
-     
-     $cwd = getcwd();
-     chdir($bundle_dir);
-     $tar = new Archive_Tar($bundle_tgz);
-     $tar->create($tar_list);
-     chdir($cwd);
-     
-     // copy bundle to bundles/ directory of installer
-     copy($bundle_dir.$bundle_tgz, $bundle_dir_dest.$bundle_tgz);
-     @unlink($bundle_dir.$bundle_tgz);
-     
-     header('Location: dev_bundle.php'.zi_form_querystr());
-     exit;
  ?>
\ No newline at end of file
--- 23,105 ----
      @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License
      */
      
!     require_once 'inc/init.php';
      
!     if(isset($_REQUEST['action'])){
!         $action_redirect    = '';
!         $bundle_tgz         = '';
!         switch($_REQUEST['action']){
!             case 'bundle':
!                 $bundle_dir         = $zi_registry->getApplicationPath().'downloads'.DIRECTORY_SEPARATOR;
!                 $distri_xml         = $zi_registry->getDistributionPath().'distribution.xml';
!                 $app_xml            = $zi_registry->getApplicationPath().'application.xml';
!                 
!                 require_once 'ZZOSS_Package/Package.php';
!                 $pkg_obj = new ZZOSS_Package;
!                 $bundle_tgz = $pkg_obj->mkBundle($bundle_dir, $distri_xml, $app_xml);
!             break;
!             case 'instant':
!                 System::mkdir(array('-p', $instant_dir));
!                 
!                 $instant_name = $application['name'].'-'.$application['release']['version'];
!                 $instant_tgz = $instant_name.'.tgz';
!                 $instant_link = $instant_dir.$instant_tgz;
!                 
!                 // Grab all installer files from the various installer directories.
!                  /*
!                 echo '<pre>';
!                 print_r($dir_map);
!                 echo '</pre>';
!                 */
!                 $filter_dirs = array('CVS', 'bundles');
!                 // TODO: .bak
!                 $filter_files = '/[~#]$/i';
!                 
!                 // Create tar file list.
!                 require_once 'ZZOSS_File/Find.php';
!                 $zi_filefind = new ZZOSS_FileFind;
!                 $zi_filefind->setFilterDirs($filter_dirs);
!                 $zi_filefind->setFilterFiles($filter_files);
!                 $tar_list = $zi_filefind->listFiles('.');
!                 /*
!                 echo '<pre>';
!                 print_r($tar_list);
!                 echo '</pre>';
!                 */
!                 $tar = new Archive_Tar($instant_tgz);
!                 //$tar->setErrorHandling(PEAR_ERROR_PRINT);
!                 $tar->createModify($tar_list, $instant_name.'/installer/');
!                 // WORKAROUND: Did not manage to have Archive_Tar add
!                 // the bundle file from bundles/dev/, so we copy
!                 // it to bundle/ and take care that we do not
!                 // overwrite a production bundle with the same name.
!                 if(file_exists($bundle_dir_prod.$bundle_tgz)){
!                     copy($bundle_dir_prod.$bundle_tgz, $bundle_dir_prod.$bundle_tgz.'.bak');
!                     $undo_backup = true;
!                 }
!                 
!                 copy($bundle_dir_dev.$bundle_tgz, $bundle_dir_prod.$bundle_tgz);
!                 
!                 $tar->addModify('bundles'.DIRECTORY_SEPARATOR.$bundle_tgz, $instant_name.'/installer');
!                 
!                 if($undo_backup){
!                     copy($bundle_dir_prod.$bundle_tgz.'.bak', $bundle_dir_prod.$bundle_tgz);
!                     unlink($bundle_dir_prod.$bundle_tgz.'.bak');
!                     $backup = true;
!                 }
!                 
!                 unlink($bundle_dir_prod.$bundle_tgz);
!                 copy($instant_tgz, $instant_link);
!                 unlink($instant_tgz);
!             break;
!         }
!         if(strlen($bundle_tgz)){
!             require_once 'HTTP/Download.php';
!             $dl = &new HTTP_Download();
!             $dl->setFile($bundle_tgz);
!             $dl->setContentDisposition(HTTP_DOWNLOAD_ATTACHMENT, basename($bundle_tgz));
!             $dl->setContentType('application/octet-stream');
!             $dl->send();
          }
      }
  ?>
\ No newline at end of file

Index: dev_bundle.php
===================================================================
RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/dev_bundle.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** dev_bundle.php	18 Mar 2004 09:41:39 -0000	1.5
--- dev_bundle.php	1 Apr 2004 18:59:05 -0000	1.6
***************
*** 26,98 ****
  	require_once 'inc/init.php';
      
-     $distribution = $zi_registry->getDistribution();
-     $application = $zi_registry->getApplication();
-     $bundle_dir_prod = 'bundles'.DIRECTORY_SEPARATOR;
-     $bundle_dir_dev = $bundle_dir_prod.'dev'.DIRECTORY_SEPARATOR;
-     $bundle_tgz = $distribution['name'].'.'.$application['name'].'.bundle-'.$application['release']['version'].'.tgz';
-     $bundle_link = $bundle_dir_dev.$bundle_tgz;
-     $instant_dir = $bundle_dir_dev.'instant'.DIRECTORY_SEPARATOR.$distribution['name'].'-'.$distribution['release']['version'].DIRECTORY_SEPARATOR;
-     
      if(isset($_REQUEST['action'])){
          switch($_REQUEST['action']){
              case 'bundle':
!                 $msg = '<p><span class="label">Download Bundle: </span><a href="'.$bundle_link.'">'.$bundle_tgz.'</a></p>';
!                 break;
              case 'instant':
!                 System::mkdir(array('-p', $instant_dir));
!                 
!                 $instant_name = $application['name'].'-'.$application['release']['version'];
!                 $instant_tgz = $instant_name.'.tgz';
!                 $instant_link = $instant_dir.$instant_tgz;
!                 
!                 // Grab all installer files from the various installer directories.
!                  /*
!                 echo '<pre>';
!                 print_r($dir_map);
!                 echo '</pre>';
!                 */
!                 $filter_dirs = array('CVS', 'bundles');
!                 // TODO: .bak
!                 $filter_files = '/[~#]$/i';
!                 
!                 // Create tar file list.
!                 require_once 'ZZOSS_File/Find.php';
!                 $zi_filefind = new ZZOSS_FileFind;
!                 $zi_filefind->setFilterDirs($filter_dirs);
!                 $zi_filefind->setFilterFiles($filter_files);
!                 $tar_list = $zi_filefind->listFiles('.');
!                 /*
!                 echo '<pre>';
!                 print_r($tar_list);
!                 echo '</pre>';
!                 */
!                 $tar = new Archive_Tar($instant_tgz);
!                 //$tar->setErrorHandling(PEAR_ERROR_PRINT);
!                 $tar->createModify($tar_list, $instant_name.'/installer/');
!                 // WORKAROUND: Did not manage to have Archive_Tar add
!                 // the bundle file from bundles/dev/, so we copy
!                 // it to bundle/ and take care that we do not
!                 // overwrite a production bundle with the same name.
!                 if(file_exists($bundle_dir_prod.$bundle_tgz)){
!                     copy($bundle_dir_prod.$bundle_tgz, $bundle_dir_prod.$bundle_tgz.'.bak');
!                     $undo_backup = true;
!                 }
!                 
!                 copy($bundle_dir_dev.$bundle_tgz, $bundle_dir_prod.$bundle_tgz);
!                 
!                 $tar->addModify('bundles'.DIRECTORY_SEPARATOR.$bundle_tgz, $instant_name.'/installer');
!                 
!                 if($undo_backup){
!                     copy($bundle_dir_prod.$bundle_tgz.'.bak', $bundle_dir_prod.$bundle_tgz);
!                     unlink($bundle_dir_prod.$bundle_tgz.'.bak');
!                     $backup = true;
!                 }
!                 
!                 unlink($bundle_dir_prod.$bundle_tgz);
!                 copy($instant_tgz, $instant_link);
!                 unlink($instant_tgz);
!                 
!                 $msg = '<p><span class="label">Download Instant Bundle: </span><a href="'.$instant_link.'">'.$instant_tgz.'</a></p>';
!                 break;
          }
      }
--- 26,55 ----
  	require_once 'inc/init.php';
      
      if(isset($_REQUEST['action'])){
+         $action_redirect    = '';
+         $bundle_tgz         = '';
          switch($_REQUEST['action']){
              case 'bundle':
!                 $procedures = array(
!                     'plugins_register'  => 'hide',
!                     'packages_register' => 'hide',
!                     '_dest'         => 'dev_bundle_process.php'.zi_form_querystr().'&action=bundle'
!                     );
!                 $zi_registry->setProcedures($procedures);
!                 $action_redirect = 'packages_reset.php'.zi_form_querystr().'&type=plugin';
!             break;
              case 'instant':
!                 $procedures = array(
!                     'plugins_register'  => 'hide',
!                     'packages_register' => 'hide',
!                     '_dest'         => 'dev_bundle_process.php'.zi_form_querystr().'&action=instant'
!                     );
!                 $zi_registry->setProcedures($procedures);
!                 $action_redirect = 'packages_reset.php'.zi_form_querystr().'&type=plugin';
!             break;
!         }
!         if(strlen($action_redirect)){
!             header('Location: '.$action_redirect);
!             exit;
          }
      }
***************
*** 103,106 ****
--- 60,65 ----
      
      include 'themes/'.$GLOBALS['ZI']['theme'].'/header.php';
+     
+     $application = $zi_registry->getApplication();
      ?>
      <h1>Application Bundle</h1>
***************
*** 114,136 ****
      
      <p>
!         [<a href="application_settings.php<?php echo zi_form_querystr().'&dev=bundle'; ?>">New Bundle</a>]<br/>
!         Create a new bundle (deletes the old one).
      </p>
      <?php
-     if(file_exists($bundle_dir_dev.$bundle_tgz)){
-         ?>
-         <p>
-             [<a href="<?php echo $_SERVER['PHP_SELF'].zi_form_querystr(); ?>&action=bundle">Download Bundle</a>]<br/>
-             Download the bundle.
-         </p>
-         <p>
-             [<a href="dev_bundle_instant.php<?php echo zi_form_querystr(); ?>&action=instant">Download Instant Bundle</a>]<br/>
-             Make the bundle installable with the installer. An instant bundle contains the application 
-             packages and XML descriptors as well as a snapshot of the installer.<br/>
-             
-         </p>
-         <?php
-     }
-     
      //$zi_buttons['back'] = 'applications.php'.zi_form_querystr();
  	include 'themes/'.$GLOBALS['ZI']['theme'].'/footer.php';
--- 73,85 ----
      
      <p>
!         [<a href="<?php echo $_SERVER['PHP_SELF'].zi_form_querystr().'&action=bundle'; ?>">Bundle</a>]<br/>
!         Create a new bundle. Such a bundle can be used for installation or update of an application within an installer.
!     </p>
!     <p>
!         [<a href="<?php echo $_SERVER['PHP_SELF'].zi_form_querystr().'&action=instant'; ?>">Instant Bundle</a>]<br/>
!         An instant bundle contains the application as well as the installer.<br/>
!         
      </p>
      <?php
      //$zi_buttons['back'] = 'applications.php'.zi_form_querystr();
  	include 'themes/'.$GLOBALS['ZI']['theme'].'/footer.php';



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