Skip to content

Commit

Permalink
Add 'alldeps' options to pear_batch_install
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Oct 14, 2014
1 parent c7f078c commit e152eb9
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions framework/bin/pear_batch_install
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ error_reporting(error_reporting() & ~E_STRICT);
/* Get any arguments. */
require_once 'Console/Getopt.php';
$args = Console_Getopt::readPHPArgv();
$options = Console_Getopt::getopt($args, 'b:d:c:p:', array('base-dir=', 'install-dir=', 'config=', 'packages='));
$options = Console_Getopt::getopt($args, 'ab:d:c:p:', array('all', 'base-dir=', 'install-dir=', 'config=', 'packages='));
if (is_a($options, 'PEAR_Error')) {
echo <<<USAGE
Usage: pear_batch_install [[-b|--base-dir] DIRECTORY]
Usage: pear_batch_install [-a|--all]
[-b|--base-dir] DIRECTORY]
[[-d|--install-dir] DIRECTORY]
[[-c|--config] CONFIGFILE]
[[-p|--packages] PACKAGE1,PACKAGE2[,...]]
Expand All @@ -30,11 +31,17 @@ USAGE;
}

/* Set these options to empty by default. */
$alldeps = false;
$config_file = $install_dir = '';

$dir = dirname(__DIR__);
foreach ($options[0] as $option) {
switch ($option[0]) {
case 'a':
case '--alldeps':
$alldeps = true;
break;

case 'b':
case '--base-dir':
$dir = $option[1];
Expand Down Expand Up @@ -80,7 +87,12 @@ if (strpos($channels, 'pear.horde.org') == false) {

/* Overwrite old files, ignore dependancies (for ease of ordering),
* upgrade if already installed, etc. */
$pear = 'pear' . $config_file . $install_dir . ' install --force --nodeps';
$pear = 'pear' . $config_file . $install_dir . ' install --force';
if ($alldeps) {
$pear .= '-a';
} else {
$pear .= '--nodeps';
}

if (!empty($packages)) {
/* Installing only specific packages. */
Expand Down

0 comments on commit e152eb9

Please sign in to comment.