zzossinstaller-cvs Mailing List for ZZ/OSS Installer (Page 3)
Status: Beta
Brought to you by:
czonsius
You can subscribe to this list here.
2004 |
Jan
(97) |
Feb
(24) |
Mar
(84) |
Apr
(110) |
May
(56) |
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
From: Sandro Z. <or...@us...> - 2004-05-11 12:44:38
|
Update of /cvsroot/zzossinstaller/packages/com.zzoss.zic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16345 Modified Files: package.xml Log Message: deleted download.php Index: package.xml =================================================================== RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/package.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** package.xml 14 Apr 2004 11:13:49 -0000 1.13 --- package.xml 11 May 2004 12:44:28 -0000 1.14 *************** *** 71,75 **** <file role="php" baseinstalldir="" name="dev_reset_data.php"/> <file role="php" baseinstalldir="" name="distribution_download.php"/> ! <file role="php" baseinstalldir="" name="download.php"/> <file role="php" baseinstalldir="" name="help.php"/> <file role="php" baseinstalldir="" name="index.php"/> --- 71,75 ---- <file role="php" baseinstalldir="" name="dev_reset_data.php"/> <file role="php" baseinstalldir="" name="distribution_download.php"/> ! <!--<file role="php" baseinstalldir="" name="download.php"/>--> <file role="php" baseinstalldir="" name="help.php"/> <file role="php" baseinstalldir="" name="index.php"/> |
From: Sandro Z. <or...@us...> - 2004-05-06 12:34:27
|
Update of /cvsroot/zzossinstaller/packages/com.zzoss.zic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15026/com.zzoss.zic Modified Files: applications_download.php distribution_download.php info.php info_changelog.php packages_download.php packages_reset.php Log Message: use com.zzoss.portlet.progress.lib instead of com.zzoss.html.progress.lib Index: packages_reset.php =================================================================== RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/packages_reset.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** packages_reset.php 5 Apr 2004 06:49:42 -0000 1.9 --- packages_reset.php 6 May 2004 12:34:19 -0000 1.10 *************** *** 1,3 **** ! <?php /* Copyright (C) 2001-2004 ZZOSS GbR, http://www.zzoss.com --- 1,3 ---- ! <?php /* Copyright (C) 2001-2004 ZZOSS GbR, http://www.zzoss.com *************** *** 17,21 **** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ! /** @version $Id$ --- 17,21 ---- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ! /** @version $Id$ *************** *** 26,41 **** // execute init file require_once 'inc/init.php'; ! $pkg_type = 'package'; if(isset($_REQUEST['type'])){ $pkg_type = $_REQUEST['type']; } ! $remove_installed_pkgs = true; $remove_plugins = true; $buffer_output = false; ! $application = $zi_registry->getApplication(); ! require_once 'ZZOSS_Config/Config.php'; $application = ZZOSS_Config::prepareNumeric($application, array($pkg_type)); --- 26,41 ---- // execute init file require_once 'inc/init.php'; ! $pkg_type = 'package'; if(isset($_REQUEST['type'])){ $pkg_type = $_REQUEST['type']; } ! $remove_installed_pkgs = true; $remove_plugins = true; $buffer_output = false; ! $application = $zi_registry->getApplication(); ! require_once 'ZZOSS_Config/Config.php'; $application = ZZOSS_Config::prepareNumeric($application, array($pkg_type)); *************** *** 46,50 **** !isset($application['release'][$pkg_type.'s'][$pkg_type]) ){ ! if(isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'dev'){ $url_next = 'packages.php'.zi_form_querystr(); --- 46,50 ---- !isset($application['release'][$pkg_type.'s'][$pkg_type]) ){ ! if(isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'dev'){ $url_next = 'packages.php'.zi_form_querystr(); *************** *** 56,60 **** exit; } ! // check if this script is part of installation procedure if(/*isset($_REQUEST['mode']) && ($_REQUEST['mode'] == 'dev' || $_REQUEST['mode'] == 'instant') && */!$zi_registry->isProcedure($pkg_type.'s_register')){ --- 56,60 ---- exit; } ! // check if this script is part of installation procedure if(/*isset($_REQUEST['mode']) && ($_REQUEST['mode'] == 'dev' || $_REQUEST['mode'] == 'instant') && */!$zi_registry->isProcedure($pkg_type.'s_register')){ *************** *** 75,105 **** } } ! function zi_default() { global $zi_registry; ! $regfile = $zi_registry->getApplicationPath().'installer'.DIRECTORY_SEPARATOR.'bundle_downloads.reg'; $_REQUEST['ZI_VALUES'] = ZZOSS_InstallerUtils::unserializeFromFile($regfile); ! return $_REQUEST; } ! /*************************************************************************** ! * PAGE CONTENT * ***************************************************************************/ ! $is_popup = false; $widget_type = ''; ! if(isset($_REQUEST['widget_type']) && $_REQUEST['widget_type'] == 'popup'){ $is_popup = true; $widget_type = '_popup'; } ! if($buffer_output){ ob_start(); } ! include 'themes/'.$GLOBALS['ZI']['theme'].'/header'.$widget_type.'.php'; ?> --- 75,105 ---- } } ! function zi_default() { global $zi_registry; ! $regfile = $zi_registry->getApplicationPath().'installer'.DIRECTORY_SEPARATOR.'bundle_downloads.reg'; $_REQUEST['ZI_VALUES'] = ZZOSS_InstallerUtils::unserializeFromFile($regfile); ! return $_REQUEST; } ! /*************************************************************************** ! * PAGE CONTENT * ***************************************************************************/ ! $is_popup = false; $widget_type = ''; ! if(isset($_REQUEST['widget_type']) && $_REQUEST['widget_type'] == 'popup'){ $is_popup = true; $widget_type = '_popup'; } ! if($buffer_output){ ob_start(); } ! include 'themes/'.$GLOBALS['ZI']['theme'].'/header'.$widget_type.'.php'; ?> *************** *** 109,119 **** <?php $zi_registry->setPackageType($pkg_type); ! $packages = array(); ! if(isset($application['release'][$pkg_type.'s'][$pkg_type])){ $packages = $application['release'][$pkg_type.'s'][$pkg_type]; } ! if(!count($packages)){ ?> --- 109,119 ---- <?php $zi_registry->setPackageType($pkg_type); ! $packages = array(); ! if(isset($application['release'][$pkg_type.'s'][$pkg_type])){ $packages = $application['release'][$pkg_type.'s'][$pkg_type]; } ! if(!count($packages)){ ?> *************** *** 130,134 **** System::mkdir(array('-p', $bundle_dir)); } ! if($remove_installed_pkgs){ // Remove previously installed packages and their registries --- 130,134 ---- System::mkdir(array('-p', $bundle_dir)); } ! if($remove_installed_pkgs){ // Remove previously installed packages and their registries *************** *** 141,144 **** --- 141,147 ---- $zi_registry->unsetPackages(); + // unset dependencies queue + $zi_registry->unsetPackagesQueue(); + if($pkg_type == 'plugin'){ $dir_plugins_re = $zi_registry->getApplicationPath().'plugins_re'; *************** *** 147,162 **** System::mkDir($dir_plugins_re); } ! $zi_registry->unsetPlugins(); } ! ?> <h2>Installed <?php echo ucfirst($pkg_type); ?>s</h2> <div class="warning">Removed installed <?php echo ucfirst($pkg_type); ?>s.</div> <?php ! $app_settings = $zi_registry->getApplicationSettings(); $log = array(); ! require_once 'ZZOSS_Package/Package.php'; $pkg_obj = new ZZOSS_Package; --- 150,165 ---- System::mkDir($dir_plugins_re); } ! $zi_registry->unsetPlugins(); } ! ?> <h2>Installed <?php echo ucfirst($pkg_type); ?>s</h2> <div class="warning">Removed installed <?php echo ucfirst($pkg_type); ?>s.</div> <?php ! $app_settings = $zi_registry->getApplicationSettings(); $log = array(); ! die(); require_once 'ZZOSS_Package/Package.php'; $pkg_obj = new ZZOSS_Package; *************** *** 172,178 **** ?> <h2>Local <?php echo ucfirst($pkg_type); ?>s</h2> ! <div class="warning">Rebuilt <?php echo ucfirst($pkg_type); ?>s from sources.</div> ! <textarea cols="60" rows="20" wrap="off"><?php echo $log; --- 175,181 ---- ?> <h2>Local <?php echo ucfirst($pkg_type); ?>s</h2> ! <div class="warning">Rebuilt <?php echo ucfirst($pkg_type); ?>s from sources.</div> ! <textarea cols="60" rows="20" wrap="off"><?php echo $log; *************** *** 181,185 **** $zi_registry->registerPackages(); } ! // If the package is not available locally, download it from the // location specified in the packages.xml. --- 184,188 ---- $zi_registry->registerPackages(); } ! // If the package is not available locally, download it from the // location specified in the packages.xml. *************** *** 221,225 **** } include 'themes/'.$GLOBALS['ZI']['theme'].'/footer'.$widget_type.'.php'; ! if(!$is_popup && $buffer_output){ ob_end_clean(); --- 224,228 ---- } include 'themes/'.$GLOBALS['ZI']['theme'].'/footer'.$widget_type.'.php'; ! if(!$is_popup && $buffer_output){ ob_end_clean(); Index: applications_download.php =================================================================== RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/applications_download.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** applications_download.php 7 Apr 2004 11:05:14 -0000 1.7 --- applications_download.php 6 May 2004 12:34:18 -0000 1.8 *************** *** 1,3 **** ! <?php /* Copyright (C) 2001-2004 ZZOSS GbR, http://www.zzoss.com --- 1,3 ---- ! <?php /* Copyright (C) 2001-2004 ZZOSS GbR, http://www.zzoss.com *************** *** 17,21 **** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ! /** @version $Id$ --- 17,21 ---- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ! /** @version $Id$ *************** *** 23,51 **** @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License */ ! // execute init file require_once 'inc/init.php'; ! /*************************************************************************** ! * INSTALLER FRAMEWORK FUNCTIONS * ! ***************************************************************************/ function zi_process() { global $zi_registry; ! if(!is_array($_REQUEST["ZI_VALUES"]["application"]) || !count($_REQUEST["ZI_VALUES"]["application"])){ return false; } ! $zi_registry->setDir($GLOBALS['ZI']['installer_data_dir']); ! $file = $GLOBALS['ZI']['installer_data_dir'].'installer'.DIRECTORY_SEPARATOR.'remote_distribution.xml'; $distribution_xml = new ZZOSS_Config(); $distribution_xml->setFile($file); $distribution = $distribution_xml->query('/distribution'); ! $zi_registry->initDistribution($distribution['name'].'-'.$distribution['release']['version']); ! // download application.xml $file = $GLOBALS['ZI']['installer_data_dir'].'installer'.DIRECTORY_SEPARATOR.'remote_applications.xml'; --- 23,51 ---- @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License */ ! // execute init file require_once 'inc/init.php'; ! /*************************************************************************** ! * INSTALLER FRAMEWORK FUNCTIONS * ! ***************************************************************************/ function zi_process() { global $zi_registry; ! if(!is_array($_REQUEST["ZI_VALUES"]["application"]) || !count($_REQUEST["ZI_VALUES"]["application"])){ return false; } ! $zi_registry->setDir($GLOBALS['ZI']['installer_data_dir']); ! $file = $GLOBALS['ZI']['installer_data_dir'].'installer'.DIRECTORY_SEPARATOR.'remote_distribution.xml'; $distribution_xml = new ZZOSS_Config(); $distribution_xml->setFile($file); $distribution = $distribution_xml->query('/distribution'); ! $zi_registry->initDistribution($distribution['name'].'-'.$distribution['release']['version']); ! // download application.xml $file = $GLOBALS['ZI']['installer_data_dir'].'installer'.DIRECTORY_SEPARATOR.'remote_applications.xml'; *************** *** 53,60 **** $remote_applications_xml->setFile($file); $remote_applications = $remote_applications_xml->query('/applications/application'); ! foreach($_REQUEST["ZI_VALUES"]["application"] as $app_selected){ $remote_application = $remote_applications[$app_selected]; ! //$distribution_dir = $GLOBALS['ZI']['installer_data_dir'].'distributions/'.$distribution["name"].'-'.$distribution["release"]["version"].'/'; // create directories for distribution if not exists --- 53,60 ---- $remote_applications_xml->setFile($file); $remote_applications = $remote_applications_xml->query('/applications/application'); ! foreach($_REQUEST["ZI_VALUES"]["application"] as $app_selected){ $remote_application = $remote_applications[$app_selected]; ! //$distribution_dir = $GLOBALS['ZI']['installer_data_dir'].'distributions/'.$distribution["name"].'-'.$distribution["release"]["version"].'/'; // create directories for distribution if not exists *************** *** 66,72 **** */ $zi_registry->initApplication($remote_application["name"].'-'.$remote_application["release"]["version"]); ! //$application_dir = $distribution_dir.'applications/'.$remote_application["name"].'-'.$remote_application["release"]["version"].'/'; ! // copy distribution.xml $file_src = $GLOBALS['ZI']['installer_data_dir'].'installer'.DIRECTORY_SEPARATOR.'remote_distribution.xml'; --- 66,72 ---- */ $zi_registry->initApplication($remote_application["name"].'-'.$remote_application["release"]["version"]); ! //$application_dir = $distribution_dir.'applications/'.$remote_application["name"].'-'.$remote_application["release"]["version"].'/'; ! // copy distribution.xml $file_src = $GLOBALS['ZI']['installer_data_dir'].'installer'.DIRECTORY_SEPARATOR.'remote_distribution.xml'; *************** *** 88,92 **** $file_application = $zi_registry->getApplicationPath().'application.xml'; $file_packages = $zi_registry->getApplicationPath().'installer'.DIRECTORY_SEPARATOR.'remote_packages.xml'; ! // download application.xml and packages.xml if(is_array($remote_application["filelist"]["descriptor"])) { --- 88,92 ---- $file_application = $zi_registry->getApplicationPath().'application.xml'; $file_packages = $zi_registry->getApplicationPath().'installer'.DIRECTORY_SEPARATOR.'remote_packages.xml'; ! // download application.xml and packages.xml if(is_array($remote_application["filelist"]["descriptor"])) { *************** *** 103,125 **** } } ! // set rebuild applications flag $fp = fopen($GLOBALS['ZI']['installer_data_dir']."installer".DIRECTORY_SEPARATOR."distributions.lock","w"); fputs($fp,'dummy'); fclose($fp); ! // set rebuild applications flag $fp = fopen($zi_registry->getDistributionPath()."installer".DIRECTORY_SEPARATOR."applications.lock","w"); fputs($fp,'dummy'); fclose($fp); ! @unlink($GLOBALS['ZI']['installer_data_dir']."installer".DIRECTORY_SEPARATOR."distributions.reg"); ! $_REQUEST["ZI_LOCATION_NEXT"] = 'applications.php'; } ! /*************************************************************************** ! * STARTUP * ! ***************************************************************************/ $file = $GLOBALS['ZI']['installer_data_dir'].'installer'.DIRECTORY_SEPARATOR.'remote_distribution.xml'; --- 103,125 ---- } } ! // set rebuild applications flag $fp = fopen($GLOBALS['ZI']['installer_data_dir']."installer".DIRECTORY_SEPARATOR."distributions.lock","w"); fputs($fp,'dummy'); fclose($fp); ! // set rebuild applications flag $fp = fopen($zi_registry->getDistributionPath()."installer".DIRECTORY_SEPARATOR."applications.lock","w"); fputs($fp,'dummy'); fclose($fp); ! @unlink($GLOBALS['ZI']['installer_data_dir']."installer".DIRECTORY_SEPARATOR."distributions.reg"); ! $_REQUEST["ZI_LOCATION_NEXT"] = 'applications.php'; } ! /*************************************************************************** ! * STARTUP * ! ***************************************************************************/ $file = $GLOBALS['ZI']['installer_data_dir'].'installer'.DIRECTORY_SEPARATOR.'remote_distribution.xml'; *************** *** 127,134 **** $distribution_xml->setFile($file); $distribution = $distribution_xml->query('/distribution'); ! ! /*************************************************************************** ! * PAGE CONTENT * ! ***************************************************************************/ include 'themes/'.$GLOBALS['ZI']['theme'].'/header.php'; --- 127,134 ---- $distribution_xml->setFile($file); $distribution = $distribution_xml->query('/distribution'); ! ! /*************************************************************************** ! * PAGE CONTENT * ! ***************************************************************************/ include 'themes/'.$GLOBALS['ZI']['theme'].'/header.php'; *************** *** 137,152 **** <?php $file = $GLOBALS['ZI']['installer_data_dir'].'installer'.DIRECTORY_SEPARATOR.'remote_applications.xml'; ! $items = array('Applications XML'); $label = 'Downloading'; ! ! require_once 'ZZOSS_Html/Progress.php'; ! $bar = new ZZOSS_HtmlProgress(); $bar->prepareListHorizontal($items, 'Downloading'); ! require_once 'ZZOSS_File/Download.php'; $download = new ZZOSS_FileDownload(); $download->setCallback(array(&$bar, '_downloadCallback')); ! $download->download($distribution["filelist"]["descriptor"]["#"], $file); ?> --- 137,152 ---- <?php $file = $GLOBALS['ZI']['installer_data_dir'].'installer'.DIRECTORY_SEPARATOR.'remote_applications.xml'; ! $items = array('Applications XML'); $label = 'Downloading'; ! ! require_once 'ZZOSS_Portlet/Progress.php'; ! $bar = new ZZOSS_PortletProgress(); $bar->prepareListHorizontal($items, 'Downloading'); ! require_once 'ZZOSS_File/Download.php'; $download = new ZZOSS_FileDownload(); $download->setCallback(array(&$bar, '_downloadCallback')); ! $download->download($distribution["filelist"]["descriptor"]["#"], $file); ?> Index: info_changelog.php =================================================================== RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/info_changelog.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** info_changelog.php 4 Apr 2004 15:53:41 -0000 1.8 --- info_changelog.php 6 May 2004 12:34:19 -0000 1.9 *************** *** 1,3 **** ! <?php /* Copyright (C) 2001-2004 ZZOSS GbR, http://www.zzoss.com --- 1,3 ---- ! <?php /* Copyright (C) 2001-2004 ZZOSS GbR, http://www.zzoss.com *************** *** 17,21 **** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ! /** @version $Id$ --- 17,21 ---- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ! /** @version $Id$ *************** *** 23,39 **** @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License */ ! // execute init file require_once 'inc/init.php'; include 'inc/info.php'; ! ! /*************************************************************************** ! * PAGE CONTENT * ! ***************************************************************************/ ! $zi_buttons['back'] = 'info.php'.zi_form_querystr(); ! $widget_type = '_popup'; ! if(isset($_REQUEST['widget_type'])){ if($_REQUEST['widget_type'] == '_self'){ --- 23,39 ---- @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License */ ! // execute init file require_once 'inc/init.php'; include 'inc/info.php'; ! ! /*************************************************************************** ! * PAGE CONTENT * ! ***************************************************************************/ ! $zi_buttons['back'] = 'info.php'.zi_form_querystr(); ! $widget_type = '_popup'; ! if(isset($_REQUEST['widget_type'])){ if($_REQUEST['widget_type'] == '_self'){ *************** *** 50,54 **** case 'distribution_remote': $header = 'Distribution'; ! // load selected distribution $file = $GLOBALS['ZI']['installer_data_dir'].'installer/remote_distributions.xml'; --- 50,54 ---- case 'distribution_remote': $header = 'Distribution'; ! // load selected distribution $file = $GLOBALS['ZI']['installer_data_dir'].'installer/remote_distributions.xml'; *************** *** 61,81 **** unlink($file); } ! $items = array('Distribution XML'); $label = 'Downloading'; ! ! require_once 'ZZOSS_Html/Progress.php'; ! $bar = new ZZOSS_HtmlProgress(); $bar->prepareListHorizontal($items, 'Downloading'); ! require_once 'ZZOSS_File/Download.php'; $download = new ZZOSS_FileDownload(); $download->setCallback(array(&$bar, '_downloadCallback')); ! $download->download($distribution["filelist"]["descriptor"]["#"], $file); if(file_exists($file)) { $distribution_config = new ZZOSS_Config(array('cache' => true, 'numeric' => array('release'))); ! $distribution_config->setFile($file); $info = $distribution_config->query('/distribution'); } --- 61,81 ---- unlink($file); } ! $items = array('Distribution XML'); $label = 'Downloading'; ! ! require_once 'ZZOSS_Portlet/Progress.php'; ! $bar = new ZZOSS_PortletProgress(); $bar->prepareListHorizontal($items, 'Downloading'); ! require_once 'ZZOSS_File/Download.php'; $download = new ZZOSS_FileDownload(); $download->setCallback(array(&$bar, '_downloadCallback')); ! $download->download($distribution["filelist"]["descriptor"]["#"], $file); if(file_exists($file)) { $distribution_config = new ZZOSS_Config(array('cache' => true, 'numeric' => array('release'))); ! $distribution_config->setFile($file); $info = $distribution_config->query('/distribution'); } *************** *** 93,104 **** $remote_applications = $remote_applications_xml->query('/applications/application'); $remote_application = $remote_applications[$_REQUEST["id"]]; ! $items = array('Application XML'); $label = 'Downloading'; ! ! require_once 'ZZOSS_Html/Progress.php'; ! $bar = new ZZOSS_HtmlProgress(); $bar->prepareListHorizontal($items, 'Downloading'); ! require_once 'ZZOSS_File/Download.php'; $download = new ZZOSS_FileDownload(); --- 93,104 ---- $remote_applications = $remote_applications_xml->query('/applications/application'); $remote_application = $remote_applications[$_REQUEST["id"]]; ! $items = array('Application XML'); $label = 'Downloading'; ! ! require_once 'ZZOSS_Portlet/Progress.php'; ! $bar = new ZZOSS_PortletProgress(); $bar->prepareListHorizontal($items, 'Downloading'); ! require_once 'ZZOSS_File/Download.php'; $download = new ZZOSS_FileDownload(); *************** *** 121,125 **** case 'distribution': $header = 'Distribution'; ! // load selected package $distribution = $zi_registry->getDistribution($_REQUEST["distribution"]); --- 121,125 ---- case 'distribution': $header = 'Distribution'; ! // load selected package $distribution = $zi_registry->getDistribution($_REQUEST["distribution"]); *************** *** 150,165 **** if($info["install"]["type"] == 'remote') { $zi_registry->unsetPackageRemoteInfo(); ! $items = array('Package XML'); $label = 'Downloading'; ! ! require_once 'ZZOSS_Html/Progress.php'; ! $bar = new ZZOSS_HtmlProgress(); $bar->prepareListHorizontal($items, 'Downloading'); ! require_once 'ZZOSS_File/Download.php'; $download = new ZZOSS_FileDownload(); $download->setCallback(array(&$bar, '_downloadCallback')); ! $file = $zi_registry->getApplicationPath().'installer'.DIRECTORY_SEPARATOR.'remote_package.xml'; $package = $zi_registry->getPackageById($_REQUEST['id']); --- 150,165 ---- if($info["install"]["type"] == 'remote') { $zi_registry->unsetPackageRemoteInfo(); ! $items = array('Package XML'); $label = 'Downloading'; ! ! require_once 'ZZOSS_Portlet/Progress.php'; ! $bar = new ZZOSS_PortletProgress(); $bar->prepareListHorizontal($items, 'Downloading'); ! require_once 'ZZOSS_File/Download.php'; $download = new ZZOSS_FileDownload(); $download->setCallback(array(&$bar, '_downloadCallback')); ! $file = $zi_registry->getApplicationPath().'installer'.DIRECTORY_SEPARATOR.'remote_package.xml'; $package = $zi_registry->getPackageById($_REQUEST['id']); Index: info.php =================================================================== RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/info.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** info.php 5 Apr 2004 10:17:56 -0000 1.7 --- info.php 6 May 2004 12:34:19 -0000 1.8 *************** *** 1,3 **** ! <?php /* Copyright (C) 2001-2004 ZZOSS GbR, http://www.zzoss.com --- 1,3 ---- ! <?php /* Copyright (C) 2001-2004 ZZOSS GbR, http://www.zzoss.com *************** *** 17,21 **** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ! /** @version $Id$ --- 17,21 ---- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ! /** @version $Id$ *************** *** 23,33 **** @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License */ ! // execute init file require_once 'inc/init.php'; include 'inc/info.php'; ! $widget_type = '_popup'; ! if(isset($_REQUEST['widget_type'])){ if($_REQUEST['widget_type'] == '_self'){ --- 23,33 ---- @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License */ ! // execute init file require_once 'inc/init.php'; include 'inc/info.php'; ! $widget_type = '_popup'; ! if(isset($_REQUEST['widget_type'])){ if($_REQUEST['widget_type'] == '_self'){ *************** *** 41,49 **** <h1>Information</h1> <?php ! switch($_REQUEST['type']){ case 'distribution_remote': $header = 'Distribution'; ! // load selected distribution $file = $GLOBALS['ZI']['installer_data_dir'].'installer/remote_distributions.xml'; --- 41,49 ---- <h1>Information</h1> <?php ! switch($_REQUEST['type']){ case 'distribution_remote': $header = 'Distribution'; ! // load selected distribution $file = $GLOBALS['ZI']['installer_data_dir'].'installer/remote_distributions.xml'; *************** *** 58,75 **** $items = array('Distribution XML'); $label = 'Downloading'; ! ! require_once 'ZZOSS_Html/Progress.php'; ! $bar = new ZZOSS_HtmlProgress(); $bar->prepareListHorizontal($items, 'Downloading'); ! require_once 'ZZOSS_File/Download.php'; $download = new ZZOSS_FileDownload(); $download->setCallback(array(&$bar, '_downloadCallback')); ! $download->download($distribution["filelist"]["descriptor"]["#"], $file); if(file_exists($file)) { $distribution_config = new ZZOSS_Config(array('cache' => true, 'numeric' => array('license','maintainer','holder'))); ! $distribution_config->setFile($file); $info = $distribution_config->query('/distribution'); } --- 58,75 ---- $items = array('Distribution XML'); $label = 'Downloading'; ! ! require_once 'ZZOSS_Portlet/Progress.php'; ! $bar = new ZZOSS_PortletProgress(); $bar->prepareListHorizontal($items, 'Downloading'); ! require_once 'ZZOSS_File/Download.php'; $download = new ZZOSS_FileDownload(); $download->setCallback(array(&$bar, '_downloadCallback')); ! $download->download($distribution["filelist"]["descriptor"]["#"], $file); if(file_exists($file)) { $distribution_config = new ZZOSS_Config(array('cache' => true, 'numeric' => array('license','maintainer','holder'))); ! $distribution_config->setFile($file); $info = $distribution_config->query('/distribution'); } *************** *** 77,81 **** case 'distribution': $header = 'Distribution'; ! // load selected package $distribution = $zi_registry->getDistribution($_REQUEST["distribution"]); --- 77,81 ---- case 'distribution': $header = 'Distribution'; ! // load selected package $distribution = $zi_registry->getDistribution($_REQUEST["distribution"]); *************** *** 97,112 **** $remote_applications = $remote_applications_xml->query('/applications/application'); $remote_application = $remote_applications[$_REQUEST["id"]]; ! $items = array('Application XML'); $label = 'Downloading'; ! ! require_once 'ZZOSS_Html/Progress.php'; ! $bar = new ZZOSS_HtmlProgress(); $bar->prepareListHorizontal($items, 'Downloading'); ! require_once 'ZZOSS_File/Download.php'; $download = new ZZOSS_FileDownload(); $download->setCallback(array(&$bar, '_downloadCallback')); ! // download application.xml and packages.xml if(is_array($remote_application["filelist"]["descriptor"])) { --- 97,112 ---- $remote_applications = $remote_applications_xml->query('/applications/application'); $remote_application = $remote_applications[$_REQUEST["id"]]; ! $items = array('Application XML'); $label = 'Downloading'; ! ! require_once 'ZZOSS_Portlet/Progress.php'; ! $bar = new ZZOSS_PortletProgress(); $bar->prepareListHorizontal($items, 'Downloading'); ! require_once 'ZZOSS_File/Download.php'; $download = new ZZOSS_FileDownload(); $download->setCallback(array(&$bar, '_downloadCallback')); ! // download application.xml and packages.xml if(is_array($remote_application["filelist"]["descriptor"])) { *************** *** 146,161 **** if($info["install"]["type"] == 'remote') { $zi_registry->unsetPackageRemoteInfo(); ! $items = array('Package XML'); $label = 'Downloading'; ! ! require_once 'ZZOSS_Html/Progress.php'; ! $bar = new ZZOSS_HtmlProgress(); $bar->prepareListHorizontal($items, 'Downloading'); ! require_once 'ZZOSS_File/Download.php'; $download = new ZZOSS_FileDownload(); $download->setCallback(array(&$bar, '_downloadCallback')); ! $file = $zi_registry->getApplicationPath().'installer'.DIRECTORY_SEPARATOR.'remote_package.xml'; $package = $zi_registry->getPackageById($_REQUEST['id']); --- 146,161 ---- if($info["install"]["type"] == 'remote') { $zi_registry->unsetPackageRemoteInfo(); ! $items = array('Package XML'); $label = 'Downloading'; ! ! require_once 'ZZOSS_Portlet/Progress.php'; ! $bar = new ZZOSS_PortletProgress(); $bar->prepareListHorizontal($items, 'Downloading'); ! require_once 'ZZOSS_File/Download.php'; $download = new ZZOSS_FileDownload(); $download->setCallback(array(&$bar, '_downloadCallback')); ! $file = $zi_registry->getApplicationPath().'installer'.DIRECTORY_SEPARATOR.'remote_package.xml'; $package = $zi_registry->getPackageById($_REQUEST['id']); *************** *** 167,175 **** break; } ! if(isset($info["changelog"]) && is_array($info["changelog"])) { $zi_buttons['next'] = 'info_changelog.php'.zi_form_querystr(); } ! $content = ''; // Show the installation paths if it is an installed application --- 167,175 ---- break; } ! if(isset($info["changelog"]) && is_array($info["changelog"])) { $zi_buttons['next'] = 'info_changelog.php'.zi_form_querystr(); } ! $content = ''; // Show the installation paths if it is an installed application Index: packages_download.php =================================================================== RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/packages_download.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** packages_download.php 7 Apr 2004 14:21:54 -0000 1.12 --- packages_download.php 6 May 2004 12:34:19 -0000 1.13 *************** *** 1,3 **** ! <?php /* Copyright (C) 2001-2004 ZZOSS GbR, http://www.zzoss.com --- 1,3 ---- ! <?php /* Copyright (C) 2001-2004 ZZOSS GbR, http://www.zzoss.com *************** *** 17,21 **** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ! /** @version $Id$ --- 17,21 ---- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ! /** @version $Id$ *************** *** 23,36 **** @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License */ ! // execute init file require_once 'inc/init.php'; ! function downloadPackages($packages_selection) ! { global $process; $process = false; $error = false; ! if(!is_array($packages_selection)) { $result['error'] = true; --- 23,36 ---- @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License */ ! // execute init file require_once 'inc/init.php'; ! function downloadPackages($packages_selection) ! { global $process; $process = false; $error = false; ! if(!is_array($packages_selection)) { $result['error'] = true; *************** *** 38,42 **** } else { global $zi_registry; ! $pkg_type = 'package'; if(isset($_REQUEST['type'])){ --- 38,42 ---- } else { global $zi_registry; ! $pkg_type = 'package'; if(isset($_REQUEST['type'])){ *************** *** 44,53 **** } $zi_registry->setPackageType($pkg_type); ! $items = array(); ! $packages_resolve = $zi_registry->getPackagesResolve(); $packages = $zi_registry->getPackages(); ! foreach($packages_selection as $key => $val) { $name = $packages_resolve[$key]; --- 44,53 ---- } $zi_registry->setPackageType($pkg_type); ! $items = array(); ! $packages_resolve = $zi_registry->getPackagesResolve(); $packages = $zi_registry->getPackages(); ! foreach($packages_selection as $key => $val) { $name = $packages_resolve[$key]; *************** *** 61,79 **** } } ! if(!count($items)){ $result['error'] = true; $result['log'] = 'Nothing to download'; } else { ! require_once 'ZZOSS_Html/Progress.php'; ! $bar = new ZZOSS_HtmlProgress(); $bar->prepareListHorizontal($items, 'Downloading'); ! require_once 'ZZOSS_File/Download.php'; $download = new ZZOSS_FileDownload(); $download->setCallback(array(&$bar, '_downloadCallback')); ! $log = ''; ! foreach($packages_selection as $key=>$val) { if(!$error) { --- 61,79 ---- } } ! if(!count($items)){ $result['error'] = true; $result['log'] = 'Nothing to download'; } else { ! require_once 'ZZOSS_Portlet/Progress.php'; ! $bar = new ZZOSS_PortletProgress(); $bar->prepareListHorizontal($items, 'Downloading'); ! require_once 'ZZOSS_File/Download.php'; $download = new ZZOSS_FileDownload(); $download->setCallback(array(&$bar, '_downloadCallback')); ! $log = ''; ! foreach($packages_selection as $key=>$val) { if(!$error) { *************** *** 85,91 **** $dir_downloads = $zi_registry->getApplicationPath().'downloads'.DIRECTORY_SEPARATOR; $dir_package = $dir_packages.$package['name'].'-'.$package['release']['version'].DIRECTORY_SEPARATOR; ! //print_r($package['filelist']['file']); ! $pkg_remote = NULL; if(isset($package['filelist']['file'][0]['#']) && strlen($package['filelist']['file'][0]['#'])>2) { --- 85,91 ---- $dir_downloads = $zi_registry->getApplicationPath().'downloads'.DIRECTORY_SEPARATOR; $dir_package = $dir_packages.$package['name'].'-'.$package['release']['version'].DIRECTORY_SEPARATOR; ! //print_r($package['filelist']['file']); ! $pkg_remote = NULL; if(isset($package['filelist']['file'][0]['#']) && strlen($package['filelist']['file'][0]['#'])>2) { *************** *** 98,109 **** // download archive and extract it $pkg_dl = $dir_downloads.basename($pkg_remote); ! $log .= "Downloaded remote package archive:\n".$pkg_remote."\n"; ! $download->download($pkg_remote, $pkg_dl); //$bar->executeListHorizontal(); ! $log .= $download->getLog(); ! if(file_exists($pkg_dl)) { //$log .= 'downloaded package '.$package['name'].'-'.$package['release']['version']."\n"; --- 98,109 ---- // download archive and extract it $pkg_dl = $dir_downloads.basename($pkg_remote); ! $log .= "Downloaded remote package archive:\n".$pkg_remote."\n"; ! $download->download($pkg_remote, $pkg_dl); //$bar->executeListHorizontal(); ! $log .= $download->getLog(); ! if(file_exists($pkg_dl)) { //$log .= 'downloaded package '.$package['name'].'-'.$package['release']['version']."\n"; *************** *** 117,121 **** PEAR::raiseError("No download location specified for the archive (.tgz)."); } ! $xml_dest = $dir_package.'package.xml'; $xml_dl = $dir_packages.'package.xml'; --- 117,121 ---- PEAR::raiseError("No download location specified for the archive (.tgz)."); } ! $xml_dest = $dir_package.'package.xml'; $xml_dl = $dir_packages.'package.xml'; *************** *** 127,135 **** copy($xml_dl, $xml_dest); //unlink($xml_dl); ! } //print_r($package['filelist']); if(isset($package['filelist']['descriptor']['#']) && strlen($package['filelist']['descriptor']['#'])>2) { $xml_dl = $dir_downloads.$package['name'].'-'.$package['release']['version'].'.xml'; ! // download specified remote package XML $log .= "Downloaded remote package XML:\n".$package['filelist']['descriptor']['#']."\n"; --- 127,135 ---- copy($xml_dl, $xml_dest); //unlink($xml_dl); ! } //print_r($package['filelist']); if(isset($package['filelist']['descriptor']['#']) && strlen($package['filelist']['descriptor']['#'])>2) { $xml_dl = $dir_downloads.$package['name'].'-'.$package['release']['version'].'.xml'; ! // download specified remote package XML $log .= "Downloaded remote package XML:\n".$package['filelist']['descriptor']['#']."\n"; *************** *** 144,148 **** } } ! // register new package if(file_exists($xml_dest)) { --- 144,148 ---- } } ! // register new package if(file_exists($xml_dest)) { *************** *** 153,157 **** $error = true; } ! } } --- 153,157 ---- $error = true; } ! } } *************** *** 161,172 **** } } ! return $result; } ! ! /*************************************************************************** ! * STARTUP * ! ***************************************************************************/ ! $pkg_type = 'package'; if(isset($_REQUEST['type'])){ --- 161,172 ---- } } ! return $result; } ! ! /*************************************************************************** ! * STARTUP * ! ***************************************************************************/ ! $pkg_type = 'package'; if(isset($_REQUEST['type'])){ *************** *** 174,187 **** } $zi_registry->setPackageType($pkg_type); ! // load previous selection $a = $zi_registry->getPackagesActions(); ! $packages_resolve = $zi_registry->getPackagesResolve(); $packages = $zi_registry->getPackages(); ! // check if there are packages for downlaod, otherwise we procede $has_downloads = false; ! foreach($a as $key => $val) { $name = $packages_resolve[$key]; --- 174,187 ---- } $zi_registry->setPackageType($pkg_type); ! // load previous selection $a = $zi_registry->getPackagesActions(); ! $packages_resolve = $zi_registry->getPackagesResolve(); $packages = $zi_registry->getPackages(); ! // check if there are packages for downlaod, otherwise we procede $has_downloads = false; ! foreach($a as $key => $val) { $name = $packages_resolve[$key]; *************** *** 189,193 **** if( $val=='I' && ! $package["install"]["type"] == 'remote' && !file_exists($zi_registry->getApplicationPath().'downloads'.DIRECTORY_SEPARATOR.$name.'.tgz') ) { --- 189,193 ---- if( $val=='I' && ! $package["install"]["type"] == 'remote' && !file_exists($zi_registry->getApplicationPath().'downloads'.DIRECTORY_SEPARATOR.$name.'.tgz') ) { *************** *** 196,205 **** } } ! if(!$has_downloads){ header('Location: packages_process.php'.zi_form_querystr()); exit; } ! /* echo '<h3>Actions</h3>'; --- 196,205 ---- } } ! if(!$has_downloads){ header('Location: packages_process.php'.zi_form_querystr()); exit; } ! /* echo '<h3>Actions</h3>'; *************** *** 212,222 **** // default do not process $process = false; ! ! /*************************************************************************** ! * PAGE CONTENT * ! ***************************************************************************/ ! include 'themes/'.$GLOBALS['ZI']['theme'].'/header.php'; ! $application = $zi_registry->getApplication(); ?> --- 212,222 ---- // default do not process $process = false; ! ! /*************************************************************************** ! * PAGE CONTENT * ! ***************************************************************************/ ! include 'themes/'.$GLOBALS['ZI']['theme'].'/header.php'; ! $application = $zi_registry->getApplication(); ?> *************** *** 232,236 **** <?php $zi_buttons['back'] = "packages_confirm.php".zi_form_querystr(); ! if(!$result['error']) { $zi_buttons['next'] = 'packages_dependencies.php'.zi_form_querystr(); --- 232,236 ---- <?php $zi_buttons['back'] = "packages_confirm.php".zi_form_querystr(); ! if(!$result['error']) { $zi_buttons['next'] = 'packages_dependencies.php'.zi_form_querystr(); Index: distribution_download.php =================================================================== RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/distribution_download.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** distribution_download.php 6 Apr 2004 19:51:09 -0000 1.7 --- distribution_download.php 6 May 2004 12:34:18 -0000 1.8 *************** *** 1,3 **** ! <?php /* Copyright (C) 2001-2004 ZZOSS GbR, http://www.zzoss.com --- 1,3 ---- ! <?php /* Copyright (C) 2001-2004 ZZOSS GbR, http://www.zzoss.com *************** *** 17,21 **** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ! /** @version $Id$ --- 17,21 ---- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ! /** @version $Id$ *************** *** 23,36 **** @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License */ ! // execute init file require_once 'inc/init.php'; ! /*************************************************************************** ! * INSTALLER FRAMEWORK FUNCTIONS * ! ***************************************************************************/ function zi_process() { ! // download distribution.xml $file = $GLOBALS['ZI']['installer_data_dir'].'installer'.DIRECTORY_SEPARATOR.'remote_distributions.xml'; --- 23,36 ---- @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License */ ! // execute init file require_once 'inc/init.php'; ! /*************************************************************************** ! * INSTALLER FRAMEWORK FUNCTIONS * ! ***************************************************************************/ function zi_process() { ! // download distribution.xml $file = $GLOBALS['ZI']['installer_data_dir'].'installer'.DIRECTORY_SEPARATOR.'remote_distributions.xml'; *************** *** 52,58 **** } ! /*************************************************************************** ! * PAGE CONTENT * ! ***************************************************************************/ include 'themes/'.$GLOBALS['ZI']['theme'].'/header.php'; --- 52,58 ---- } ! /*************************************************************************** ! * PAGE CONTENT * ! ***************************************************************************/ include 'themes/'.$GLOBALS['ZI']['theme'].'/header.php'; *************** *** 61,76 **** <?php $file = $GLOBALS['ZI']['installer_data_dir'].'installer'.DIRECTORY_SEPARATOR.'remote_distributions.xml'; ! $items = array('Distributions XML'); $label = 'Downloading'; ! ! require_once 'ZZOSS_Html/Progress.php'; ! $bar = new ZZOSS_HtmlProgress(); $bar->prepareListHorizontal($items, 'Downloading'); ! require_once 'ZZOSS_File/Download.php'; $download = new ZZOSS_FileDownload(); $download->setCallback(array(&$bar, '_downloadCallback')); ! $download->download($GLOBALS['ZI']['distributions_url'], $file); ?> --- 61,76 ---- <?php $file = $GLOBALS['ZI']['installer_data_dir'].'installer'.DIRECTORY_SEPARATOR.'remote_distributions.xml'; ! $items = array('Distributions XML'); $label = 'Downloading'; ! ! require_once 'ZZOSS_Portlet/Progress.php'; ! $bar = new ZZOSS_PortletProgress(); $bar->prepareListHorizontal($items, 'Downloading'); ! require_once 'ZZOSS_File/Download.php'; $download = new ZZOSS_FileDownload(); $download->setCallback(array(&$bar, '_downloadCallback')); ! $download->download($GLOBALS['ZI']['distributions_url'], $file); ?> |
From: Sandro Z. <or...@us...> - 2004-05-06 12:32:32
|
Update of /cvsroot/zzossinstaller/packages/com.zzoss.package.lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14579/com.zzoss.package.lib Modified Files: Package.php package.xml Removed Files: Dependency.php Log Message: move com.zzoss.package.lib/Dependency.php in own package com.zzoss.package.dependency.lib Index: Package.php =================================================================== RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.package.lib/Package.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Package.php 24 Apr 2004 15:34:20 -0000 1.14 --- Package.php 6 May 2004 12:32:23 -0000 1.15 *************** *** 1,3 **** ! <?php /* Copyright (C) 2001-2004 ZZOSS GbR, http://www.zzoss.com --- 1,3 ---- ! <?php /* Copyright (C) 2001-2004 ZZOSS GbR, http://www.zzoss.com *************** *** 17,21 **** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ! /** @version $Id$ --- 17,21 ---- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ! /** @version $Id$ *************** *** 32,62 **** require_once 'ZZOSS_Dir/Dir.php'; ! /** ! * This class parses the XML config file and provides the objects of the ! * XML document. ! * ! * Extends PEAR XML_Parser class. ! * ! * @version 1 ! * @author Sandro Zic <san...@zz...>; | ! */ ! class ZZOSS_Package extends PEAR { ! /** * Log information. */ var $log = ''; ! /** * Packages that could not be processed. */ var $pkgs_unprocessed = array(); ! /** * The path to the bundle tgz. */ var $_bundle_tgz = ''; ! /* * Destructor --- 32,62 ---- require_once 'ZZOSS_Dir/Dir.php'; ! /** ! * This class parses the XML config file and provides the objects of the ! * XML document. ! * ! * Extends PEAR XML_Parser class. ! * ! * @version 1 ! * @author Sandro Zic <san...@zz...>; | ! */ ! class ZZOSS_Package extends PEAR { ! /** * Log information. */ var $log = ''; ! /** * Packages that could not be processed. */ var $pkgs_unprocessed = array(); ! /** * The path to the bundle tgz. */ var $_bundle_tgz = ''; ! /* * Destructor *************** *** 70,74 **** $this->_PEAR(); } ! function extractBundles($src, $dest, $backup_dest = NULL) { --- 70,74 ---- $this->_PEAR(); } ! function extractBundles($src, $dest, $backup_dest = NULL) { *************** *** 90,103 **** closedir($dp); } ! return true; } } ! function mkBundle($dir_src, $distri_xml = null, $app_xml = null) { // reset previous bundle tgz $this->_bundle_tgz = ''; ! // if distri or app XML are not provided, we // asumme they are within the src dir --- 90,103 ---- closedir($dp); } ! return true; } } ! function mkBundle($dir_src, $distri_xml = null, $app_xml = null) { // reset previous bundle tgz $this->_bundle_tgz = ''; ! // if distri or app XML are not provided, we // asumme they are within the src dir *************** *** 108,115 **** $app_xml = $dir_src.DIRECTORY_SEPARATOR.'application.xml'; } ! // destination directory is the temp dir of the system $dir_dest = System::tmpdir().DIRECTORY_SEPARATOR; ! // check whether distribution and app XML exist if(!file_exists($distri_xml)){ --- 108,115 ---- $app_xml = $dir_src.DIRECTORY_SEPARATOR.'application.xml'; } ! // destination directory is the temp dir of the system $dir_dest = System::tmpdir().DIRECTORY_SEPARATOR; ! // check whether distribution and app XML exist if(!file_exists($distri_xml)){ *************** *** 119,128 **** return PEAR::raiseError("Distribution XML does not exist at '$app_xml'"); } ! $config = new ZZOSS_Config; $config->setFile($distri_xml); $xml = $config->query('/distribution'); $distri_name = $xml['name']; ! $config = new ZZOSS_Config; $config->setFile($app_xml); --- 119,128 ---- return PEAR::raiseError("Distribution XML does not exist at '$app_xml'"); } ! $config = new ZZOSS_Config; $config->setFile($distri_xml); $xml = $config->query('/distribution'); $distri_name = $xml['name']; ! $config = new ZZOSS_Config; $config->setFile($app_xml); *************** *** 130,149 **** $app_name = $xml['name']; $app_version = $xml['release']['version']; ! // clean up memory unset($config); unset($xml); ! //System::mkdir(array('-p', $dir_dest)); ! // copy the distribution XML descriptor to the bundle directory //copy($distri_xml, $dir_src.'distribution.xml'); // copy the application XML descriptor to the bundle directory //copy($app_xml, $dir_src.'application.xml'); ! // Create the bundle.tgz $instant_tgz = $app_name.'-'.$app_version.'.tgz'; $bundle_tgz = $distri_name.'.'.$app_name.'.bundle-'.$app_version.'.tgz'; ! if($dp = @opendir($dir_src)) { while (false !== ($entry = readdir($dp))) { --- 130,149 ---- $app_name = $xml['name']; $app_version = $xml['release']['version']; ! // clean up memory unset($config); unset($xml); ! //System::mkdir(array('-p', $dir_dest)); ! // copy the distribution XML descriptor to the bundle directory //copy($distri_xml, $dir_src.'distribution.xml'); // copy the application XML descriptor to the bundle directory //copy($app_xml, $dir_src.'application.xml'); ! // Create the bundle.tgz $instant_tgz = $app_name.'-'.$app_version.'.tgz'; $bundle_tgz = $distri_name.'.'.$app_name.'.bundle-'.$app_version.'.tgz'; ! if($dp = @opendir($dir_src)) { while (false !== ($entry = readdir($dp))) { *************** *** 155,159 **** closedir($dp); } ! $cwd = getcwd(); chdir($dir_src); --- 155,159 ---- closedir($dp); } ! $cwd = getcwd(); chdir($dir_src); *************** *** 164,182 **** $tar->addModify($distri_xml, '', dirname($distri_xml)); $tar->addModify($app_xml, '', dirname($app_xml)); ! // copy bundle to bundles/ directory of installer //copy($dir_src.$bundle_tgz, $dir_dest.$bundle_tgz); //@unlink($dir_src.$bundle_tgz); ! // We use PEAR to clean up the temporary bundle upon shutdown // with the destructor. // Notice that ZZOSS_Package extends PEAR! $this->PEAR(); ! $this->_bundle_tgz = $dir_dest.$bundle_tgz; ! return $this->_bundle_tgz; } ! function extractBundle($file, $dest, $backup_dest = NULL) { --- 164,182 ---- $tar->addModify($distri_xml, '', dirname($distri_xml)); $tar->addModify($app_xml, '', dirname($app_xml)); ! // copy bundle to bundles/ directory of installer //copy($dir_src.$bundle_tgz, $dir_dest.$bundle_tgz); //@unlink($dir_src.$bundle_tgz); ! // We use PEAR to clean up the temporary bundle upon shutdown // with the destructor. // Notice that ZZOSS_Package extends PEAR! $this->PEAR(); ! $this->_bundle_tgz = $dir_dest.$bundle_tgz; ! return $this->_bundle_tgz; } ! function extractBundle($file, $dest, $backup_dest = NULL) { *************** *** 184,188 **** if($parts["extension"] == 'tgz' || $parts["extension"]=='gz') { $tmp_src = $dest.'.tmp'.DIRECTORY_SEPARATOR; ! System::mkdir(array('-p',$tmp_src)); if(ZZOSS_PACKAGE_DEBUG){ --- 184,188 ---- if($parts["extension"] == 'tgz' || $parts["extension"]=='gz') { $tmp_src = $dest.'.tmp'.DIRECTORY_SEPARATOR; ! System::mkdir(array('-p',$tmp_src)); if(ZZOSS_PACKAGE_DEBUG){ *************** *** 197,201 **** } } ! // Try to extract the distribution if(!ZZOSS_Package::extractDistribution($tmp_src, $dest)){ --- 197,201 ---- } } ! // Try to extract the distribution if(!ZZOSS_Package::extractDistribution($tmp_src, $dest)){ *************** *** 208,212 **** } } ! if(!is_null($backup_dest)){ if(!is_dir($backup_dest)){ --- 208,212 ---- } } ! if(!is_null($backup_dest)){ if(!is_dir($backup_dest)){ *************** *** 218,232 **** } } ! function getBundleDescr($bundle_tgz, $extract_dir) { $parts = pathinfo($bundle_tgz); if($parts["extension"] == 'tgz' || $parts["extension"]=='gz') { ! $extract_dir = $extract_dir.DIRECTORY_SEPARATOR; if(!is_dir($extract_dir)){ return PEAR::raiseError("Is not a directory: '$extract_dir'."); } ! System::mkdir(array('-p',$extract_dir)); if(ZZOSS_PACKAGE_DEBUG){ --- 218,232 ---- } } ! function getBundleDescr($bundle_tgz, $extract_dir) { $parts = pathinfo($bundle_tgz); if($parts["extension"] == 'tgz' || $parts["extension"]=='gz') { ! $extract_dir = $extract_dir.DIRECTORY_SEPARATOR; if(!is_dir($extract_dir)){ return PEAR::raiseError("Is not a directory: '$extract_dir'."); } ! System::mkdir(array('-p',$extract_dir)); if(ZZOSS_PACKAGE_DEBUG){ *************** *** 238,242 **** return PEAR::raiseError("unable to unpack $bundle_tgz"); } ! // Get distribution and application XML data. $app_xml = $extract_dir.'application.xml'; --- 238,242 ---- return PEAR::raiseError("unable to unpack $bundle_tgz"); } ! // Get distribution and application XML data. $app_xml = $extract_dir.'application.xml'; *************** *** 244,263 **** $config->setFile($app_xml); $descriptions['application'] = $config->query('/application'); ! $distri_xml = $extract_dir.'distribution.xml'; $config = new ZZOSS_Config; $config->setFile($distri_xml); $descriptions['distribution'] = $config->query('/distribution'); ! return $descriptions; } ! return false; } ! function extractDistribution($src, $dest) { $distribution_xml_src = $src.'distribution.xml'; ! if(!file_exists($distribution_xml_src)){ if(ZZOSS_PACKAGE_DEBUG){ --- 244,263 ---- $config->setFile($app_xml); $descriptions['application'] = $config->query('/application'); ! $distri_xml = $extract_dir.'distribution.xml'; $config = new ZZOSS_Config; $config->setFile($distri_xml); $descriptions['distribution'] = $config->query('/distribution'); ! return $descriptions; } ! return false; } ! function extractDistribution($src, $dest) { $distribution_xml_src = $src.'distribution.xml'; ! if(!file_exists($distribution_xml_src)){ if(ZZOSS_PACKAGE_DEBUG){ *************** *** 267,275 **** return false; } ! if(ZZOSS_PACKAGE_DEBUG){ ZZOSS_Debug::log('ZZOSS_Package', 'Yes, '.$distribution_xml_src.' exists.', __FILE__, __LINE__, __FUNCTION__, __CLASS__); } ! // register new distribution $distribution_config = new ZZOSS_Config(array('numeric' => array('maintainer'))); --- 267,275 ---- return false; } ! if(ZZOSS_PACKAGE_DEBUG){ ZZOSS_Debug::log('ZZOSS_Package', 'Yes, '.$distribution_xml_src.' exists.', __FILE__, __LINE__, __FUNCTION__, __CLASS__); } ! // register new distribution $distribution_config = new ZZOSS_Config(array('numeric' => array('maintainer'))); *************** *** 282,286 **** System::mkdir(array('-p',$distribution_dir.'downloads')); System::mkdir(array('-p',$distribution_dir.'applications')); ! System::mkdir(array('-p',$distribution_dir.'cache')); copy($distribution_xml_src, $distribution_dir.'distribution.xml'); // finally set "rebuild distributions" flag --- 282,286 ---- System::mkdir(array('-p',$distribution_dir.'downloads')); System::mkdir(array('-p',$distribution_dir.'applications')); ! System::mkdir(array('-p',$distribution_dir.'cache')); copy($distribution_xml_src, $distribution_dir.'distribution.xml'); // finally set "rebuild distributions" flag *************** *** 288,292 **** fputs($fp,'dummy'); fclose($fp); ! // Try to extract the application if(!ZZOSS_Package::extractApplication($src, $distribution_dir)){ --- 288,292 ---- fputs($fp,'dummy'); fclose($fp); ! // Try to extract the application if(!ZZOSS_Package::extractApplication($src, $distribution_dir)){ *************** *** 294,306 **** return false; } ! return true; } ! function extractApplication($src, $dest) { $application_xml_src = $src.'application.xml'; $packages_xml_src = $src.'packages.xml'; ! if(!(file_exists($application_xml_src)/* && file_exists($packages_xml_src)*/)) { if(ZZOSS_PACKAGE_DEBUG){ --- 294,306 ---- return false; } ! return true; } ! function extractApplication($src, $dest) { $application_xml_src = $src.'application.xml'; $packages_xml_src = $src.'packages.xml'; ! if(!(file_exists($application_xml_src)/* && file_exists($packages_xml_src)*/)) { if(ZZOSS_PACKAGE_DEBUG){ *************** *** 309,313 **** return false; } ! if(ZZOSS_PACKAGE_DEBUG){ ZZOSS_Debug::log('ZZOSS_Package', 'Yes, '.$application_xml_src.' and '.$packages_xml_src.' do exist.', __FILE__, __LINE__, __FUNCTION__, __CLASS__); --- 309,313 ---- return false; } ! if(ZZOSS_PACKAGE_DEBUG){ ZZOSS_Debug::log('ZZOSS_Package', 'Yes, '.$application_xml_src.' and '.$packages_xml_src.' do exist.', __FILE__, __LINE__, __FUNCTION__, __CLASS__); *************** *** 320,331 **** ZZOSS_InstallerRegistry::mkDirsApplication($application_dir); @copy($application_xml_src, $application_dir.'application.xml'); ! if(file_exists($packages_xml_src)){ copy($packages_xml_src, $application_dir.'installer'.DIRECTORY_SEPARATOR.'remote_packages.xml'); } ! // try to copy tgz files if($dp = @opendir($src)) { ! while (false !== ($file2 = readdir($dp))) { $parts = pathinfo($file2); if($parts["extension"] == 'tgz' || $parts["extension"]=='gz') { --- 320,331 ---- ZZOSS_InstallerRegistry::mkDirsApplication($application_dir); @copy($application_xml_src, $application_dir.'application.xml'); ! if(file_exists($packages_xml_src)){ copy($packages_xml_src, $application_dir.'installer'.DIRECTORY_SEPARATOR.'remote_packages.xml'); } ! // try to copy tgz files if($dp = @opendir($src)) { ! while (false !== ($file2 = readdir($dp))) { $parts = pathinfo($file2); if($parts["extension"] == 'tgz' || $parts["extension"]=='gz') { *************** *** 340,352 **** closedir($dp); } ! // finally set "rebuild application" flag $fp = fopen($dest."installer".DIRECTORY_SEPARATOR."applications.lock","w"); fputs($fp,'dummy'); fclose($fp); ! return true; } ! function extractPatches($src, $dest) { --- 340,352 ---- closedir($dp); } ! // finally set "rebuild application" flag $fp = fopen($dest."installer".DIRECTORY_SEPARATOR."applications.lock","w"); fputs($fp,'dummy'); fclose($fp); ! return true; } ! function extractPatches($src, $dest) { *************** *** 358,362 **** return true; } ! function extractPackages($src, $dest, $pkgs_allowed = array()) { --- 358,362 ---- return true; } ! function extractPackages($src, $dest, $pkgs_allowed = array()) { *************** *** 366,370 **** // check source dir and extract all tgz's to modules if($dp = @opendir($src)) { ! while (false !== ($file = readdir($dp))) { $parts = pathinfo($file); if($parts["extension"] == 'tgz' || $parts["extension"] == 'gz') { --- 366,370 ---- // check source dir and extract all tgz's to modules if($dp = @opendir($src)) { ! while (false !== ($file = readdir($dp))) { $parts = pathinfo($file); if($parts["extension"] == 'tgz' || $parts["extension"] == 'gz') { *************** *** 372,376 **** $pkgsrc = $src.$file; $pkg_dest_dir = $dest.$pkg_name.DIRECTORY_SEPARATOR; ! // did we specify the packages we allow to be extracted if(count($pkgs_allowed)){ --- 372,376 ---- $pkgsrc = $src.$file; $pkg_dest_dir = $dest.$pkg_name.DIRECTORY_SEPARATOR; ! // did we specify the packages we allow to be extracted if(count($pkgs_allowed)){ *************** *** 379,383 **** } } ! // check if the tgz has changed since we last extracted it if(ZZOSS_PACKAGE_DEBUG){ --- 379,383 ---- } } ! // check if the tgz has changed since we last extracted it if(ZZOSS_PACKAGE_DEBUG){ *************** *** 396,401 **** } } ! ! if(ZZOSS_PACKAGE_DEBUG){ ZZOSS_Debug::log('ZZOSS_Package', 'Attempting to extract '.$pkgsrc.' to '.$dest, __FILE__, __LINE__, __FUNCTION__, __CLASS__); --- 396,401 ---- } } ! ! if(ZZOSS_PACKAGE_DEBUG){ ZZOSS_Debug::log('ZZOSS_Package', 'Attempting to extract '.$pkgsrc.' to '.$dest, __FILE__, __LINE__, __FUNCTION__, __CLASS__); *************** *** 419,423 **** $package_config = new ZZOSS_Config(array('numeric' => array('dep','file', 'build', 'maintainer'))); $package_config->setFile($package_xml_src); ! $package = $package_config->query('/package'); $package_xml_dest = $dest.$package["name"].'-'.$package["release"]["version"].DIRECTORY_SEPARATOR.'package.xml'; // create the pckage directory if it does not exist yet --- 419,423 ---- $package_config = new ZZOSS_Config(array('numeric' => array('dep','file', 'build', 'maintainer'))); $package_config->setFile($package_xml_src); ! $package = $package_config->query('/package'); $package_xml_dest = $dest.$package["name"].'-'.$package["release"]["version"].DIRECTORY_SEPARATOR.'package.xml'; // create the pckage directory if it does not exist yet *************** *** 436,440 **** } } ! function packageSources($bundle_dir, $packages, $app_settings) { --- 436,440 ---- } } ! function packageSources($bundle_dir, $packages, $app_settings) { *************** *** 444,459 **** System::mkdir(array('-p', $bundle_dir)); } ! foreach($packages as $pos => $package){ ! $package_unique = $package['@']['name'].'-'.$package['@']['version']; $log[$package_unique] = ''; ! for($i = 1; $i <= 5; $i++){ if(isset($app_settings['source_'.$i]) && strlen($app_settings['source_'.$i])){ if(isset($packages[$pos])){ ! $has_pkg_source = true; ! $log[$package_unique] .= '* Scanning '.$app_settings['source_'.$i]."\n"; $package_src = ZZOSS_InstallerUtils::fixPath($app_settings['source_'.$i].DIRECTORY_SEPARATOR.$package['@']['name'].DIRECTORY_SEPARATOR); --- 444,459 ---- System::mkdir(array('-p', $bundle_dir)); } ! foreach($packages as $pos => $package){ ! $package_unique = $package['@']['name'].'-'.$package['@']['version']; $log[$package_unique] = ''; ! for($i = 1; $i <= 5; $i++){ if(isset($app_settings['source_'.$i]) && strlen($app_settings['source_'.$i])){ if(isset($packages[$pos])){ ! $has_pkg_source = true; ! $log[$package_unique] .= '* Scanning '.$app_settings['source_'.$i]."\n"; $package_src = ZZOSS_InstallerUtils::fixPath($app_settings['source_'.$i].DIRECTORY_SEPARATOR.$package['@']['name'].DIRECTORY_SEPARATOR); *************** *** 461,465 **** $package_tgz = $package_unique.'.tgz'; $package_xml = $package_src.'package.xml'; ! if(!file_exists($package_xml)){ $package_tgz_path = ZZOSS_InstallerUtils::fixPath($app_settings['source_'.$i].DIRECTORY_SEPARATOR.$package_tgz); --- 461,465 ---- $package_tgz = $package_unique.'.tgz'; $package_xml = $package_src.'package.xml'; ! if(!file_exists($package_xml)){ $package_tgz_path = ZZOSS_InstallerUtils::fixPath($app_settings['source_'.$i].DIRECTORY_SEPARATOR.$package_tgz); *************** *** 485,489 **** } else { $log[$package_unique] .= ' Found package.xml'."\n"; ! // check if the tgz has changed since we last registered it if( file_exists($package_dest.$package_tgz) && --- 485,489 ---- } else { $log[$package_unique] .= ' Found package.xml'."\n"; ! // check if the tgz has changed since we last registered it if( file_exists($package_dest.$package_tgz) && *************** *** 495,503 **** continue; } ! include_once 'ZZOSS_Package/Archive.php'; $pkg_tgz_path = ZZOSS_PackageArchive::create($package_src, $package_dest); $log[$package_unique] .= ' Created package '.$pkg_tgz_path.'.'."\n"; ! // remove this package from stack unset($packages[$pos]); --- 495,503 ---- continue; } ! include_once 'ZZOSS_Package/Archive.php'; $pkg_tgz_path = ZZOSS_PackageArchive::create($package_src, $package_dest); $log[$package_unique] .= ' Created package '.$pkg_tgz_path.'.'."\n"; ! // remove this package from stack unset($packages[$pos]); *************** *** 507,520 **** } } ! if(!$has_pkg_source){ return false; } ! $this->pkgs_unprocessed = $packages; ! // If a temporary directory has been created for temporary package.xml files, // then remove it now. ! // is handled by a shutdown function of PEAR::System /*if(isset($pkg_tmpdir) && is_dir($pkg_tmpdir)){ --- 507,520 ---- } } ! if(!$has_pkg_source){ return false; } ! $this->pkgs_unprocessed = $packages; ! // If a temporary directory has been created for temporary package.xml files, // then remove it now. ! // is handled by a shutdown function of PEAR::System /*if(isset($pkg_tmpdir) && is_dir($pkg_tmpdir)){ *************** *** 522,529 **** //System::rm(array('-rf', $pkg_tmpdir)); }*/ ! // General info $this->log = 'Destination: '.$bundle_dir."\n\n"; ! // compose log foreach($log as $package => $info){ --- 522,529 ---- //System::rm(array('-rf', $pkg_tmpdir)); }*/ ! // General info $this->log = 'Destination: '.$bundle_dir."\n\n"; ! // compose log foreach($log as $package => $info){ *************** *** 532,549 **** $this->log .= "\n"; } ! return true; } ! function getLog() { return $this->log; } ! function hasUnprocessedPkgs() { return @count($this->pkgs_unprocessed); } ! function getUnprocessedPkgs() { --- 532,549 ---- $this->log .= "\n"; } ! return true; } ! function getLog() { return $this->log; } ! function hasUnprocessedPkgs() { return @count($this->pkgs_unprocessed); } ! function getUnprocessedPkgs() { --- Dependency.php DELETED --- Index: package.xml =================================================================== RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.package.lib/package.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** package.xml 24 Apr 2004 15:34:20 -0000 1.6 --- package.xml 6 May 2004 12:32:23 -0000 1.7 *************** *** 4,8 **** <name>com.zzoss.package.lib</name> <summary>Classes to manage ZZ/OSS Installer or PEAR packages.</summary> ! <description>Methods for extracting, bundling, checking dependencies, etc.</description> <maintainers> <maintainer> --- 4,8 ---- <name>com.zzoss.package.lib</name> <summary>Classes to manage ZZ/OSS Installer or PEAR packages.</summary> ! <description>Methods for extracting, bundling, etc.</description> <maintainers> <maintainer> *************** *** 20,24 **** </maintainers> <release> ! <version>1.1.0</version> <date>{zi_release_date}</date> <license url="http://www.gnu.org/licenses/lgpl.txt" version="2">LGPL</license> --- 20,24 ---- </maintainers> <release> ! <version>1.2.0</version> <date>{zi_release_date}</date> <license url="http://www.gnu.org/licenses/lgpl.txt" version="2">LGPL</license> *************** *** 26,31 **** <notes> <![CDATA[ ! - added method packageSources() which moves or creates package archives to the specified directory from source directories ! - refreshPackages() now always refreshes the package registry, regardless if a flag has been set or not ]]> </notes> --- 26,30 ---- <notes> <![CDATA[ ! - moved dependency class to separate package com.zzoss.package.dependency.lib ]]> </notes> *************** *** 34,38 **** </copyright> <filelist> - <file role="php" baseinstalldir="ZZOSS_Package" name="Dependency.php"/> <file role="php" baseinstalldir="ZZOSS_Package" name="Package.php"/> </filelist> --- 33,36 ---- *************** *** 48,51 **** --- 46,76 ---- <changelog> <release> + <version>1.1.0</version> + <date>2004-04-06</date> + <license url="http://www.gnu.org/licenses/lgpl.txt" version="2">LGPL</license> + <state>stable</state> + <notes> + <![CDATA[ + - added method packageSources() which moves or creates package archives to the specified directory from source directories + - refreshPackages() now always refreshes the package registry, regardless if a flag has been set or not + ]]> + </notes> + <copyright> + <holder year="2003-{zi_copyright_year}" url="http://www.zzoss.com">ZZ/OSS</holder> + </copyright> + <filelist> + <file role="php" baseinstalldir="ZZOSS_Package" name="Dependency.php"/> + <file role="php" baseinstalldir="ZZOSS_Package" name="Package.php"/> + </filelist> + <deps> + <dep type="pkg" rel="ge" version="1.0.0">com.zzoss.dir.lib</dep> + <dep type="pkg" rel="ge" version="1.0">com.zzoss.config.lib</dep> + <dep type="pkg" rel="ge" version="0.4">com.zzoss.debug.lib</dep> + <dep type="pkg" rel="ge" version="1.0.0">com.zzoss.package.archive.lib</dep> + <dep type="pkg" rel="ge" version="1.3b3">PEAR</dep> + <dep type="pkg" rel="ge" version="1.1">Archive_Tar</dep> + </deps> + </release> + <release> <version>1.0</version> <date>2003-12-18</date> |
From: Sandro Z. <or...@us...> - 2004-05-06 12:31:41
|
Update of /cvsroot/zzossinstaller/packages/com.zzoss.package.dependency.lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14366/com.zzoss.package.dependency.lib Added Files: Dependency.php package.xml Log Message: move com.zzoss.package.lib/Dependency.php in own package com.zzoss.package.dependency.lib --- NEW FILE: Dependency.php --- <?php /* Copyright (C) 2001-2004 ZZOSS GbR, http://www.zzoss.com This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** @version $Id: Dependency.php,v 1.1 2004/05/06 12:31:32 ordnas Exp $ @copyright Copyright © 2001-2004 ZZ/OSS GbR, http://www.zzoss.com @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License */ require_once 'Package.php'; class ZZOSS_PackageDependency { var $queue; var $step; var $process; var $result; var $deps = array(); var $packages_check = array(); var $package_name; var $package; var $dep; var $error = false; var $pending = array(); /** * Stack of those packages that depend on another package. */ var $_circular_pkgs = array(); /** * Stack of those packages that are needeb by another package. */ var $_circular_deps = array(); /** * Packages not defined in application.xml. */ var $undefined = array(); function run($packages, $packages_resolve, $packages_versions, $actions) { $this->packages = $packages; $this->packages_resolve = $packages_resolve; $this->packages_versions = $packages_versions; $this->actions = $actions; // currently only install dependencies are checked // in future an enhanced algorithm will check for proper dependencies $this->_composePackageArray('I'); // catch errors $this->_checkDependencies(); // HACK: todo: extend dependency function for uninstall / update deps $this->step--; if($process_queue_array = $this->_composeQueue('R')){ $this->queue[$this->step] = $process_queue_array; $this->step++; } if($process_queue_array = $this->_composeQueue('U')){ $this->queue[$this->step] = $process_queue_array; $this->step++; } return $this->queue; } function hasPendingDeps() { return count($this->pending); } function getDeps() { return $this->result; } function hasUndefinedPackages() { return count($this->undefined); } function getUndefinedPackages() { return $this->undefined; } function getPending() { return $this->pending; } function getError() { return $this->error; } function isError() { return strlen($this->error); } function getCheckedNames() { return $this->packages_check_names; } function _composeQueue($char) { $result = false; if(is_array($this->actions)) { foreach($this->actions as $key => $val) { if($val == $char) { $name = $this->packages_resolve[$key]; $result[$name] = $char; } } } return $result; } function _composePackageArray($value) { $result = array(); if(is_array($this->actions)) { foreach($this->actions as $key=>$val) { if($val == $value) { $name = $this->packages_resolve[$key]; $this->packages_check[$name] = $this->packages[$name]; $this->packages_check_names[$this->packages[$name]['name']] = true; } } } } function _checkDependencies() { $result = array(); if(is_array($this->packages_check)) { $progress = true; $this->step = 0; $packages_new = $this->packages; while($progress) { $progress = false; $this->packages = $packages_new; //echo $this->step.'<hr/>'; foreach($this->packages_check as $key => $val) { $this->package_name = $key; $this->package = $val; if(!isset($val["_solved"]) || !$val["_solved"]) { if($this->_checkDependency()){ // TODO: extend function for uninstall / update dependencies //echo 'Resolved: '.$this->step.': '.$key.'<br/>'; $this->queue[$this->step][$key] = 'I'; $progress = true; $packages_new[$key]["installed"] = $val["release"]["version"]; $this->packages_check[$key]["_solved"] = true; } else { /* if(!isset($this->queue[$this->step][$key])){ $this->queue[$this->step+1][$key] = 'I'; } */ //echo 'Not resolved: '.$this->step.': '.$key.'<br/>'; } } } $this->step++; } /* echo '<pre>'; print_r($packages_new); echo '</pre>'; */ } } function _checkDependency() { $resolve = true; /* echo '<pre>'; print_r($this->package); echo '<pre>'; */ if(!isset($this->package["release"]["deps"])){ return true; } $deps = $this->package["release"]["deps"]["dep"]; if(!is_array($deps) || !count($deps)) { return true; } else { //echo '<h1>'.$this->package['name'].'</h1>'; //echo '<pre>'; //print_r($deps); //echo '</pre>'; foreach($deps as $dep) { $this->dep = ZZOSS_InstallerUtils::trimArray($dep); // check for package dependency if(!$this->_checkDependencyType()){ $resolve = false; } } } //var_dump($resolve); echo '<br/>'; return $resolve; } /** * @todo Rewrite to use dep plugins, just like other plugins * @todo Routines for all PEAR deps */ function _checkDependencyType() { $dep_result = true; //$this->deps = array(); switch($this->dep['@']['type']){ case 'pkg': // If the dpendency is optional, don't bother about it if(isset($this->dep['@']['optional']) && $this->dep['@']['optional'] == 'yes'){ return true; } // Check if the needed package is defined in application.xml if(!isset($this->packages_versions[$this->dep["#"]])){ //echo $this->dep["#"].'<- '.$this->package_name.'<br>'; $pkg_undef_name = $this->dep["#"]; if(isset($this->dep["@"]["version"]) && strlen($this->dep["@"]["version"])){ $pkg_undef_name .= '-'.$this->dep["@"]["version"]; $this->undefined[$pkg_undef_name]['version'] = $this->dep["@"]["version"]; } $this->undefined[$pkg_undef_name]['name'] = $this->dep["#"]; /* if(isset($this->undefined[$pkg_undef_name]['needed_by'])){ echo '<pre>'; print_r($this->undefined[$pkg_undef_name]['needed_by']); echo '<pre>'; } */ if( !isset($this->undefined[$pkg_undef_name]['needed_by'][$this->package_name]) ){ $this->undefined[$pkg_undef_name]['needed_by'][$this->package_name] = $this->dep["@"]["rel"]; } //print_r($this->undefined[$pkg_undef_name]['needed_by']); //$this->undefined[$pkg_undef_name]['needed_by'] = array_unique($this->undefined[$pkg_undef_name]['needed_by']); //print_r($this->undefined[$pkg_undef_name]['needed_by']); $this->error = 'Some packages not defined by application'; } else { $versions = $this->packages_versions[$this->dep["#"]]; $dep_result = false; $pending = array(); foreach($versions as $v_available => $val){ if(!isset($this->dep["@"]["version"])){ $this->dep["@"]["version"] = null; } if(!$this->_isResolved($this->dep['@']['rel'], $this->dep["#"], $v_available, $this->dep["@"]["version"])){ if( !isset($pending[$this->dep["#"].'-'.$v_available]['needed_by'][$this->package_name]) ){ $pending[$this->dep["#"].'-'.$v_available]['needed_by'][$this->package_name] = $this->dep["@"]["rel"]; } //$pending[$this->dep["#"].'-'.$v_available]['needed_by'][] = array($this->package_name => $this->dep["@"]["rel"]); //$pending[$this->dep["#"].'-'.$v_available]['needed_by'] = array_unique($pending[$this->dep["#"].'-'.$v_available]['needed_by']); } else { $dep_result = true; unset($this->pending[$this->dep['#'].'-'.$v_available]); //echo 'UNSET PENDING: '.$this->dep['#'].'<br/>'; } } if(!$dep_result){ //echo 'SET PENDING: '.$this->dep['#'].'<br/>'; $this->pending = $pending + $this->pending; } } /* if(isset($this->pending[$this->dep["#"].'-'.$v_available]['needed_by'][$this->package_name])){ echo '<pre>'; print_r($this->pending[$this->dep["#"].'-'.$v_available]['needed_by'][$this->package_name]); echo '<pre>'; } */ break; } return $dep_result; } function _isResolved($dep_rel, $dep_name, $v_available, /*$is_installed,*/ $v_required = NULL) { $is_available = false; // If no version has been defined, we check, if the available version // is in the list of needed packages if(isset($this->packages_check_names[$dep_name])){ $is_available = true; } $is_installed = isset($this->packages[$this->dep["#"].'-'.$v_available]["installed"]); $is_resolved = true; switch($dep_rel) { case 'ge': // greater-or-equal comparing if($is_available && $is_installed){ //echo "ge - $dep_name: $v_available >= $v_required<br/>"; $is_resolved = version_compare($v_available, $v_required, $dep_rel); } else { //var_dump($is_installed); //echo "ge - $dep_name: !\$is_available<br/>"; $is_resolved = false; } break; case 'le': // lower-or-equal comparing // greater-or-equal comparing if($is_available && $is_installed){ $is_resolved = version_compare($v_available, $v_required, $dep_rel); } else { $is_resolved = false; } break; case 'has': //echo "has - $dep_name: $is_installed<br/>"; $is_resolved = $is_installed; //$is_resolved = $is_available; break; default: $dep_rel = 'eq'; // equal comparing // greater-or-equal comparing if($is_available && $is_installed){ $is_resolved = version_compare($v_available, $v_required, $dep_rel); } else { $is_resolved = false; } break; } // check for circular dependencies: // if the needed package has a dependency on a package that depends on it if( isset($this->_circular_pkgs[$this->dep["#"]]) && in_array($this->package['name'], $this->_circular_pkgs[$this->dep["#"]]) && isset($this->_circular_deps[$this->package['name']]) && in_array($this->dep["#"], $this->_circular_deps[$this->package['name']])){ /* echo "Circular dependency between '".$this->dep["#"]."' and '".$this->package['name']."'."; //$this->_unsetCircular(); echo '<pre>deps:'; print_r($this->_circular_deps); echo 'pkgs:'; print_r($this->_circular_pkgs); echo '</pre>'; */ return PEAR::raiseError("Circular dependency between '".$this->dep["#"]."' and '".$this->package['name']."'."); } if(!$is_resolved) { $this->_setCircularDeps(); } else { $this->_unsetCircular(); } return $is_resolved; } function _setCircularDeps() { if(!isset($this->_circular_deps[$this->dep["#"]]) && !isset($this->_circular_pkgs[$this->package['name']])) { /* echo '<br/>'; echo "Setting deps: '".$this->dep["#"]."'."; echo '<br/>'; echo "Setting pkgs: '".$this->package['name']."'."; echo '<hr/>'; */ $this->_circular_deps[$this->dep["#"]][] = $this->package['name']; $this->_circular_pkgs[$this->package['name']][] = $this->dep["#"]; } } function _unsetCircular() { /* echo '<br/>'; echo "Unsetting deps: '".$this->dep["#"]."'."; echo '<br/>'; echo "Unsetting pkgs: '".$this->package['name']."'."; echo '<hr/>'; */ unset($this->_circular_deps[$this->dep["#"]]); unset($this->_circular_pkgs[$this->package['name']]); } } ?> --- NEW FILE: package.xml --- <?xml version="1.0" encoding="ISO-8859-1" ?> <package version="1.0" xmlns="http://www.zzoss.com/NS/installer/package/"> <name>com.zzoss.package.dependency.lib</name> <summary>Manage packages dependencies.</summary> <description>Creates a queue from dependencies and checks for circular dependencies.</description> <maintainers> <maintainer> <user>czonsius</user> <name>Christian Zonsius</name> <email>chr...@zz...</email> <role>developer</role> </maintainer> <maintainer> <user>ordnas</user> <name>Sandro Zic</name> <email>san...@zz...</email> <role>lead</role> </maintainer> </maintainers> <release> <version>1.0.0</version> <date>{zi_release_date}</date> <license url="http://www.gnu.org/licenses/lgpl.txt" version="2">LGPL</license> <state>stable</state> <notes> <![CDATA[ Created this package with dependency class from com.zzoss.package.lib. ]]> </notes> <copyright> <holder year="2003-{zi_copyright_year}" url="http://www.zzoss.com">ZZ/OSS</holder> </copyright> <filelist> <file role="php" baseinstalldir="ZZOSS_Package" name="Dependency.php"/> </filelist> <deps> <dep type="pkg" rel="ge" version="1.2.0">com.zzoss.package.lib</dep> </deps> </release> </package> |
From: Sandro Z. <or...@us...> - 2004-05-06 12:29:32
|
Update of /cvsroot/zzossinstaller/packages/com.zzoss.package.dependency.lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13954/com.zzoss.package.dependency.lib Log Message: Directory /cvsroot/zzossinstaller/packages/com.zzoss.package.dependency.lib added to the repository |
From: Sandro Z. <or...@us...> - 2004-05-06 12:25:38
|
Update of /cvsroot/zzossinstaller/packages/com.zzoss.package.archive.lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13107/com.zzoss.package.archive.lib Modified Files: Archive.php Log Message: optimize memory usage Index: Archive.php =================================================================== RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.package.archive.lib/Archive.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Archive.php 24 Apr 2004 15:33:36 -0000 1.1 --- Archive.php 6 May 2004 12:25:29 -0000 1.2 *************** *** 1,3 **** ! <?php /* Copyright (C) 2001-2004 ZZOSS GbR, http://www.zzoss.com --- 1,3 ---- ! <?php /* Copyright (C) 2001-2004 ZZOSS GbR, http://www.zzoss.com *************** *** 17,21 **** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ! /** @version $Id$ --- 17,21 ---- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ! /** @version $Id$ *************** *** 32,52 **** require_once 'ZZOSS_Dir/Dir.php'; ! /** ! * This class parses the XML config file and provides the objects of the ! * XML document. ! * ! * Extends PEAR XML_Parser class. ! * ! * @version 1 ! * @author Sandro Zic <san...@zz...>; | ! */ ! class ZZOSS_PackageArchive extends PEAR { ! ! function create($pkg_src_dir, $pkg_dest_dir = null) { static $pkg_tmpdir = ''; ! // take care of *nix and Win directory separators if(DIRECTORY_SEPARATOR == '/'){ --- 32,52 ---- require_once 'ZZOSS_Dir/Dir.php'; ! /** ! * This class parses the XML config file and provides the objects of the ! * XML document. ! * ! * Extends PEAR XML_Parser class. ! * ! * @version 1 ! * @author Sandro Zic <san...@zz...>; | ! */ ! class ZZOSS_PackageArchive extends PEAR { ! ! function create($pkg_src_dir, $pkg_dest_dir = null) { static $pkg_tmpdir = ''; ! // take care of *nix and Win directory separators if(DIRECTORY_SEPARATOR == '/'){ *************** *** 55,77 **** $wrong_dir_separator = '/'; } ! if(is_null($pkg_dest_dir)){ $pkg_dest_dir = $pkg_src_dir; } ! $package_xml = $pkg_src_dir.DIRECTORY_SEPARATOR.'package.xml'; ! // Get package.xml and parse it to fill placeholder with content. ! $replace_values['{zi_release_date}'] = date('Y-m-d'); $replace_values['{zi_copyright_year}'] = date('Y'); ! include_once 'ZZOSS_File/Replace.php'; $replace = new ZZOSS_FileReplace; $replace->file($package_xml); $replace->replace($replace_values); ! // Create a temporary package.xml ! // Create the temporary directory where we place it. // But only if the directory does not already exist. --- 55,77 ---- $wrong_dir_separator = '/'; } ! if(is_null($pkg_dest_dir)){ $pkg_dest_dir = $pkg_src_dir; } ! $package_xml = $pkg_src_dir.DIRECTORY_SEPARATOR.'package.xml'; ! // Get package.xml and parse it to fill placeholder with content. ! $replace_values['{zi_release_date}'] = date('Y-m-d'); $replace_values['{zi_copyright_year}'] = date('Y'); ! include_once 'ZZOSS_File/Replace.php'; $replace = new ZZOSS_FileReplace; $replace->file($package_xml); $replace->replace($replace_values); ! // Create a temporary package.xml ! // Create the temporary directory where we place it. // But only if the directory does not already exist. *************** *** 81,88 **** } } ! $package_xml_new = $pkg_tmpdir.DIRECTORY_SEPARATOR.'package.xml'; $replace->writeout($package_xml_new); ! // Get package.xml parameters. include_once 'ZZOSS_Config/Config.php'; --- 81,90 ---- } } ! $package_xml_new = $pkg_tmpdir.DIRECTORY_SEPARATOR.'package.xml'; $replace->writeout($package_xml_new); ! // free memory ! unset($replace); ! // Get package.xml parameters. include_once 'ZZOSS_Config/Config.php'; *************** *** 90,98 **** $config->setFile($package_xml_new); $xml = $config->query('/package'); ! $pkg_unique = $xml['name'].'-'.$xml['release']['version']; $pkg_tgz = $pkg_dest_dir.DIRECTORY_SEPARATOR.$pkg_unique.'.tgz'; $tar_list = array(); ! // "Flatten" the filelist taking into accoutn <dir> elements include_once 'ZZOSS_Package/Descriptor.php'; --- 92,102 ---- $config->setFile($package_xml_new); $xml = $config->query('/package'); ! // free memory ! unset($config); ! $pkg_unique = $xml['name'].'-'.$xml['release']['version']; $pkg_tgz = $pkg_dest_dir.DIRECTORY_SEPARATOR.$pkg_unique.'.tgz'; $tar_list = array(); ! // "Flatten" the filelist taking into accoutn <dir> elements include_once 'ZZOSS_Package/Descriptor.php'; *************** *** 124,128 **** $plugin_files = $xml['release']['plugin']['file']; } ! if(count($plugin_files)){ include_once 'ZZOSS_File/File.php'; --- 128,132 ---- $plugin_files = $xml['release']['plugin']['file']; } ! if(count($plugin_files)){ include_once 'ZZOSS_File/File.php'; *************** *** 137,141 **** } } ! $cwd = getcwd(); chdir($pkg_src_dir); --- 141,145 ---- } } ! $cwd = getcwd(); chdir($pkg_src_dir); *************** *** 145,153 **** //$tar->create('package.xml'); $tar->addModify($tar_list, $pkg_unique); chdir($cwd); ! // delete the temporary package.xml unlink($package_xml_new); ! return $pkg_tgz; } --- 149,159 ---- //$tar->create('package.xml'); $tar->addModify($tar_list, $pkg_unique); + // free memory + unset($tar); chdir($cwd); ! // delete the temporary package.xml unlink($package_xml_new); ! return $pkg_tgz; } |
From: Sandro Z. <or...@us...> - 2004-05-06 12:24:06
|
Update of /cvsroot/zzossinstaller/packages/com.zzoss.installer.lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12707/com.zzoss.installer.lib Modified Files: Registry.php package.xml Log Message: verbose error message in dependency check if a package defined in application XML is not available Index: package.xml =================================================================== RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.installer.lib/package.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** package.xml 14 Jan 2004 15:40:55 -0000 1.3 --- package.xml 6 May 2004 12:23:58 -0000 1.4 *************** *** 20,24 **** </maintainers> <release> ! <version>1.0.1</version> <date>{zi_release_date}</date> <license url="http://www.gnu.org/licenses/lgpl.txt" version="2">LGPL</license> --- 20,24 ---- </maintainers> <release> ! <version>1.1.0</version> <date>{zi_release_date}</date> <license url="http://www.gnu.org/licenses/lgpl.txt" version="2">LGPL</license> *************** *** 26,34 **** <notes> <![CDATA[ ! - moved FileReplace.php to separate package com.zzoss.filereplace.lib ! - fixed bug in ZZOSS_InstallerUtils::dowlnoadFile() which mistakedly chopped of last directory from a path ! - fixed bug in ZZOSS_InstallerRegistry::refreshApplications() which caused installer to always switch to first application during installation process, see http://sourceforge.net/tracker/index.php?func=detail&aid=867719&group_id=95735&atid=612476 ! - use DIRECTORY_SEPARATOR in ZZOSS_InstallerUtils::copy_rec() ! - added ZZOSS_InstallerRegistry::getApplicationPathRel(); ]]> </notes> --- 26,30 ---- <notes> <![CDATA[ ! - added ZZOSS_InstallerRegistry::getApplicationPackagesVersions() ]]> </notes> *************** *** 54,57 **** --- 50,71 ---- <changelog> <release> + <version>1.0.1</version> + <date>2004-04-06</date> + <license url="http://www.gnu.org/licenses/lgpl.txt" version="2">LGPL</license> + <state>stable</state> + <notes> + <![CDATA[ + - moved FileReplace.php to separate package com.zzoss.filereplace.lib + - fixed bug in ZZOSS_InstallerUtils::dowlnoadFile() which mistakedly chopped of last directory from a path + - fixed bug in ZZOSS_InstallerRegistry::refreshApplications() which caused installer to always switch to first application during installation process, see http://sourceforge.net/tracker/index.php?func=detail&aid=867719&group_id=95735&atid=612476 + - use DIRECTORY_SEPARATOR in ZZOSS_InstallerUtils::copy_rec() + - added ZZOSS_InstallerRegistry::getApplicationPathRel(); + ]]> + </notes> + <copyright> + <holder year="2003-{zi_copyright_year}" url="http://www.zzoss.com">ZZ/OSS</holder> + </copyright> + </release> + <release> <version>1.0</version> <date>2003-12-18</date> Index: Registry.php =================================================================== RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.installer.lib/Registry.php,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** Registry.php 7 Apr 2004 14:21:53 -0000 1.33 --- Registry.php 6 May 2004 12:23:58 -0000 1.34 *************** *** 17,21 **** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ! /** @version $Id$ --- 17,21 ---- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ! /** [...2515 lines suppressed...] ! // create directories System::mkdir(array('-p',$this->application_path)); *************** *** 2022,2028 **** { $procedures_new[$procedure] = $val; ! $procedures_reg = $this->application_path.'installer'.DIRECTORY_SEPARATOR.'procedures.reg'; ! $procedures_old = ZZOSS_InstallerUtils::unserializeFromFile($procedures_reg); if(is_array($procedures_old) && count($procedures_old)){ --- 2040,2046 ---- { $procedures_new[$procedure] = $val; ! $procedures_reg = $this->application_path.'installer'.DIRECTORY_SEPARATOR.'procedures.reg'; ! $procedures_old = ZZOSS_InstallerUtils::unserializeFromFile($procedures_reg); if(is_array($procedures_old) && count($procedures_old)){ |
From: Sandro Z. <or...@us...> - 2004-05-06 12:23:47
|
Update of /cvsroot/zzossinstaller/packages/com.zzoss.zic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12622/com.zzoss.zic Modified Files: packages_dependencies.php Log Message: verbose error message in dependency check if a package defined in application XML is not available Index: packages_dependencies.php =================================================================== RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/packages_dependencies.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** packages_dependencies.php 6 May 2004 08:19:06 -0000 1.16 --- packages_dependencies.php 6 May 2004 12:23:28 -0000 1.17 *************** *** 194,197 **** --- 194,202 ---- ); + if($GLOBALS['ZI']['mode'] == 'dev'){ + // get the packages versions defined in application XML + $app_pkgs_vers = $zi_registry->getApplicationPackagesVersions(); + } + /* echo '<pre>'; *************** *** 257,261 **** ?> </td> ! <td align="center"><?php // show dependency relation if any if(isset($pkg_rels_transl[$pkg_rel])){ --- 262,266 ---- ?> </td> ! <td align="left"><?php // show dependency relation if any if(isset($pkg_rels_transl[$pkg_rel])){ *************** *** 270,273 **** --- 275,287 ---- echo ' <img src="themes/share/icons/org.kde.icons.crystalsvg/16x16/network.gif" align="absmiddle" border="0" alt="remote package" title="Download">'; } + + // show those versions defined by application, if any + if($GLOBALS['ZI']['mode'] == 'dev' && isset($app_pkgs_vers[$package_needed_name_full])){ + foreach ($app_pkgs_vers[$package_needed_name_full] as $version){ + if(!isset($packages[$package_needed_name_full.'-'.$version])){ + echo '<p>The version defined in application XML ('.$version.') is not available.</p>'; + } + } + } ?></td> <td align="left"><?php |
From: Sandro Z. <or...@us...> - 2004-05-06 08:19:14
|
Update of /cvsroot/zzossinstaller/packages/com.zzoss.zic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32564/com.zzoss.zic Modified Files: packages_dependencies.php Log Message: show "Plugins" or "Packages" depending on type Index: packages_dependencies.php =================================================================== RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/packages_dependencies.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** packages_dependencies.php 13 Apr 2004 10:18:16 -0000 1.15 --- packages_dependencies.php 6 May 2004 08:19:06 -0000 1.16 *************** *** 1,3 **** ! <?php /* Copyright (C) 2001-2004 ZZOSS GbR, http://www.zzoss.com --- 1,3 ---- ! <?php /* Copyright (C) 2001-2004 ZZOSS GbR, http://www.zzoss.com *************** *** 17,21 **** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ! /** @version $Id$ --- 17,21 ---- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ! /** @version $Id$ *************** *** 23,38 **** @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License */ ! // execute init file require_once 'inc/init.php'; ! ! /*************************************************************************** ! * SCRIPT SPECIFIC FUNCTIONS * ! ***************************************************************************/ ! function zi_process() { global $zi_registry; ! $pkg_type = 'package'; if(isset($_REQUEST['type'])){ --- 23,38 ---- @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License */ ! // execute init file require_once 'inc/init.php'; ! ! /*************************************************************************** ! * SCRIPT SPECIFIC FUNCTIONS * ! ***************************************************************************/ ! function zi_process() { global $zi_registry; ! $pkg_type = 'package'; if(isset($_REQUEST['type'])){ *************** *** 40,62 **** } $zi_registry->setPackageType($pkg_type); ! $action_deps = $zi_registry->getPackagesActionsDeps(); $zi_registry->updatePackagesActions($action_deps); } ! ! /*************************************************************************** ! * STARTUP * ! ***************************************************************************/ ! // compose actions if full or minimum installation $app_settings = $zi_registry->getApplicationSettings(); ! if(!$zi_registry->isInstalledApplication() && $app_settings["application_profile"] != 'custom') { $zi_registry->setPkgsActionsPreselect($app_settings["application_profile"]); } ! // default next link $link_next = 'packages_process.php'.zi_form_querystr(); ! $pkg_type = 'package'; if(isset($_REQUEST['type'])){ --- 40,62 ---- } $zi_registry->setPackageType($pkg_type); ! $action_deps = $zi_registry->getPackagesActionsDeps(); $zi_registry->updatePackagesActions($action_deps); } ! ! /*************************************************************************** ! * STARTUP * ! ***************************************************************************/ ! // compose actions if full or minimum installation $app_settings = $zi_registry->getApplicationSettings(); ! if(!$zi_registry->isInstalledApplication() && $app_settings["application_profile"] != 'custom') { $zi_registry->setPkgsActionsPreselect($app_settings["application_profile"]); } ! // default next link $link_next = 'packages_process.php'.zi_form_querystr(); ! $pkg_type = 'package'; if(isset($_REQUEST['type'])){ *************** *** 64,68 **** } $zi_registry->setPackageType($pkg_type); ! $packages = $zi_registry->getPackages(); // no packages? --- 64,68 ---- } $zi_registry->setPackageType($pkg_type); ! $packages = $zi_registry->getPackages(); // no packages? *************** *** 76,83 **** } } ! $packages_resolve = $zi_registry->getPackagesResolve(); $packages_versions = $zi_registry->getPackagesVersions(); ! // check if we should install already installed packages if( --- 76,83 ---- } } ! $packages_resolve = $zi_registry->getPackagesResolve(); $packages_versions = $zi_registry->getPackagesVersions(); ! // check if we should install already installed packages if( *************** *** 92,96 **** } } ! // if no packages are supposed to be installed, // we redirect. --- 92,96 ---- } } ! // if no packages are supposed to be installed, // we redirect. *************** *** 102,106 **** exit; } ! $zi_registry->setPackagesActions($actions); } else { --- 102,106 ---- exit; } ! $zi_registry->setPackagesActions($actions); } else { *************** *** 114,118 **** echo '</pre>'; */ ! /* echo '<h3>Actions</h3>'; --- 114,118 ---- echo '</pre>'; */ ! /* echo '<h3>Actions</h3>'; *************** *** 124,128 **** require_once 'ZZOSS_Package/Dependency.php'; $zi_deps = new ZZOSS_PackageDependency; ! $queue = $zi_deps->run($packages, $packages_resolve, $packages_versions, $actions); if($zi_deps->isError()){ --- 124,128 ---- require_once 'ZZOSS_Package/Dependency.php'; $zi_deps = new ZZOSS_PackageDependency; ! $queue = $zi_deps->run($packages, $packages_resolve, $packages_versions, $actions); if($zi_deps->isError()){ *************** *** 142,149 **** echo '</pre>'; */ ! // default next link $link_next = 'packages_download.php'.zi_form_querystr(); ! // save process queue $zi_registry->updatePackagesQueue($queue); --- 142,149 ---- echo '</pre>'; */ ! // default next link $link_next = 'packages_download.php'.zi_form_querystr(); ! // save process queue $zi_registry->updatePackagesQueue($queue); *************** *** 153,167 **** exit; } ! ! ! /*************************************************************************** ! * PAGE CONTENT * ! ***************************************************************************/ ! include 'themes/'.$GLOBALS['ZI']['theme'].'/header.php'; ! $application = $zi_registry->getApplication(); ?> ! <h1>Packages Dependencies</h1> <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>&application=<?php echo $_REQUEST['application']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>&application=<?php echo $_REQUEST['application']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2> <?php --- 153,167 ---- exit; } ! ! ! /*************************************************************************** ! * PAGE CONTENT * ! ***************************************************************************/ ! include 'themes/'.$GLOBALS['ZI']['theme'].'/header.php'; ! $application = $zi_registry->getApplication(); ?> ! <h1><?php echo ucfirst($pkg_type); ?>s Dependencies</h1> <h2><a href="info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>&application=<?php echo $_REQUEST['application']; ?>" onclick="javascript:window.open('info.php?mode=<?php echo $_REQUEST['mode']; ?>&type=application&distribution=<?php echo $_REQUEST['distribution']; ?>&application=<?php echo $_REQUEST['application']; ?>', 'ApplicationInformation', 'width=500,height=500,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0,dependent=0');void(0);javascript:return(false);" target="_blank" title="<?php echo $application["summary"].' '.$application['release']['version']; ?>"><?php echo $application["summary"].' '.$application['release']['version']; ?></a></h2> <?php *************** *** 185,189 **** */ if(is_array($pkgs_pending) && count($pkgs_pending)){ ! // translation table for dependency relations $pkg_rels_transl = array( --- 185,189 ---- */ if(is_array($pkgs_pending) && count($pkgs_pending)){ ! // translation table for dependency relations $pkg_rels_transl = array( *************** *** 193,208 **** 'has ' => 'has' ); ! /* echo '<pre>'; ! echo '<h3>getDeps()</h3>'; echo print_r($zi_deps->getDeps()); echo '</pre>'; ! echo '<pre>'; echo '<h3>getCheckedNames()</h3>'; echo print_r($zi_deps->getCheckedNames()); echo '</pre>'; ! echo '<pre>'; echo '<h3>getDepsByName()</h3>'; --- 193,208 ---- 'has ' => 'has' ); ! /* echo '<pre>'; ! echo '<h3>getDeps()</h3>'; echo print_r($zi_deps->getDeps()); echo '</pre>'; ! echo '<pre>'; echo '<h3>getCheckedNames()</h3>'; echo print_r($zi_deps->getCheckedNames()); echo '</pre>'; ! echo '<pre>'; echo '<h3>getDepsByName()</h3>'; *************** *** 215,219 **** <table class="list"> <tr> ! <th align="left">Package</th> <th align="center">Version</th> <th align="center">Needed By</th> --- 215,219 ---- <table class="list"> <tr> ! <th align="left"><?php echo ucfirst($pkg_type); ?></th> <th align="center">Version</th> <th align="center">Needed By</th> *************** *** 231,235 **** //$pkgs_needed_by = $pkgs_needed_by['needed_by']; } ! $package_needed_name_full = $package_needed['name']; if(strlen($package_needed_name_full) > 32){ --- 231,235 ---- //$pkgs_needed_by = $pkgs_needed_by['needed_by']; } ! $package_needed_name_full = $package_needed['name']; if(strlen($package_needed_name_full) > 32){ *************** *** 238,242 **** $package_needed_name_short = $package_needed_name_full; } ! $pkgs_needed = $pkgs_needed_by['needed_by']; foreach($pkgs_needed as $pkg_needed => $pkg_rel){ --- 238,242 ---- $package_needed_name_short = $package_needed_name_full; } ! $pkgs_needed = $pkgs_needed_by['needed_by']; foreach($pkgs_needed as $pkg_needed => $pkg_rel){ *************** *** 249,255 **** <?php } ! echo $package_needed_name_short; ! if(!$zi_deps->hasUndefinedPackages()){ ?></a><br/><?php echo $package_needed['summary']; --- 249,255 ---- <?php } ! echo $package_needed_name_short; ! if(!$zi_deps->hasUndefinedPackages()){ ?></a><br/><?php echo $package_needed['summary']; *************** *** 262,266 **** echo $pkg_rels_transl[$pkg_rel].' '; } ! echo $package_needed["release"]["version"]; if($package_needed["release"]["version"]=="") { --- 262,266 ---- echo $pkg_rels_transl[$pkg_rel].' '; } ! echo $package_needed["release"]["version"]; if($package_needed["release"]["version"]=="") { *************** *** 311,315 **** } } ! $zi_buttons['back'] = $link_back; include 'themes/'.$GLOBALS['ZI']['theme'].'/footer.php'; --- 311,315 ---- } } ! $zi_buttons['back'] = $link_back; include 'themes/'.$GLOBALS['ZI']['theme'].'/footer.php'; |
From: Sandro Z. <or...@us...> - 2004-04-24 16:21:22
|
Update of /cvsroot/zzossinstaller/packages/com.zzoss.zic.plugin.filerole In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31948/com.zzoss.zic.plugin.filerole Modified Files: package.xml Log Message: update to new config plugin version Index: package.xml =================================================================== RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic.plugin.filerole/package.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** package.xml 5 Mar 2004 14:25:25 -0000 1.3 --- package.xml 24 Apr 2004 16:21:13 -0000 1.4 *************** *** 58,62 **** </deps> <builds> ! <build dir="config/" plugin="com.zzoss.zic.plugin.config" rel="ge" version="2.0.0"/> </builds> </release> --- 58,62 ---- </deps> <builds> ! <build dir="config/" plugin="com.zzoss.zic.plugin.config" rel="ge" version="2.0.1"/> </builds> </release> |
From: Sandro Z. <or...@us...> - 2004-04-24 16:21:21
|
Update of /cvsroot/zzossinstaller/packages/com.zzoss.zic.build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31948/com.zzoss.zic.build Modified Files: package.xml Log Message: update to new config plugin version Index: package.xml =================================================================== RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic.build/package.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** package.xml 5 Mar 2004 14:25:25 -0000 1.4 --- package.xml 24 Apr 2004 16:21:06 -0000 1.5 *************** *** 26,30 **** </copyright> <builds> ! <build dir="config/" plugin="com.zzoss.zic.plugin.config" rel="ge" version="2.0.0"/> </builds> <filelist> --- 26,30 ---- </copyright> <builds> ! <build dir="config/" plugin="com.zzoss.zic.plugin.config" rel="ge" version="2.0.1"/> </builds> <filelist> |
From: Sandro Z. <or...@us...> - 2004-04-24 16:20:26
|
Update of /cvsroot/zzossinstaller/packages/com.zzoss.zic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31809/com.zzoss.zic Modified Files: dev_package_archive.php Log Message: GUI to create package .tgz Index: dev_package_archive.php =================================================================== RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/dev_package_archive.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dev_package_archive.php 14 Apr 2004 11:13:49 -0000 1.1 --- dev_package_archive.php 24 Apr 2004 16:20:11 -0000 1.2 *************** *** 29,35 **** function zi_process() { ! require_once 'ZZOSS_Package/Package.php'; ! $pkg_tgz = ZZOSS_Package::createPkgArchive( $_REQUEST['ZI_VALUES']['pkg_src_dir'], System::mktemp('-d') --- 29,35 ---- function zi_process() { ! require_once 'ZZOSS_Package/Archive.php'; ! $pkg_tgz = ZZOSS_PackageArchive::create( $_REQUEST['ZI_VALUES']['pkg_src_dir'], System::mktemp('-d') |
From: Sandro Z. <or...@us...> - 2004-04-24 16:19:51
|
Update of /cvsroot/zzossinstaller/packages/com.zzoss.plugin.lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31662/com.zzoss.plugin.lib Modified Files: Plugin.php 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.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Plugin.php 24 Apr 2004 15:36:40 -0000 1.19 --- Plugin.php 24 Apr 2004 16:19:42 -0000 1.20 *************** *** 355,359 **** } ! function includePlugins($plugins, $build = null) { $status = ZZOSS_PLUGIN_STATUS_UNDEFINED; --- 355,359 ---- } ! function includePlugins($plugins, $plugin = null) { $status = ZZOSS_PLUGIN_STATUS_UNDEFINED; *************** *** 361,377 **** ob_start(); $this->log .= "* Processing plugins.\n"; ! /* ! reset($this->sources);*/ ! if(is_array($plugins)){ ! foreach($plugins as $name => $params){/* ! // Iterate available sources ! if(!count($this->sources)){ ! PEAR::raiseError('No plugin directory defined.'); ! } else {*/ ! if(!$build || ($name == $build["@"]["plugin"].'-'.$build["@"]["version"])) { $status = $this->includePlugin($name, $params['file']); ! } ! /*} ! */} } /* --- 361,376 ---- ob_start(); $this->log .= "* Processing plugins.\n"; ! ! // not a build plugin ! if(is_null($plugin)) { ! if(is_array($plugins)){ ! foreach($plugins as $name => $params){ $status = $this->includePlugin($name, $params['file']); ! } ! } ! } else { ! // it should be a specific plugin ! $name = $plugin["@"]["plugin"].'-'.$plugin["@"]["version"]; ! $status = $this->includePlugin($name, $plugins[$name]['file']); } /* *************** *** 518,521 **** --- 517,522 ---- $plugin_params[$this->package['name'].'-'.$this->package['release']['version']]['file'] = $file_path; $plugin_params[$this->package['name'].'-'.$this->package['release']['version']]['name'] = $this->package['name']; + // remember the available versions + //$plugin_params[$this->package['name']][] = $this->package['release']['version']; if(!isset($file['@']['role'])){ |
From: Sandro Z. <or...@us...> - 2004-04-24 15:36:50
|
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> |
From: Sandro Z. <or...@us...> - 2004-04-24 15:34:29
|
Update of /cvsroot/zzossinstaller/packages/com.zzoss.package.lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24936/com.zzoss.package.lib Modified Files: Package.php package.xml Log Message: create package tgz with dir in filelist Index: Package.php =================================================================== RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.package.lib/Package.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Package.php 14 Apr 2004 11:13:48 -0000 1.13 --- Package.php 24 Apr 2004 15:34:20 -0000 1.14 *************** *** 496,500 **** } ! $pkg_tgz_path = ZZOSS_Package::createPkgArchive($package_src, $package_dest); $log[$package_unique] .= ' Created package '.$pkg_tgz_path.'.'."\n"; --- 496,501 ---- } ! include_once 'ZZOSS_Package/Archive.php'; ! $pkg_tgz_path = ZZOSS_PackageArchive::create($package_src, $package_dest); $log[$package_unique] .= ' Created package '.$pkg_tgz_path.'.'."\n"; *************** *** 535,643 **** } - function createPkgArchive($pkg_src_dir, $pkg_dest_dir = null) - { - static $pkg_tmpdir = ''; - - // take care of *nix and Win directory separators - if(DIRECTORY_SEPARATOR == '/'){ - $wrong_dir_separator = '\\'; - } else { - $wrong_dir_separator = '/'; - } - - if(is_null($pkg_dest_dir)){ - $pkg_dest_dir = $pkg_src_dir; - } - - $package_xml = $pkg_src_dir.DIRECTORY_SEPARATOR.'package.xml'; - - // Get package.xml and parse it to fill placeholder with content. - - $replace_values['{zi_release_date}'] = date('Y-m-d'); - $replace_values['{zi_copyright_year}'] = date('Y'); - - include_once 'ZZOSS_File/Replace.php'; - $replace = new ZZOSS_FileReplace; - $replace->file($package_xml); - $replace->replace($replace_values); - - // Create a temporary package.xml - - // Create the temporary directory where we place it. - // But only if the directory does not already exist. - if(!isset($pkg_tmpdir) || !strlen($pkg_tmpdir)){ - if (!($pkg_tmpdir = System::mktemp('-d'))) { - return PEAR::raiseError("Cannot create temporary directory."); - } - } - - $package_xml_new = $pkg_tmpdir.DIRECTORY_SEPARATOR.'package.xml'; - $replace->writeout($package_xml_new); - - // Get package.xml parameters. - include_once 'ZZOSS_Config/Config.php'; - $config = new ZZOSS_Config(array('cache' => true, 'numeric' => array('file'))); - $config->setFile($package_xml_new); - $xml = $config->query('/package'); - - $pkg_unique = $xml['name'].'-'.$xml['release']['version']; - $pkg_tgz = $pkg_dest_dir.DIRECTORY_SEPARATOR.$pkg_unique.'.tgz'; - $tar_list = array(); - - // Iterate files. - if( - !isset($xml['release']['filelist']['file']) || - !is_array($xml['release']['filelist']['file']) - ){ - $files = array(); - } else { - $files = $xml['release']['filelist']['file']; - } - if(count($files)){ - foreach($files as $file){ - $tar_list[] = str_replace($wrong_dir_separator,DIRECTORY_SEPARATOR,$file['@']['name']); - } - } - - $plugin_files = array(); - // Process plugin files. - if( - isset($xml['release']['plugin']['filelist']['file']) && - is_array($xml['release']['plugin']['filelist']['file'])){ - $plugin_files = $xml['release']['plugin']['filelist']['file']; - } - if( - isset($xml['release']['plugin']['file']) && - is_array($xml['release']['plugin']['file'])){ - $plugin_files = $xml['release']['plugin']['file']; - } - - if(count($plugin_files)){ - // We remember if a plugin file has been defined - // various times, because we need to process it only once. - $plugin_files_processed = array(); - foreach($plugin_files as $plugin_file){ - if(!in_array($plugin_file['@']['name'], $plugin_files_processed)){ - array_push($plugin_files_processed, $plugin_file['@']['name']); - $tar_list[] = $plugin_file['@']['name']; - } - } - } - - $cwd = getcwd(); - chdir($pkg_src_dir); - $tar = new Archive_Tar($pkg_tgz); - //$tar->setErrorHandling(PEAR_ERROR_PRINT); - $tar->createModify($package_xml_new, '', $pkg_tmpdir); - //$tar->create('package.xml'); - $tar->addModify($tar_list, $pkg_unique); - chdir($cwd); - - // delete the temporary package.xml - unlink($package_xml_new); - - return $pkg_tgz; - } - function getLog() { --- 536,539 ---- Index: package.xml =================================================================== RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.package.lib/package.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** package.xml 13 Apr 2004 10:24:30 -0000 1.5 --- package.xml 24 Apr 2004 15:34:20 -0000 1.6 *************** *** 38,46 **** </filelist> <deps> - <!--<dep type="pkg" rel="ge" version="1.0.1">com.zzoss.installer.lib</dep>--> - <dep type="pkg" rel="ge" version="1.0.0">com.zzoss.file.replace.lib</dep> <dep type="pkg" rel="ge" version="1.0.0">com.zzoss.dir.lib</dep> <dep type="pkg" rel="ge" version="1.0">com.zzoss.config.lib</dep> <dep type="pkg" rel="ge" version="0.4">com.zzoss.debug.lib</dep> <dep type="pkg" rel="ge" version="1.3b3">PEAR</dep> <dep type="pkg" rel="ge" version="1.1">Archive_Tar</dep> --- 38,45 ---- </filelist> <deps> <dep type="pkg" rel="ge" version="1.0.0">com.zzoss.dir.lib</dep> <dep type="pkg" rel="ge" version="1.0">com.zzoss.config.lib</dep> <dep type="pkg" rel="ge" version="0.4">com.zzoss.debug.lib</dep> + <dep type="pkg" rel="ge" version="1.0.0">com.zzoss.package.archive.lib</dep> <dep type="pkg" rel="ge" version="1.3b3">PEAR</dep> <dep type="pkg" rel="ge" version="1.1">Archive_Tar</dep> |
From: Sandro Z. <or...@us...> - 2004-04-24 15:34:02
|
Update of /cvsroot/zzossinstaller/packages/com.zzoss.package.descriptor.lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24808/com.zzoss.package.descriptor.lib Added Files: Descriptor.php package.xml Log Message: create package tgz with dir in filelist --- NEW FILE: Descriptor.php --- <?php /* Copyright (C) 2001-2004 ZZOSS GbR, http://www.zzoss.com This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** @version $Id: Descriptor.php,v 1.1 2004/04/24 15:33:52 ordnas Exp $ @copyright Copyright © 2001-2004 ZZ/OSS GbR, http://www.zzoss.com @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License */ /** * Read and transform package XML descriptor. */ class ZZOSS_PackageDescriptor { /** * The package XML descriptor array. */ var $xml; /** * The processed filelist. */ var $filelist = array(); /** * Track baseinstalldir attributes of dir elements of filelist. */ var $dirs = array(); /** * Track name attributes of dir elements of filelist. */ var $dirnames = array(); var $filelist_level = -1; function setArray($xml) { $this->xml = $xml; } function getFilelist($structure = 'flat') { $method = '_getFilelist'.ucfirst($structure); if(!method_exists($this, $method)){ trigger_error("Parameter '$structure' not available"); } // clean up previous filelist $this->filelist = array(); $this->dirs = array(); /* echo '<pre>'; print_r($this->xml['release']['filelist']); echo '</pre>'; */ $this->$method($this->xml['release']['filelist']); return $this->filelist; } function _getFilelistFlat($filelist, $role = null) { if(!is_array($filelist) || !count($filelist)){ return false; } else { // path of previous dir $path_prev = ''; if(isset($filelist['@']['baseinstalldir'])){ $baseinstalldir_prev = $filelist['@']['baseinstalldir']; } if(isset($filelist['@']['name']) && $filelist['@']['name'] != '/' && $filelist['@']['name'] != '\\'){ $name_prev = $filelist['@']['name']; } foreach($filelist as $type => $items){ switch($type){ case 'dir': //echo "<h1>Type: $type</h1>"; $this->increaseFilelistLevel(); foreach($items as $dir){ /* echo "<h2>Dir: </h2>"; echo '<pre>'; print_r($dir); echo '</pre>'; */ $path = ''; $path = null; $role = null; if(isset($dir['@']['baseinstalldir'])){ $this->_updateDirs('baseinstalldir', $dir['@']['baseinstalldir']); } if(isset($dir['@']['name']) && $dir['@']['name'] != '/' && $dir['@']['name'] != '\\'){ $this->_updateDirs('name', $dir['@']['name']); } if(isset($dir['@']['role'])){ $role = $dir['@']['role']; } $this->_getFilelistFlat($dir, $role); } break; case 'file': //echo "<h1>Type: $type</h1>"; $dir_name = $this->_getDirsPath('name'); $dir_baseinstalldir = $this->_getDirsPath('baseinstalldir'); foreach($items as $file) { //echo "<h2>File: (Level $this->filelist_level)</h2>"; $file_id = count($this->filelist); if(!is_array($file)){ $this->filelist[$file_id]["@"]["name"] = $file; if(!is_null($role)){ $this->filelist[$file_id]["@"]["role"] = $role; } } else { $this->filelist[$file_id] = $file; } if(!isset($this->filelist[$file_id]["@"]["name"])){ $this->filelist[$file_id]["@"]["name"] = $dir_name.$this->filelist[$file_id]["#"]; } elseif(strlen($dir_name)){ $this->filelist[$file_id]["@"]["name"] = $dir_name.$this->filelist[$file_id]["@"]["name"]; } if(isset($this->filelist[$file_id]["@"]["baseinstalldir"])){ // filter root slash if( $this->filelist[$file_id]["@"]["baseinstalldir"] == '/' || $this->filelist[$file_id]["@"]["baseinstalldir"] == '\\' ){ $this->filelist[$file_id]["@"]["baseinstalldir"] = ''; } $this->filelist[$file_id]["@"]["baseinstalldir"] = $dir_baseinstalldir.$this->filelist[$file_id]["@"]["baseinstalldir"]; } else { $this->filelist[$file_id]["@"]["baseinstalldir"] = $dir_baseinstalldir; } if(!isset($this->filelist[$file_id]["@"]["role"])){ // check if we have a role association defined by the directory if(!is_null($role)){ $this->filelist[$file_id]["@"]["role"] = $role; } else { $this->filelist[$file_id]["@"]["role"] = ''; } } /* echo '<pre>'; print_r($this->filelist[$file_id]); echo '</pre>'; */ } // if there's no child directory, we lower the filelist level if(!isset($filelist['dir'])){ $this->decreaseFilelistLevel(); $this->_updateDirs('baseinstalldir'); $this->_updateDirs('name'); } break; } } } return true; } function increaseFilelistLevel() { $this->filelist_level++; } function decreaseFilelistLevel() { if($this->filelist_level != 0){ $this->filelist_level--; } } function _updateDirs($type, $new_path = null) { if(!is_null($new_path)){ $this->dirs[$type][$this->filelist_level] = $new_path; } elseif(isset($this->dirs[$type]) && is_array($this->dirs[$type])) { if($this->filelist_level == 0){ $this->dirs[$type] = array(); } else { $dirs_tmp = array(); /* echo '<pre>1'; print_r($this->dirs); echo '</pre>'; */ // rearrange the array with values only until we hit // the current directory foreach($this->dirs[$type] as $level => $val){ $dirs_tmp[$level] = $val; //echo 'Filelist Level: '.$this->filelist_level.'<br/>'; if($level == $this->filelist_level){ break; } } /* echo '<pre>2'; print_r($filelist_baseinstalldirs); echo '</pre>'; */ $this->dirs[$type] = $dirs_tmp; } } } function _getDirsPath($type) { /* echo '<pre>1'; print_r($this->dirs); echo '</pre>'; */ $path = ''; if(isset($this->dirs[$type]) && is_array($this->dirs[$type]) && count($this->dirs[$type])){ $path = implode(DIRECTORY_SEPARATOR,$this->dirs[$type]); //echo "Path: $path <br/>"; } else { return false; } if(strlen($path)){ $path .= DIRECTORY_SEPARATOR; } return $path; } } ?> --- NEW FILE: package.xml --- <?xml version="1.0" encoding="ISO-8859-1" ?> <package version="1.0" xmlns="http://www.zzoss.com/NS/installer/package/"> <name>com.zzoss.package.descriptor.lib</name> <summary>Class for Package XML Descriptor.</summary> <description>Methods to read and transform the XML encoded information of a package XML file.</description> <maintainers> <maintainer> <user>czonsius</user> <name>Christian Zonsius</name> <email>chr...@zz...</email> <role>developer</role> </maintainer> <maintainer> <user>ordnas</user> <name>Sandro Zic</name> <email>san...@zz...</email> <role>lead</role> </maintainer> </maintainers> <release> <version>1.0.0</version> <date>{zi_release_date}</date> <license url="http://www.gnu.org/licenses/lgpl.txt" version="2">LGPL</license> <state>stable</state> <notes>Initial release.</notes> <copyright> <holder year="{zi_copyright_year}" url="http://www.zzoss.com">ZZ/OSS</holder> </copyright> <filelist> <file role="php" baseinstalldir="ZZOSS_Package" name="Descriptor.php"/> </filelist> </release> </package> |
From: Sandro Z. <or...@us...> - 2004-04-24 15:33:45
|
Update of /cvsroot/zzossinstaller/packages/com.zzoss.package.archive.lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24755/com.zzoss.package.archive.lib Added Files: Archive.php package.xml Log Message: create package tgz with dir in filelist --- NEW FILE: Archive.php --- <?php /* Copyright (C) 2001-2004 ZZOSS GbR, http://www.zzoss.com This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** @version $Id: Archive.php,v 1.1 2004/04/24 15:33:36 ordnas Exp $ @copyright Copyright © 2001-2004 ZZ/OSS GbR, http://www.zzoss.com @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License */ require_once 'PEAR.php'; require_once 'Archive/Tar.php'; require_once 'System.php'; require_once 'ZZOSS_Installer/Registry.php'; require_once 'ZZOSS_Config/Config.php'; require_once 'ZZOSS_Debug/Debug.php'; require_once 'ZZOSS_Dir/Dir.php'; /** * This class parses the XML config file and provides the objects of the * XML document. * * Extends PEAR XML_Parser class. * * @version 1 * @author Sandro Zic <san...@zz...>; | */ class ZZOSS_PackageArchive extends PEAR { function create($pkg_src_dir, $pkg_dest_dir = null) { static $pkg_tmpdir = ''; // take care of *nix and Win directory separators if(DIRECTORY_SEPARATOR == '/'){ $wrong_dir_separator = '\\'; } else { $wrong_dir_separator = '/'; } if(is_null($pkg_dest_dir)){ $pkg_dest_dir = $pkg_src_dir; } $package_xml = $pkg_src_dir.DIRECTORY_SEPARATOR.'package.xml'; // Get package.xml and parse it to fill placeholder with content. $replace_values['{zi_release_date}'] = date('Y-m-d'); $replace_values['{zi_copyright_year}'] = date('Y'); include_once 'ZZOSS_File/Replace.php'; $replace = new ZZOSS_FileReplace; $replace->file($package_xml); $replace->replace($replace_values); // Create a temporary package.xml // Create the temporary directory where we place it. // But only if the directory does not already exist. if(!isset($pkg_tmpdir) || !strlen($pkg_tmpdir)){ if (!($pkg_tmpdir = System::mktemp('-d'))) { return PEAR::raiseError("Cannot create temporary directory."); } } $package_xml_new = $pkg_tmpdir.DIRECTORY_SEPARATOR.'package.xml'; $replace->writeout($package_xml_new); // Get package.xml parameters. include_once 'ZZOSS_Config/Config.php'; $config = new ZZOSS_Config(array('numeric' => array('file', 'dir'))); $config->setFile($package_xml_new); $xml = $config->query('/package'); $pkg_unique = $xml['name'].'-'.$xml['release']['version']; $pkg_tgz = $pkg_dest_dir.DIRECTORY_SEPARATOR.$pkg_unique.'.tgz'; $tar_list = array(); // "Flatten" the filelist taking into accoutn <dir> elements include_once 'ZZOSS_Package/Descriptor.php'; $descr = new ZZOSS_PackageDescriptor; $descr->setArray($xml); if(!$files = $descr->getFilelist('flat')){ $files = array(); } else { include_once 'ZZOSS_File/File.php'; foreach($files as $file){ $tar_list[] = str_replace($wrong_dir_separator,DIRECTORY_SEPARATOR,ZZOSS_File::fixPath($file['@']['name'])); } } /* echo '<pre>'; print_r($tar_list); echo '</pre>'; */ $plugin_files = array(); // Process plugin files. if( isset($xml['release']['plugin']['filelist']['file']) && is_array($xml['release']['plugin']['filelist']['file'])){ $plugin_files = $xml['release']['plugin']['filelist']['file']; } if( isset($xml['release']['plugin']['file']) && is_array($xml['release']['plugin']['file'])){ $plugin_files = $xml['release']['plugin']['file']; } if(count($plugin_files)){ include_once 'ZZOSS_File/File.php'; // We remember if a plugin file has been defined // various times, because we need to process it only once. $plugin_files_processed = array(); foreach($plugin_files as $plugin_file){ if(!in_array($plugin_file['@']['name'], $plugin_files_processed)){ array_push($plugin_files_processed, $plugin_file['@']['name']); $tar_list[] = str_replace($wrong_dir_separator,DIRECTORY_SEPARATOR,ZZOSS_File::fixPath($plugin_file['@']['name'])); } } } $cwd = getcwd(); chdir($pkg_src_dir); $tar = new Archive_Tar($pkg_tgz); //$tar->setErrorHandling(PEAR_ERROR_PRINT); $tar->createModify($package_xml_new, '', $pkg_tmpdir); //$tar->create('package.xml'); $tar->addModify($tar_list, $pkg_unique); chdir($cwd); // delete the temporary package.xml unlink($package_xml_new); return $pkg_tgz; } } ?> --- NEW FILE: package.xml --- <?xml version="1.0" encoding="ISO-8859-1" ?> <package version="1.0" xmlns="http://www.zzoss.com/NS/installer/package/"> <name>com.zzoss.package.archive.lib</name> <summary>Class for Package Archives.</summary> <description>Methods to create package .tgz from sources.</description> <maintainers> <maintainer> <user>czonsius</user> <name>Christian Zonsius</name> <email>chr...@zz...</email> <role>developer</role> </maintainer> <maintainer> <user>ordnas</user> <name>Sandro Zic</name> <email>san...@zz...</email> <role>lead</role> </maintainer> </maintainers> <release> <version>1.0.0</version> <date>{zi_release_date}</date> <license url="http://www.gnu.org/licenses/lgpl.txt" version="2">LGPL</license> <state>stable</state> <notes>Initial release.</notes> <copyright> <holder year="{zi_copyright_year}" url="http://www.zzoss.com">ZZ/OSS</holder> </copyright> <filelist> <file role="php" baseinstalldir="ZZOSS_Package" name="Archive.php"/> </filelist> <deps> <dep type="pkg" rel="ge" version="1.0.0">com.zzoss.package.descriptor.lib</dep> <dep type="pkg" rel="ge" version="1.0.0">com.zzoss.file.lib</dep> <dep type="pkg" rel="ge" version="1.0.0">com.zzoss.file.replace.lib</dep> </deps> </release> </package> |
From: Sandro Z. <or...@us...> - 2004-04-24 15:32:28
|
Update of /cvsroot/zzossinstaller/packages/com.zzoss.package.archive.lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24503/com.zzoss.package.archive.lib Log Message: Directory /cvsroot/zzossinstaller/packages/com.zzoss.package.archive.lib added to the repository |
From: Sandro Z. <or...@us...> - 2004-04-24 15:32:28
|
Update of /cvsroot/zzossinstaller/packages/com.zzoss.package.descriptor.lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24503/com.zzoss.package.descriptor.lib Log Message: Directory /cvsroot/zzossinstaller/packages/com.zzoss.package.descriptor.lib added to the repository |
From: Christian Z. <czo...@us...> - 2004-04-17 14:41:51
|
Update of /cvsroot/zzossinstaller/packages/com.zzoss.zic.plugin.config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10678 Modified Files: install_process.php Log Message: fixed data dir for config files Index: install_process.php =================================================================== RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic.plugin.config/install_process.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** install_process.php 6 Apr 2004 18:49:38 -0000 1.11 --- install_process.php 17 Apr 2004 14:41:43 -0000 1.12 *************** *** 123,127 **** $GLOBALS['ZI']['plugin_params']['name'] = ''; } ! $dest_dir = $pkg_data_dir.$GLOBALS['ZI']['plugin_params']['name'].DIRECTORY_SEPARATOR; } else { $dest_dir = $GLOBALS['ZI']['application_baseinstalldir'].$build_file['@']['baseinstalldir'].DIRECTORY_SEPARATOR; --- 123,128 ---- $GLOBALS['ZI']['plugin_params']['name'] = ''; } ! // $dest_dir = $pkg_data_dir.$GLOBALS['ZI']['plugin_params']['name'].DIRECTORY_SEPARATOR; ! $dest_dir = $pkg_data_dir.DIRECTORY_SEPARATOR; } else { $dest_dir = $GLOBALS['ZI']['application_baseinstalldir'].$build_file['@']['baseinstalldir'].DIRECTORY_SEPARATOR; |
From: Christian Z. <czo...@us...> - 2004-04-17 14:41:03
|
Update of /cvsroot/zzossinstaller/packages/com.zzoss.zic.plugin.config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10556 Modified Files: package.xml Log Message: 2.0.0 -> 2.0.1 Index: package.xml =================================================================== RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic.plugin.config/package.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** package.xml 13 Apr 2004 12:57:48 -0000 1.8 --- package.xml 17 Apr 2004 14:40:54 -0000 1.9 *************** *** 20,24 **** </maintainers> <release> ! <version>2.0.0</version> <date>{zi_release_date}</date> <license url="http://www.gnu.org/licenses/lgpl.txt" version="2.1">LGPL</license> --- 20,24 ---- </maintainers> <release> ! <version>2.0.1</version> <date>{zi_release_date}</date> <license url="http://www.gnu.org/licenses/lgpl.txt" version="2.1">LGPL</license> *************** *** 26,36 **** <notes> <![CDATA[ ! - ready for new plugin architecture ! - added filelist ! - files are installed to directory named like package name ! - introduced build.xml descriptor ! - added lower case prefix, so now placeholders are detected with ZI_ and zi_ prefix ! - all global vars of the installer ($GLOBALS['ZI']) are also replaced ! - added {zi_path_separator} as placeholder ]]> </notes> --- 26,30 ---- <notes> <![CDATA[ ! - fixed wrong data dir creation ]]> </notes> *************** *** 58,61 **** --- 52,75 ---- </release> <changelog> + <release> + <version>2.0.0</version> + <date>2004-04-01</date> + <license url="http://www.gnu.org/licenses/lgpl.txt" version="2.1">LGPL</license> + <state>stable</state> + <notes> + <![CDATA[ + - ready for new plugin architecture + - added filelist + - files are installed to directory named like package name + - introduced build.xml descriptor + - added lower case prefix, so now placeholders are detected with ZI_ and zi_ prefix + - all global vars of the installer ($GLOBALS['ZI']) are also replaced + - added {zi_path_separator} as placeholder + ]]> + </notes> + <copyright> + <holder year="2003-2004" url="http://www.zzoss.com">ZZ/OSS</holder> + </copyright> + </release> <release> <version>1.0</version> |
From: Sandro Z. <or...@us...> - 2004-04-14 11:13:59
|
Update of /cvsroot/zzossinstaller/packages/com.zzoss.package.lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8372/com.zzoss.package.lib Modified Files: Package.php Log Message: GUI to create package .tgz Index: Package.php =================================================================== RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.package.lib/Package.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Package.php 5 Apr 2004 09:58:16 -0000 1.12 --- Package.php 14 Apr 2004 11:13:48 -0000 1.13 *************** *** 445,454 **** } - // take care of *nix and Win directory separators - if(DIRECTORY_SEPARATOR == '/'){ - $wrong_dir_separator = '\\'; - } else { - $wrong_dir_separator = '/'; - } foreach($packages as $pos => $package){ --- 445,448 ---- *************** *** 502,599 **** } ! // Get package.xml and parse it to fill placeholder with content. ! ! $replace_values['{zi_release_date}'] = date('Y-m-d'); ! $replace_values['{zi_copyright_year}'] = date('Y'); ! ! include_once 'ZZOSS_File/Replace.php'; ! $replace = new ZZOSS_FileReplace; ! $replace->file($package_xml); ! $replace->replace($replace_values); ! ! // Create a temporary package.xml ! ! // Create the temporary directory where we place it. ! // But only if the directory does not already exist. ! if(!isset($pkg_tmpdir) || !strlen($pkg_tmpdir)){ ! if (!($pkg_tmpdir = System::mktemp('-d'))) { ! return PEAR::raiseError("Cannot create temporary directory."); ! } ! } ! ! $package_xml_new = $pkg_tmpdir . DIRECTORY_SEPARATOR . 'package.xml'; ! $replace->writeout($package_xml_new); ! ! // Get package.xml parameters. ! include_once 'ZZOSS_Config/Config.php'; ! $config = new ZZOSS_Config(array('cache' => true, 'numeric' => array('file'))); ! $config->setFile($package_xml_new); ! $xml = $config->query('/package'); ! if($package_unique == $xml['name'].'-'.$xml['release']['version']){ ! $tar_list = array(); ! ! // Iterate files. ! if( ! !isset($xml['release']['filelist']['file']) || ! !is_array($xml['release']['filelist']['file']) ! ){ ! $files = array(); ! } else { ! $files = $xml['release']['filelist']['file']; ! } ! if(count($files)){ ! foreach($files as $file){ ! $tar_list[] = str_replace($wrong_dir_separator,DIRECTORY_SEPARATOR,$file['@']['name']); ! } ! } ! ! $plugin_files = array(); ! // Process plugin files. ! if( ! isset($xml['release']['plugin']['filelist']['file']) && ! is_array($xml['release']['plugin']['filelist']['file'])){ ! $plugin_files = $xml['release']['plugin']['filelist']['file']; ! } ! if( ! isset($xml['release']['plugin']['file']) && ! is_array($xml['release']['plugin']['file'])){ ! $plugin_files = $xml['release']['plugin']['file']; ! } ! ! if(count($plugin_files)){ ! // We remember if a plugin file has been defined ! // various times, because we need to process it only once. ! $plugin_files_processed = array(); ! foreach($plugin_files as $plugin_file){ ! if(!in_array($plugin_file['@']['name'], $plugin_files_processed)){ ! array_push($plugin_files_processed, $plugin_file['@']['name']); ! $tar_list[] = $plugin_file['@']['name']; ! } ! } ! } ! ! $cwd = getcwd(); ! chdir($package_src); ! $tar = new Archive_Tar($package_dest.$package_tgz); ! //$tar->setErrorHandling(PEAR_ERROR_PRINT); ! $tar->createModify($package_xml_new, '', $pkg_tmpdir); ! //$tar->create('package.xml'); ! $tar->addModify($tar_list, $package_unique); ! $log[$package_unique] .= ' Created package '.$package_tgz.'.'."\n"; ! chdir($cwd); ! ! // delete the temporary package.xml ! unlink($package_xml_new); ! ! //copy($package_tgz, $package_dest.$package_tgz); ! //@unlink($package_tgz); ! //chdir($cwd); ! ! //$log[$package_unique] .= ' Moved '.$package_tgz.' to '.$bundle_dir.' directory.'."\n"; ! ! // remove this package from stack ! unset($packages[$pos]); ! } } } --- 496,504 ---- } ! $pkg_tgz_path = ZZOSS_Package::createPkgArchive($package_src, $package_dest); ! $log[$package_unique] .= ' Created package '.$pkg_tgz_path.'.'."\n"; ! // remove this package from stack ! unset($packages[$pos]); } } *************** *** 630,633 **** --- 535,643 ---- } + function createPkgArchive($pkg_src_dir, $pkg_dest_dir = null) + { + static $pkg_tmpdir = ''; + + // take care of *nix and Win directory separators + if(DIRECTORY_SEPARATOR == '/'){ + $wrong_dir_separator = '\\'; + } else { + $wrong_dir_separator = '/'; + } + + if(is_null($pkg_dest_dir)){ + $pkg_dest_dir = $pkg_src_dir; + } + + $package_xml = $pkg_src_dir.DIRECTORY_SEPARATOR.'package.xml'; + + // Get package.xml and parse it to fill placeholder with content. + + $replace_values['{zi_release_date}'] = date('Y-m-d'); + $replace_values['{zi_copyright_year}'] = date('Y'); + + include_once 'ZZOSS_File/Replace.php'; + $replace = new ZZOSS_FileReplace; + $replace->file($package_xml); + $replace->replace($replace_values); + + // Create a temporary package.xml + + // Create the temporary directory where we place it. + // But only if the directory does not already exist. + if(!isset($pkg_tmpdir) || !strlen($pkg_tmpdir)){ + if (!($pkg_tmpdir = System::mktemp('-d'))) { + return PEAR::raiseError("Cannot create temporary directory."); + } + } + + $package_xml_new = $pkg_tmpdir.DIRECTORY_SEPARATOR.'package.xml'; + $replace->writeout($package_xml_new); + + // Get package.xml parameters. + include_once 'ZZOSS_Config/Config.php'; + $config = new ZZOSS_Config(array('cache' => true, 'numeric' => array('file'))); + $config->setFile($package_xml_new); + $xml = $config->query('/package'); + + $pkg_unique = $xml['name'].'-'.$xml['release']['version']; + $pkg_tgz = $pkg_dest_dir.DIRECTORY_SEPARATOR.$pkg_unique.'.tgz'; + $tar_list = array(); + + // Iterate files. + if( + !isset($xml['release']['filelist']['file']) || + !is_array($xml['release']['filelist']['file']) + ){ + $files = array(); + } else { + $files = $xml['release']['filelist']['file']; + } + if(count($files)){ + foreach($files as $file){ + $tar_list[] = str_replace($wrong_dir_separator,DIRECTORY_SEPARATOR,$file['@']['name']); + } + } + + $plugin_files = array(); + // Process plugin files. + if( + isset($xml['release']['plugin']['filelist']['file']) && + is_array($xml['release']['plugin']['filelist']['file'])){ + $plugin_files = $xml['release']['plugin']['filelist']['file']; + } + if( + isset($xml['release']['plugin']['file']) && + is_array($xml['release']['plugin']['file'])){ + $plugin_files = $xml['release']['plugin']['file']; + } + + if(count($plugin_files)){ + // We remember if a plugin file has been defined + // various times, because we need to process it only once. + $plugin_files_processed = array(); + foreach($plugin_files as $plugin_file){ + if(!in_array($plugin_file['@']['name'], $plugin_files_processed)){ + array_push($plugin_files_processed, $plugin_file['@']['name']); + $tar_list[] = $plugin_file['@']['name']; + } + } + } + + $cwd = getcwd(); + chdir($pkg_src_dir); + $tar = new Archive_Tar($pkg_tgz); + //$tar->setErrorHandling(PEAR_ERROR_PRINT); + $tar->createModify($package_xml_new, '', $pkg_tmpdir); + //$tar->create('package.xml'); + $tar->addModify($tar_list, $pkg_unique); + chdir($cwd); + + // delete the temporary package.xml + unlink($package_xml_new); + + return $pkg_tgz; + } + function getLog() { |
From: Sandro Z. <or...@us...> - 2004-04-14 11:13:58
|
Update of /cvsroot/zzossinstaller/packages/com.zzoss.zic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8372/com.zzoss.zic Modified Files: dev_package.php package.xml Added Files: dev_package_archive.php Log Message: GUI to create package .tgz --- NEW FILE: dev_package_archive.php --- <?php /* Copyright (C) 2001-2004 ZZOSS GbR, http://www.zzoss.com This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** @version $Id: dev_package_archive.php,v 1.1 2004/04/14 11:13:49 ordnas Exp $ @copyright Copyright © 2001-2004 ZZ/OSS GbR, http://www.zzoss.com @license http://opensource.org/licenses/lgpl-license.php GNU Lesser General Public License */ // execute init file require_once 'inc/init.php'; function zi_process() { require_once 'ZZOSS_Package/Package.php'; $pkg_tgz = ZZOSS_Package::createPkgArchive( $_REQUEST['ZI_VALUES']['pkg_src_dir'], System::mktemp('-d') ); require_once 'HTTP/Download.php'; $dl = &new HTTP_Download(); $dl->setFile($pkg_tgz); $dl->setContentDisposition(HTTP_DOWNLOAD_ATTACHMENT, basename($pkg_tgz)); $dl->setContentType('application/octet-stream'); $dl->send(); } include 'themes/'.$GLOBALS['ZI']['theme'].'/header.php'; ?> <h1>Create Package Archive</h1> <?php // installer widget class require_once 'ZZOSS_Installer/Widget.php'; $zi_widget = new ZZOSS_InstallerWidget; if(isset($zi_errors)){ $zi_widget->setErrors($zi_errors); } ?> <table class="form"> <?php echo $zi_widget->add('path', 'Source Directory', 'pkg_src_dir', array('validation' => 'not empty')); ?> </table> <?php $zi_buttons['back'] = 'dev_package.php'.zi_form_querystr(); $zi_buttons['ok'] = $_SERVER['PHP_SELF']; include 'themes/'.$GLOBALS['ZI']['theme'].'/footer.php'; ?> Index: package.xml =================================================================== RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/package.xml,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** package.xml 13 Apr 2004 10:24:30 -0000 1.12 --- package.xml 14 Apr 2004 11:13:49 -0000 1.13 *************** *** 66,73 **** --- 66,75 ---- <file role="php" baseinstalldir="" name="dev_index.php"/> <file role="php" baseinstalldir="" name="dev_package.php"/> + <file role="php" baseinstalldir="" name="dev_package_archive.php"/> <file role="php" baseinstalldir="" name="dev_package_xml.php"/> <file role="php" baseinstalldir="" name="dev_plugin.php"/> <file role="php" baseinstalldir="" name="dev_reset_data.php"/> <file role="php" baseinstalldir="" name="distribution_download.php"/> + <file role="php" baseinstalldir="" name="download.php"/> <file role="php" baseinstalldir="" name="help.php"/> <file role="php" baseinstalldir="" name="index.php"/> Index: dev_package.php =================================================================== RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic/dev_package.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dev_package.php 5 Mar 2004 14:25:25 -0000 1.2 --- dev_package.php 14 Apr 2004 11:13:48 -0000 1.3 *************** *** 37,40 **** --- 37,43 ---- <p>[<a href="dev_package_xml.php?mode=dev" title="Create package.xml">Create package.xml</a>]</p> <p>Create a package.xml descriptor.</p> + + <p>[<a href="dev_package_archive.php?mode=dev" title="Create package archive">Create package archive</a>]</p> + <p>Create the archive (.tgz) of a package.</p> <?php include 'themes/'.$GLOBALS['ZI']['theme'].'/footer.php'; |
From: Sandro Z. <or...@us...> - 2004-04-13 13:21:33
|
Update of /cvsroot/zzossinstaller/packages/com.zzoss.zic.theme.kde In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24491/com.zzoss.zic.theme.kde Modified Files: footer_popup.php Log Message: no need for ZZOSS_Browser anymore, because we use gifs Index: footer_popup.php =================================================================== RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic.theme.kde/footer_popup.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** footer_popup.php 6 Apr 2004 19:51:11 -0000 1.7 --- footer_popup.php 13 Apr 2004 13:07:26 -0000 1.8 *************** *** 66,70 **** $response = ob_get_contents(); ob_end_clean(); ! require_once 'ZZOSS_Browser/Browser.php'; ! echo ZZOSS_Browser::png($response, 'themes/'.$GLOBALS['ZI']['theme'].'/spacer.gif'); ?> \ No newline at end of file --- 66,69 ---- $response = ob_get_contents(); ob_end_clean(); ! echo $response; ?> \ No newline at end of file |
From: Sandro Z. <or...@us...> - 2004-04-13 13:11:48
|
Update of /cvsroot/zzossinstaller/packages/com.zzoss.zic.plugin.config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22604/com.zzoss.zic.plugin.config Modified Files: package.xml Log Message: change names of renamed packages in deps Index: package.xml =================================================================== RCS file: /cvsroot/zzossinstaller/packages/com.zzoss.zic.plugin.config/package.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** package.xml 5 Apr 2004 16:40:33 -0000 1.7 --- package.xml 13 Apr 2004 12:57:48 -0000 1.8 *************** *** 53,57 **** <deps> <dep type="pkg" rel="ge" version="1.0.1">com.zzoss.installer.lib</dep> ! <dep type="pkg" rel="ge" version="1.0.0">com.zzoss.filereplace.lib</dep> <dep type="pkg" rel="ge" version="1.0.0">com.zzoss.file.lib</dep> </deps> --- 53,57 ---- <deps> <dep type="pkg" rel="ge" version="1.0.1">com.zzoss.installer.lib</dep> ! <dep type="pkg" rel="ge" version="1.0.0">com.zzoss.file.replace.lib</dep> <dep type="pkg" rel="ge" version="1.0.0">com.zzoss.file.lib</dep> </deps> |