Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for packaging (with pyrus make) #18

Merged
merged 4 commits into from Aug 3, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
45 changes: 22 additions & 23 deletions src/Pyrus/Developer/PackageFile/Commands.php
Expand Up @@ -214,11 +214,6 @@ function package($frontend, $args, $options)
if ($options['zip'] || $options['phar']) {
echo "Zip and Phar archives can only be created for PEAR2 packages, ignoring\n";
}
if (extension_loaded('zlib')) {
$options['tgz'] = true;
} else {
$options['tar'] = true;
}
}

// get openssl cert if set, and password
Expand Down Expand Up @@ -267,27 +262,11 @@ function package($frontend, $args, $options)
. 'It is best to install the latest versions of these locally.');
}
} else {
$exceptionpath = $autoloadpath = $multierrorspath = dirname($sourcepath) .
$exceptionpath = $autoloadpath = $multierrorspath = $sourcepath .
'/PEAR2';
}
$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);
Expand All @@ -309,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);
Expand All @@ -323,7 +322,6 @@ function package($frontend, $args, $options)
}
echo "Creating ", $mainfile, "\n";
if (null == $cert) {
$cloner = new \Pyrus\Package\Cloner($mainfile);
$clone = $extras;
$extras = array();
} else {
Expand Down Expand Up @@ -383,6 +381,7 @@ function package($frontend, $args, $options)
}
$creator->render($package, $extrafiles);
if (count($clone)) {
$cloner = new \Pyrus\Package\Cloner($mainfile);
foreach ($clone as $extra) {
echo "Creating ", $package->name, '-', $package->version['release'], '.', $extra[0], "\n";
$cloner->{'to' . $extra[0]}();
Expand Down