cvs: php4 /pear/PEAR Installer.php Packager.php

From: Date: Sun, 19 Aug 2001 12:30:24 +0000
Subject: cvs: php4 /pear/PEAR Installer.php Packager.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-574@lists.php.net to get a copy of this message
cox Sun Aug 19 08:30:24 2001 EDT Modified files: /php4/pear/PEAR Packager.php Installer.php Log: maintain original file perms Index: php4/pear/PEAR/Packager.php diff -u php4/pear/PEAR/Packager.php:1.9 php4/pear/PEAR/Packager.php:1.10 --- php4/pear/PEAR/Packager.php:1.9 Tue Jul 31 09:36:54 2001 +++ php4/pear/PEAR/Packager.php Sun Aug 19 08:30:24 2001 @@ -17,7 +17,7 @@ // | Tomas V.V.Cox <cox@idecnet.com> | // +----------------------------------------------------------------------+ // -// $Id: Packager.php,v 1.9 2001/07/31 13:36:54 cox Exp $ +// $Id: Packager.php,v 1.10 2001/08/19 12:30:24 cox Exp $ require_once 'PEAR/Common.php'; @@ -154,19 +154,24 @@ return $this->raiseError("could not mkdir $dir"); } } + //Maintain original file perms + $orig_perms = fileperms($fname); if (!@copy($fname, $file)) { $this->log(0, "could not copy $fname to $file"); } else { $this->log(2, "+ copying from $fname to $file"); } + chmod($file, $orig_perms); } // XXX TODO: Rebuild the package file as the old method did? // 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); + $dest_pkgfile = $this->tmpdir . DIRECTORY_SEPARATOR . 'package.xml'; + $this->log(2, "+ copying package $pkgfile to $dest_pkgfile"); + if (!@copy($pkgfile, $dest_pkgfile)) { + return $this->raiseError("could not copy $pkgfile to $dest_pkgfile"); } - $this->log(2, "+ copying package $pkgfile to " . $this->tmpdir); + chmod($dest_pkgfile, 0644); // TAR the Package ------------------------------------------- chdir(dirname($this->tmpdir)); Index: php4/pear/PEAR/Installer.php diff -u php4/pear/PEAR/Installer.php:1.16 php4/pear/PEAR/Installer.php:1.17 --- php4/pear/PEAR/Installer.php:1.16 Wed Aug 1 09:24:55 2001 +++ php4/pear/PEAR/Installer.php Sun Aug 19 08:30:24 2001 @@ -18,7 +18,7 @@ // | | // +----------------------------------------------------------------------+ // -// $Id: Installer.php,v 1.16 2001/08/01 13:24:55 cox Exp $ +// $Id: Installer.php,v 1.17 2001/08/19 12:30:24 cox Exp $ require_once "PEAR/Common.php"; @@ -227,10 +227,12 @@ } $this->log(2, "+ created dir $dest_dir"); } + $orig_perms = fileperms($file); if (!@copy($file, $dest_file)) { $this->log(0, "failed to copy $file to $dest_file"); return false; } + chmod($dest_file, $orig_perms); $this->log(2, "+ copy $file to $dest_file"); // FIXME Update Package database here //$this->updatePackageListFrom("$d/$file");

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