diff options
author | Tomas V.V.Cox <cox@php.net> | 2001-08-19 12:30:24 +0000 |
---|---|---|
committer | Tomas V.V.Cox <cox@php.net> | 2001-08-19 12:30:24 +0000 |
commit | cf70755a051498393f59fd45246b7c558be7efd4 (patch) | |
tree | c3ae8d3d738b28189c741c8e45d50f7c4901fdde /pear/PEAR/Packager.php | |
parent | fd4de85836ff4c1df8190fc5a519f57b2d28ef13 (diff) | |
download | php-git-cf70755a051498393f59fd45246b7c558be7efd4.tar.gz |
maintain original file perms
Diffstat (limited to 'pear/PEAR/Packager.php')
-rw-r--r-- | pear/PEAR/Packager.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/pear/PEAR/Packager.php b/pear/PEAR/Packager.php index b790ac956f..0df36e03e1 100644 --- a/pear/PEAR/Packager.php +++ b/pear/PEAR/Packager.php @@ -154,19 +154,24 @@ class PEAR_Packager extends PEAR_Common 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)); |