Permalink
Browse files

Reordered the main file detection into one that allows for the creati…

…on of any and all archives (based on the current code in \Pyrus\Package\Cloner): phar, tar, tgz, zip.
  • Loading branch information...
boenrobot committed Aug 3, 2012
1 parent d45fb46 commit 3976887544c7d8d50f9386941ded3564fd1fa0e4
Showing with 20 additions and 16 deletions.
  1. +20 −16 src/Pyrus/Developer/PackageFile/Commands.php
@@ -267,22 +267,6 @@ function package($frontend, $args, $options)
}
$extras = array();
$stub = false;
- if ($options['tgz'] && extension_loaded('zlib')) {
- $mainfile = $package->name . '-' . $package->version['release'] . '.tgz';
- $mainformat = \Phar::TAR;
- $maincompress = \Phar::GZ;
- } elseif ($options['tgz']) {
- $options['tar'] = true;
- }
- if ($options['tar']) {
- if (isset($mainfile)) {
- $extras[] = array('tar', \Phar::TAR, \Phar::NONE);
- } else {
- $mainfile = $package->name . '-' . $package->version['release'] . '.tar';
- $mainformat = \Phar::TAR;
- $maincompress = \Phar::NONE;
- }
- }
if ($options['phar']) {
if (isset($mainfile)) {
$extras[] = array('phar', \Phar::PHAR, \Phar::GZ);
@@ -304,6 +288,26 @@ function package($frontend, $args, $options)
)
);
}
+ if ($options['tar']) {
+ if (isset($mainfile)) {
+ $extras[] = array('tar', \Phar::TAR, \Phar::NONE);
+ } else {
+ $mainfile = $package->name . '-' . $package->version['release'] . '.tar';
+ $mainformat = \Phar::TAR;
+ $maincompress = \Phar::NONE;
+ }
+ }
+ if ($options['tgz'] && extension_loaded('zlib')) {
+ if (isset($mainfile)) {
+ $extras[] = array('tgz', \Phar::TAR, \Phar::GZ);
+ } else {
+ $mainfile = $package->name . '-' . $package->version['release'] . '.tgz';
+ $mainformat = \Phar::TAR;
+ $maincompress = \Phar::GZ;
+ }
+ } elseif ($options['tgz']) {
+ $options['tar'] = true;
+ }
if ($options['zip']) {
if (isset($mainfile)) {
$extras[] = array('zip', \Phar::ZIP, \Phar::NONE);

0 comments on commit 3976887

Please sign in to comment.