if (empty($to_add)) {
$to_add = array($dependency->key());
}
- foreach (
- $this->_environment->identifyRequiredLocalDependencies(
- $dependency, $this->_options['include'], $this->_options['exclude']
- ) as $required
- ) {
+ $dependencies = $this->_environment->identifyRequiredLocalDependencies(
+ $dependency
+ );
+ /**
+ * @todo This section won't really work as reading the package.xml
+ * from an archive fails if the channels are unknown. So we never
+ * get here. Sigh...
+ */
+ if ($dependencies) {
+ $this->_installChannels(
+ $dependencies, sprintf(' [required by %s]', $dependency->name())
+ );
+ $list = $dependencies->listExternalDependencies(
+ $this->_options['include'], $this->_options['exclude']
+ );
+ } else {
+ $list = array();
+ }
+
+ foreach ($list as $required) {
if (in_array($required->key(), $to_add)) {
continue;
}
);
}
ob_start();
- $command_config = new PEAR_Command_Config(new PEAR_Frontend_CLI(), new stdClass);
- $command_config->doConfigCreate(
- 'config-create', array(), array($this->_base_directory, $this->_config_file)
+ $config = Components_Exception_Pear::catchError(
+ PEAR_Config::singleton($this->_config_file, '#no#system#config#', false)
);
+ $root = dirname($this->_config_file);
+ $config->noRegistry();
+ $config->set('php_dir', "$root/pear/php", 'user');
+ $config->set('data_dir', "$root/pear/data");
+ $config->set('www_dir', "$root/pear/www");
+ $config->set('cfg_dir', "$root/pear/cfg");
+ $config->set('ext_dir', "$root/pear/ext");
+ $config->set('doc_dir', "$root/pear/docs");
+ $config->set('test_dir', "$root/pear/tests");
+ $config->set('cache_dir', "$root/pear/cache");
+ $config->set('download_dir', "$root/pear/download");
+ $config->set('temp_dir', "$root/pear/temp");
+ $config->set('bin_dir', "$root/pear");
+ $config->writeConfigFile();
+ $config->_noRegistry = false;
+ $config->_registry['default'] = new PEAR_Registry("$root/pear/php");
+ $config->_noRegistry = true;
+ mkdir("$root/pear");
+ mkdir("$root/pear/php");
$this->_output->pear(ob_get_clean());
$this->_output->ok(
sprintf(
)
);
- $hordeDir = $this->getPearConfig()->get('horde_dir');
+ $hordeDir = $this->getPearConfig()->get('horde_dir', 'user', 'pear.horde.org');
$destDir = $this->getPearConfig()->get('php_dir');
ob_start();
+ $warnings = array();
$pkg = $this->_factory->createPackageForEnvironment($package, $this);
$dir = dirname($package);
foreach ($pkg->getInstallationFilelist() as $file) {
$orig = realpath($dir . '/' . $file['attribs']['name']);
if (empty($orig)) {
- $this->_output->warn('Install file does not seem to exist: ' . $dir . '/' . $file['attribs']['name']);
+ $warnings[] = 'Install file does not seem to exist: ' . $dir . '/' . $file['attribs']['name'];
continue;
}
if (isset($file['attribs']['install-as'])) {
$dest = $hordeDir . '/' . $file['attribs']['install-as'];
} else {
- $this->_output->warn('Could not determine install directory (role "horde") for ' . $hordeDir);
+ $warnings[] = 'Could not determine install directory (role "horde") for ' . $hordeDir;
continue;
}
break;
print 'SYMLINK: ' . $orig . ' -> ' . $dest . "\n";
if (!symlink($orig, $dest)) {
- $this->_output->warn('Could not link ' . $orig . '.');
+ $warnings[] = 'Could not link ' . $orig . '.';
}
}
}
$this->_output->pear(ob_get_clean());
+ foreach ($warnings as $warning) {
+ $this->_output->warn($warning);
+ }
+
$this->_output->ok(
sprintf(
'Successfully symlinked package %s%s',
)
);
if ($local = $this->_identifyMatchingLocalPackage($dependency->name())) {
+ $pkg = $this->_factory->getPackageFileFromTgz($local, $this);
+
ob_start();
Components_Exception_Pear::catchError(
$installer->doInstall(
* Identify any dependencies we need when installing via downloaded packages.
*
* @param Components_Pear_Dependency $dependency The package dependency.
- * @param string $include Optional dependencies to include.
- * @param string $exclude Optional dependencies to exclude.
*
- * @return array The added packages.
+ * @return Components_Pear_Dependencies The dependency helper for the local package.
*/
public function identifyRequiredLocalDependencies(
- Components_Pear_Dependency $dependency, $include, $exclude
+ Components_Pear_Dependency $dependency
) {
if ($local = $this->_identifyMatchingLocalPackage($dependency->name())) {
$this->_checkSetup();
return $this->_factory
->createTgzPackageForInstallLocation($local, $this)
- ->getDependencyHelper()
- ->listExternalDependencies($include, $exclude);
+ ->getDependencyHelper();
}
- return array();
+ return false;
}
/**
$environment = $options['install'];
}
if (empty($options['horde_dir'])) {
- $options['horde_dir'] = $environment . DIRECTORY_SEPARATOR . 'horde';
+ $options['horde_dir'] = dirname($environment) . DIRECTORY_SEPARATOR . 'horde';
}
$arguments = $this->_config->getArguments();
$tree = $this->_factory
$environment, realpath($arguments[0]), $options
);
$tree->getEnvironment()->provideChannel('pear.horde.org');
+ $tree->getEnvironment()->addPackageFromSource($tree->getRoot()->getPackageXml('Role'));
+ $tree->getEnvironment()->getPearConfig()->setChannels(array('pear.horde.org', true));
$tree->getEnvironment()->getPearConfig()->set('horde_dir', $options['horde_dir'], 'user', 'pear.horde.org');
+ Components_Exception_Pear::catchError($tree->getEnvironment()->getPearConfig()->store());
$tree->installTreeInEnvironment(
realpath($arguments[0]) . DIRECTORY_SEPARATOR . 'package.xml',
$this->_output,