Permalink
Browse files

Request #19299 Handle max + exclude version

  • Loading branch information...
1 parent cdcbc73 commit de04ccd62d971a31a1688fafadd7ee4154438a8f @CloCkWeRX CloCkWeRX committed Apr 1, 2012
Showing with 11 additions and 4 deletions.
  1. +11 −4 PEAR/Command/Packaging.php
View
@@ -842,14 +842,19 @@ function _generatePackageDeps($pf)
if (isset($dep['conflicts'])) {
$conflicts[] = $package;
} else {
- $requires[$package] = $package;
+ $requires[] = $package;
}
} else {
if (isset($dep['min'])) {
- $requires[$package] = $package . ' >= ' . $dep['min'];
+ $requires[] = $package . ' >= ' . $dep['min'];
}
if (isset($dep['max'])) {
- $requires[$package] = $package . ' <= ' . $dep['max'];
+ if (isset($dep['exclude']) && !is_array($dep['exclude']) && $dep['exclude']=$dep['max']) {
+ $requires[] = $package . ' < ' . $dep['max'];
+ unset($dep['exclude']);
+ } else {
+ $requires[] = $package . ' <= ' . $dep['max'];
+ }
}
if (isset($dep['exclude'])) {
$ex = $dep['exclude'];
@@ -874,7 +879,9 @@ function _generatePackageDeps($pf)
$deps['required']['pearinstaller']['min'];
}
if (count($requires)) {
- $this->_output['extra_headers'] .= $this->_formatRpmHeader('Requires', implode(', ', $requires)) . "\n";
+ foreach($requires as $req) {
+ $this->_output['extra_headers'] .= $this->_formatRpmHeader('Requires', $req) . "\n";
+ }
}
if (count($conflicts)) {
$this->_output['extra_headers'] .= $this->_formatRpmHeader('Conflicts', implode(', ', $conflicts)) . "\n";

0 comments on commit de04ccd

Please sign in to comment.