summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas V.V.Cox <cox@php.net>2001-07-18 17:13:38 +0000
committerTomas V.V.Cox <cox@php.net>2001-07-18 17:13:38 +0000
commit97c0042c04d90801bfdcca258d2b92836ac8025a (patch)
tree7bdd4167a9f49f9e8d105f9c4f800cda8195b5a6
parent073f9ec70f03eb974861798dba897d3d36429bd8 (diff)
downloadphp-git-97c0042c04d90801bfdcca258d2b92836ac8025a.tar.gz
- always write a the package definition file as 'package.xml' inside the package
- other clean-up's
-rw-r--r--pear/PEAR/Packager.php17
1 files changed, 11 insertions, 6 deletions
diff --git a/pear/PEAR/Packager.php b/pear/PEAR/Packager.php
index 325bcc461c..2a56fb73a6 100644
--- a/pear/PEAR/Packager.php
+++ b/pear/PEAR/Packager.php
@@ -24,6 +24,10 @@ require_once 'PEAR/Common.php';
/**
* Administration class used to make a PEAR release tarball.
*
+ * TODO:
+ * - add an extra param the dir where to place the created package
+ * - preserve file permissions (solve umask in copy problem)
+ *
* @since PHP 4.0.2
* @author Stig Bakken <ssb@fast.no>
*/
@@ -139,13 +143,12 @@ class PEAR_Packager extends PEAR_Common
return $this->raiseError("Unable to create temporary directory $this->tmpdir.",
null, PEAR_ERROR_TRIGGER, E_USER_ERROR);
} else {
- $this->log(2, "...TmpDir created at: " . $this->tmpdir);
+ $this->log(2, "+ tmp dir created at: " . $this->tmpdir);
}
$this->_tempfiles[] = $this->tmpdir;
// Copy files -----------------------------------------------
- $files = &$pkginfo['filelist'];
- foreach ($files as $fname => $atts) {
+ foreach ($pkginfo['filelist'] as $fname => $atts) {
$file = $this->tmpdir . DIRECTORY_SEPARATOR . $fname;
$dir = dirname($file);
if (!@is_dir($dir)) {
@@ -156,14 +159,16 @@ class PEAR_Packager extends PEAR_Common
if (!@copy($fname, $file)) {
$this->log(0, "could not copy $fname to $file");
} else {
- $this->log(2, "...copying from $fname to $file");
+ $this->log(2, "+ copying from $fname to $file");
}
}
// XXX TODO: Rebuild the package file as the old method did?
- if (!@copy($pkgfile, $this->tmpdir . DIRECTORY_SEPARATOR . $pkgfile)) {
+
+ // This allows build packages from different pear pack def files
+ if (!@copy($pkgfile, $this->tmpdir . DIRECTORY_SEPARATOR . 'package.xml')) {
return $this->raiseError("could not copy $pkgfile to " . $this->tmpdir);
}
- $this->log(2, "...copying package $pkgfile to " . $this->tmpdir);
+ $this->log(2, "+ copying package $pkgfile to " . $this->tmpdir);
// TAR the Package -------------------------------------------
chdir(dirname($this->tmpdir));