cvs: php4 /pear/PEAR Packager.php

From: Date: Wed, 18 Jul 2001 17:13:38 +0000
Subject: cvs: php4 /pear/PEAR Packager.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-296@lists.php.net to get a copy of this message
cox Wed Jul 18 13:13:38 2001 EDT Modified files: /php4/pear/PEAR Packager.php Log: - always write a the package definition file as 'package.xml' inside the package - other clean-up's Index: php4/pear/PEAR/Packager.php diff -u php4/pear/PEAR/Packager.php:1.7 php4/pear/PEAR/Packager.php:1.8 --- php4/pear/PEAR/Packager.php:1.7 Tue Jul 17 15:21:55 2001 +++ php4/pear/PEAR/Packager.php Wed Jul 18 13:13:38 2001 @@ -17,13 +17,17 @@ // | Tomas V.V.Cox <cox@idecnet.com> | // +----------------------------------------------------------------------+ // -// $Id: Packager.php,v 1.7 2001/07/17 19:21:55 cox Exp $ +// $Id: Packager.php,v 1.8 2001/07/18 17:13:38 cox Exp $ 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 @@ 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 @@ 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));

« previous php.pear.cvs (#296) next »