Index: PEAR/PackageFile/Generator/v2.php =================================================================== RCS file: /repository/pear-core/PEAR/PackageFile/Generator/v2.php,v retrieving revision 1.38 diff -u -r1.38 v2.php --- PEAR/PackageFile/Generator/v2.php 3 Jan 2008 20:26:37 -0000 1.38 +++ PEAR/PackageFile/Generator/v2.php 9 Apr 2008 14:34:19 -0000 @@ -213,6 +213,7 @@ if (!file_exists($file)) { return $packager->raiseError("File does not exist: $fname"); } else { + $origperms = fileperms($file); $tfile = $packageDir . DIRECTORY_SEPARATOR . $fname; unset($orig['attribs']); if (count($orig)) { // file with tasks @@ -244,6 +245,8 @@ if (!file_exists($tfile)) { System::mkdir(array('-p', dirname($tfile))); copy($file, $tfile); + } else { + chmod($tfile, $origperms); } $filelist[$i++] = $tfile; $this->_packagefile->setFileAttribute($fname, 'md5sum', md5_file($tfile), $i - 1);