mirror of
https://github.com/php/php-src.git
synced 2025-08-19 17:04:47 +02:00
* accept optional tmpdir arg in mkTempDir
* handle changelog releases without filelist
This commit is contained in:
parent
8474d7944d
commit
a50c40cc24
1 changed files with 29 additions and 23 deletions
|
@ -169,13 +169,22 @@ class PEAR_Common extends PEAR
|
||||||
/**
|
/**
|
||||||
* Create and register a temporary directory.
|
* Create and register a temporary directory.
|
||||||
*
|
*
|
||||||
|
* @param string (optional) Directory to use as tmpdir. Will use
|
||||||
|
* system defaults (for example /tmp or c:\windows\temp) if not
|
||||||
|
* specified
|
||||||
|
*
|
||||||
* @return string name of created directory
|
* @return string name of created directory
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function mkTempDir()
|
function mkTempDir($tmpdir = '')
|
||||||
{
|
{
|
||||||
if (!$tmpdir = System::mktemp('-d pear')) {
|
if ($tmpdir) {
|
||||||
|
$topt = "-t $tmpdir ";
|
||||||
|
} else {
|
||||||
|
$topt = '';
|
||||||
|
}
|
||||||
|
if (!$tmpdir = System::mktemp($topt . '-d pear')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$this->addTempFile($tmpdir);
|
$this->addTempFile($tmpdir);
|
||||||
|
@ -662,7 +671,6 @@ class PEAR_Common extends PEAR
|
||||||
if (@sizeof($pkginfo['changelog']) > 0) {
|
if (@sizeof($pkginfo['changelog']) > 0) {
|
||||||
$ret .= " <changelog>\n";
|
$ret .= " <changelog>\n";
|
||||||
foreach ($pkginfo['changelog'] as $oldrelease) {
|
foreach ($pkginfo['changelog'] as $oldrelease) {
|
||||||
var_dump($oldrelease);
|
|
||||||
$ret .= $this->_makeReleaseXml($oldrelease, true);
|
$ret .= $this->_makeReleaseXml($oldrelease, true);
|
||||||
}
|
}
|
||||||
$ret .= " </changelog>\n";
|
$ret .= " </changelog>\n";
|
||||||
|
@ -718,14 +726,8 @@ class PEAR_Common extends PEAR
|
||||||
}
|
}
|
||||||
$ret .= "$indent </deps>\n";
|
$ret .= "$indent </deps>\n";
|
||||||
}
|
}
|
||||||
|
if (isset($pkginfo['filelist'])) {
|
||||||
$ret .= "$indent <filelist>\n";
|
$ret .= "$indent <filelist>\n";
|
||||||
/*
|
|
||||||
ob_start();
|
|
||||||
var_dump($pkginfo['filelist']);
|
|
||||||
$tmp = ob_get_contents();
|
|
||||||
ob_end_clean();
|
|
||||||
$ret .= $tmp;
|
|
||||||
*/
|
|
||||||
foreach ($pkginfo['filelist'] as $file => $fa) {
|
foreach ($pkginfo['filelist'] as $file => $fa) {
|
||||||
if ($fa['role'] == 'extsrc') {
|
if ($fa['role'] == 'extsrc') {
|
||||||
$ret .= "$indent <libfile>\n";
|
$ret .= "$indent <libfile>\n";
|
||||||
|
@ -737,10 +739,14 @@ class PEAR_Common extends PEAR
|
||||||
if (isset($fa['baseinstalldir'])) {
|
if (isset($fa['baseinstalldir'])) {
|
||||||
$ret .= " baseinstalldir=\"$fa[baseinstalldir]\"";
|
$ret .= " baseinstalldir=\"$fa[baseinstalldir]\"";
|
||||||
}
|
}
|
||||||
|
if (isset($fa['md5sum'])) {
|
||||||
|
$ret .= " md5sum=\"$fa[md5sum]\"";
|
||||||
|
}
|
||||||
$ret .= ">$file</file>\n";
|
$ret .= ">$file</file>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$ret .= "$indent </filelist>\n";
|
$ret .= "$indent </filelist>\n";
|
||||||
|
}
|
||||||
$ret .= "$indent </release>\n";
|
$ret .= "$indent </release>\n";
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue