- Document usage
- - Add module for generating component documentation.
-
- - Allow linking files during the installation.
-
- Allow filtering (see http://github.com/horde/horde/commit/404e8d1ea7c0bf99373aec2ce7f2534a442149b3)
Potentially check with git if the file is relevant or not.
- Fix dependency listing with the --optional=yes/no flag
- - Allow optional installation of PECL packages
+ - Allow downloading documentation from the wiki.
+
+ - Add module for generating component documentation.
- Add a commit module that automatically adds a changelog entry in
the notes section of the package.xml
- Add a release helper module.
- - Allow downloading documentation from the wiki.
-
- - Maybe prefix the job names of packages from the framework with Horde_
-
- Allow absolute/relative paths as arguments
- WWW frontend
private $_output;
/**
+ * The options for this run.
+ *
+ * @param array
+ */
+ private $_options;
+
+ /**
* The list of channels already installed.
*
* @var array
private function _installHordePackageOnce($package_file, $reason = '')
{
if (empty($this->_options['pretend'])) {
- $this->_environment->addPackageFromSource(
- $package_file, $reason
- );
+ if (empty($this->_options['symlink'])) {
+ $this->_environment->addPackageFromSource(
+ $package_file, $reason
+ );
+ } else {
+ $this->_environment->linkPackageFromSource(
+ $package_file, $reason
+ );
+ }
} else {
$this->_output->ok(
sprintf(
'help' => 'Just indicate what would be installed.',
)
),
+ new Horde_Argv_Option(
+ '-s',
+ '--symlink',
+ array(
+ 'action' => 'store_true',
+ 'help' => 'Symlink the files from the source repository rather than copying them to the install location. This is intended for the development mode where you want to have your edits to have a direct effect on your installation while still retaining the possibility of commiting to your repository.',
+ )
+ ),
+ new Horde_Argv_Option(
+ '-H',
+ '--horde-dir',
+ array(
+ 'action' => 'store',
+ 'help' => 'The location of the horde installation directory. The default will be the INSTALL/horde directory',
+ )
+ ),
);
}
}
/**
+ * Add a package based on a source directory.
+ *
+ * @param string $package The path to the package.xml in the source directory.
+ * @param string $reason Optional reason for adding the package.
+ *
+ * @return NULL
+ */
+ public function linkPackageFromSource($package, $reason = '')
+ {
+ $this->_output->ok(
+ sprintf(
+ 'About to symlink package %s%s',
+ $package,
+ $reason
+ )
+ );
+
+ $hordeDir = $this->getPearConfig()->get('horde_dir');
+ $destDir = $this->getPearConfig()->get('php_dir');
+
+ ob_start();
+ $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']);
+ continue;
+ }
+
+ switch ($file['attribs']['role']) {
+ case 'horde':
+ 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);
+ continue;
+ }
+ break;
+
+ case 'php':
+ if (isset($file['attribs']['install-as'])) {
+ $dest = $destDir . '/' . $file['attribs']['install-as'];
+ } elseif (isset($file['attribs']['baseinstalldir'])) {
+ $dest = $destDir . $file['attribs']['baseinstalldir'] . '/' . $file['attribs']['name'];
+ } else {
+ $dest = $destDir . '/' . $file['attribs']['name'];
+ }
+ break;
+
+ default:
+ $dest = null;
+ break;
+ }
+
+ if (!is_null($dest)) {
+ if (file_exists($dest)) {
+ @unlink($dest);
+ } elseif (!file_exists(dirname($dest))) {
+ @mkdir(dirname($dest), 0777, true);
+ }
+
+ print 'SYMLINK: ' . $orig . ' -> ' . $dest . "\n";
+ if (!symlink($orig, $dest)) {
+ $this->_output->warn('Could not link ' . $orig . '.');
+ }
+ }
+ }
+ $this->_output->pear(ob_get_clean());
+
+ $this->_output->ok(
+ sprintf(
+ 'Successfully symlinked package %s%s',
+ $package,
+ $reason
+ )
+ );
+ }
+
+ /**
* Add an external dependency based on a package name or package tarball.
*
* @param Components_Pear_Dependency $dependency The package dependency.
}
/**
+ * Return the list of files that should be installed for this package.
+ *
+ * @return array The file list.
+ */
+ public function getInstallationFilelist()
+ {
+ return $this->_getPackageFile()->getInstallationFilelist();
+ }
+
+ /**
* Update the content listing of the provided package.
*
* @param PEAR_PackageFileManager2 $package The package to update.
if (!$environment) {
$environment = $options['install'];
}
+ if (empty($options['horde_dir'])) {
+ $options['horde_dir'] = $environment . DIRECTORY_SEPARATOR . 'horde';
+ }
$arguments = $this->_config->getArguments();
$tree = $this->_factory
->createTreeHelper(
$environment, realpath($arguments[0]), $options
);
$tree->getEnvironment()->provideChannel('pear.horde.org');
+ $tree->getEnvironment()->getPearConfig()->set('horde_dir', $options['horde_dir'], 'user', 'pear.horde.org');
$tree->installTreeInEnvironment(
realpath($arguments[0]) . DIRECTORY_SEPARATOR . 'package.xml',
$this->_output,