]> granicus.if.org Git - php/commitdiff
- always write a the package definition file as 'package.xml' inside the package
authorTomas V.V.Cox <cox@php.net>
Wed, 18 Jul 2001 17:13:38 +0000 (17:13 +0000)
committerTomas V.V.Cox <cox@php.net>
Wed, 18 Jul 2001 17:13:38 +0000 (17:13 +0000)
- other clean-up's

pear/PEAR/Packager.php

index 325bcc461cc789ced61d13d71985921893e62195..2a56fb73a62cee3a08e15de74207b91da91ad6cf 100644 (file)
@@ -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));