summaryrefslogtreecommitdiff
path: root/pear/PEAR/Packager.php
diff options
context:
space:
mode:
authorVincent Blavet <vblavet@php.net>2002-02-22 21:57:04 +0000
committerVincent Blavet <vblavet@php.net>2002-02-22 21:57:04 +0000
commit508b9eff571d876e64a87c81b27926d8b7bcb420 (patch)
tree014f883d1eb9e62b32d16ec910dcf09682ba7f9b /pear/PEAR/Packager.php
parentdb63c9e29182a399cd7bfc84dfe69d2f1308d4c8 (diff)
downloadphp-git-508b9eff571d876e64a87c81b27926d8b7bcb420.tar.gz
* Packager : Changing the order of the files in the package archive file.
The package.xml file is now at the 'root' of the archive, the files tree are under a 'packagename'-'packageversion' folder * Installer : installing the knew archive format AND supporting the existing format
Diffstat (limited to 'pear/PEAR/Packager.php')
-rw-r--r--pear/PEAR/Packager.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/pear/PEAR/Packager.php b/pear/PEAR/Packager.php
index f892b79676..b8db4686b8 100644
--- a/pear/PEAR/Packager.php
+++ b/pear/PEAR/Packager.php
@@ -132,9 +132,6 @@ class PEAR_Packager extends PEAR_Common
$filelist = array();
$i = 0;
- // ----- Add the package XML file
- $filelist[$i++] = $pkgfile;
-
// Copy files -----------------------------------------------
foreach ($pkginfo['filelist'] as $fname => $atts) {
if (!file_exists($fname)) {
@@ -149,9 +146,15 @@ class PEAR_Packager extends PEAR_Common
$dest_package = $this->orig_pwd . DIRECTORY_SEPARATOR . "{$pkgver}.tgz";
$tar = new Archive_Tar($dest_package, true);
$tar->setErrorHandling(PEAR_ERROR_PRINT);
- if (!$tar->createModify($filelist, $pkgver)) {
+ // ----- Creates with the package.xml file
+ if (!$tar->create($pkgfile)) {
+ return $this->raiseError('an error ocurred during package creation');
+ }
+ // ----- Add the content of the package
+ if (!$tar->addModify($filelist, $pkgver)) {
return $this->raiseError('an error ocurred during package creation');
}
+
$this->log(1, "Package $dest_package done");
return $dest_package;
}