mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
* lose obsolete tags: libfile, libname, sources, includes, libadd
This commit is contained in:
parent
2ac7c4f2de
commit
b066da4e65
3 changed files with 91 additions and 135 deletions
|
@ -119,6 +119,12 @@ class PEAR_Common extends PEAR
|
||||||
|
|
||||||
var $current_path = null;
|
var $current_path = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PEAR_SourceAnalyzer instance
|
||||||
|
* @var object
|
||||||
|
*/
|
||||||
|
var $source_analyzer = null;
|
||||||
|
|
||||||
// }}}
|
// }}}
|
||||||
|
|
||||||
// {{{ constructor
|
// {{{ constructor
|
||||||
|
@ -418,13 +424,6 @@ class PEAR_Common extends PEAR
|
||||||
$this->filelist[$this->current_path]['replacements'][] = $attribs;
|
$this->filelist[$this->current_path]['replacements'][] = $attribs;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'libfile':
|
|
||||||
if (!$this->in_changelog) {
|
|
||||||
$this->lib_atts = $attribs;
|
|
||||||
$this->lib_atts['role'] = 'extsrc';
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'maintainers':
|
case 'maintainers':
|
||||||
$this->pkginfo['maintainers'] = array();
|
$this->pkginfo['maintainers'] = array();
|
||||||
$this->m_i = 0; // maintainers array index
|
$this->m_i = 0; // maintainers array index
|
||||||
|
@ -563,9 +562,6 @@ class PEAR_Common extends PEAR
|
||||||
case 'license':
|
case 'license':
|
||||||
$this->pkginfo['release_license'] = $data;
|
$this->pkginfo['release_license'] = $data;
|
||||||
break;
|
break;
|
||||||
case 'sources':
|
|
||||||
$this->lib_sources[] = $data;
|
|
||||||
break;
|
|
||||||
case 'dep':
|
case 'dep':
|
||||||
if ($data && !$this->in_changelog) {
|
if ($data && !$this->in_changelog) {
|
||||||
$this->pkginfo['release_deps'][$this->d_i]['name'] = $data;
|
$this->pkginfo['release_deps'][$this->d_i]['name'] = $data;
|
||||||
|
@ -602,37 +598,6 @@ class PEAR_Common extends PEAR
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'libfile':
|
|
||||||
if ($this->in_changelog) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$path = '';
|
|
||||||
if (!empty($this->dir_names)) {
|
|
||||||
foreach ($this->dir_names as $dir) {
|
|
||||||
$path .= $dir . DIRECTORY_SEPARATOR;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$path .= $this->lib_name;
|
|
||||||
$this->filelist[$path] = $this->lib_atts;
|
|
||||||
// Set the baseinstalldir only if the file don't have this attrib
|
|
||||||
if (!isset($this->filelist[$path]['baseinstalldir']) &&
|
|
||||||
isset($this->dir_install))
|
|
||||||
{
|
|
||||||
$this->filelist[$path]['baseinstalldir'] = $this->dir_install;
|
|
||||||
}
|
|
||||||
if (isset($this->lib_sources)) {
|
|
||||||
$this->filelist[$path]['sources'] = implode(' ', $this->lib_sources);
|
|
||||||
}
|
|
||||||
unset($this->lib_atts);
|
|
||||||
unset($this->lib_sources);
|
|
||||||
unset($this->lib_name);
|
|
||||||
break;
|
|
||||||
case 'libname':
|
|
||||||
if ($this->in_changelog) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$this->lib_name = $data;
|
|
||||||
break;
|
|
||||||
case 'maintainer':
|
case 'maintainer':
|
||||||
if (empty($this->pkginfo['maintainers'][$this->m_i]['role'])) {
|
if (empty($this->pkginfo['maintainers'][$this->m_i]['role'])) {
|
||||||
$this->pkginfo['maintainers'][$this->m_i]['role'] = 'lead';
|
$this->pkginfo['maintainers'][$this->m_i]['role'] = 'lead';
|
||||||
|
@ -807,6 +772,44 @@ class PEAR_Common extends PEAR
|
||||||
}
|
}
|
||||||
return $this->pkginfo;
|
return $this->pkginfo;
|
||||||
}
|
}
|
||||||
|
// }}}
|
||||||
|
// {{{ infoFromAny()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns package information from different sources
|
||||||
|
*
|
||||||
|
* This method is able to extract information about a package
|
||||||
|
* from a .tgz archive or from a XML package definition file.
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @param string Filename of the source ('package.xml', '<package>.tgz')
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function infoFromAny($info)
|
||||||
|
{
|
||||||
|
if (is_string($info) && file_exists($info)) {
|
||||||
|
$tmp = substr($info, -4);
|
||||||
|
if ($tmp == '.xml') {
|
||||||
|
$info = $this->infoFromDescriptionFile($info);
|
||||||
|
} elseif ($tmp == '.tar' || $tmp == '.tgz') {
|
||||||
|
$info = $this->infoFromTgzFile($info);
|
||||||
|
} else {
|
||||||
|
$fp = fopen($info, "r");
|
||||||
|
$test = fread($fp, 5);
|
||||||
|
fclose($fp);
|
||||||
|
if ($test == "<?xml") {
|
||||||
|
$info = $this->infoFromDescriptionFile($info);
|
||||||
|
} else {
|
||||||
|
$info = $this->infoFromTgzFile($info);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (PEAR::isError($info)) {
|
||||||
|
return $this->raiseError($info);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $info;
|
||||||
|
}
|
||||||
|
|
||||||
// }}}
|
// }}}
|
||||||
// {{{ xmlFromInfo()
|
// {{{ xmlFromInfo()
|
||||||
|
|
||||||
|
@ -925,41 +928,34 @@ class PEAR_Common extends PEAR
|
||||||
if (isset($pkginfo['filelist'])) {
|
if (isset($pkginfo['filelist'])) {
|
||||||
$ret .= "$indent <filelist>\n";
|
$ret .= "$indent <filelist>\n";
|
||||||
foreach ($pkginfo['filelist'] as $file => $fa) {
|
foreach ($pkginfo['filelist'] as $file => $fa) {
|
||||||
if (@$fa['role'] == 'extsrc') {
|
@$ret .= "$indent <file role=\"$fa[role]\"";
|
||||||
$ret .= "$indent <libfile>\n";
|
if (isset($fa['baseinstalldir'])) {
|
||||||
$ret .= "$indent <libname>$file</libname>\n";
|
$ret .= ' baseinstalldir="' .
|
||||||
$ret .= "$indent <sources>$fa[sources]</sources>\n";
|
htmlspecialchars($fa['baseinstalldir']) . '"';
|
||||||
$ret .= "$indent </libfile>\n";
|
}
|
||||||
|
if (isset($fa['md5sum'])) {
|
||||||
|
$ret .= " md5sum=\"$fa[md5sum]\"";
|
||||||
|
}
|
||||||
|
if (isset($fa['platform'])) {
|
||||||
|
$ret .= " platform=\"$fa[platform]\"";
|
||||||
|
}
|
||||||
|
if (!empty($fa['install-as'])) {
|
||||||
|
$ret .= ' install-as="' .
|
||||||
|
htmlspecialchars($fa['install-as']) . '"';
|
||||||
|
}
|
||||||
|
$ret .= ' name="' . htmlspecialchars($file) . '"';
|
||||||
|
if (empty($fa['replacements'])) {
|
||||||
|
$ret .= "/>\n";
|
||||||
} else {
|
} else {
|
||||||
@$ret .= "$indent <file role=\"$fa[role]\"";
|
$ret .= ">\n";
|
||||||
if (isset($fa['baseinstalldir'])) {
|
foreach ($fa['replacements'] as $r) {
|
||||||
$ret .= ' baseinstalldir="' .
|
$ret .= "$indent <replace";
|
||||||
htmlspecialchars($fa['baseinstalldir']) . '"';
|
foreach ($r as $k => $v) {
|
||||||
}
|
$ret .= " $k=\"" . htmlspecialchars($v) .'"';
|
||||||
if (isset($fa['md5sum'])) {
|
|
||||||
$ret .= " md5sum=\"$fa[md5sum]\"";
|
|
||||||
}
|
|
||||||
if (isset($fa['platform'])) {
|
|
||||||
$ret .= " platform=\"$fa[platform]\"";
|
|
||||||
}
|
|
||||||
if (!empty($fa['install-as'])) {
|
|
||||||
$ret .= ' install-as="' .
|
|
||||||
htmlspecialchars($fa['install-as']) . '"';
|
|
||||||
}
|
|
||||||
$ret .= ' name="' . htmlspecialchars($file) . '"';
|
|
||||||
if (empty($fa['replacements'])) {
|
|
||||||
$ret .= "/>\n";
|
|
||||||
} else {
|
|
||||||
$ret .= ">\n";
|
|
||||||
foreach ($fa['replacements'] as $r) {
|
|
||||||
$ret .= "$indent <replace";
|
|
||||||
foreach ($r as $k => $v) {
|
|
||||||
$ret .= " $k=\"" . htmlspecialchars($v) .'"';
|
|
||||||
}
|
|
||||||
$ret .= "/>\n";
|
|
||||||
}
|
}
|
||||||
@$ret .= "$indent </file>\n";
|
$ret .= "/>\n";
|
||||||
}
|
}
|
||||||
|
@$ret .= "$indent </file>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$ret .= "$indent </filelist>\n";
|
$ret .= "$indent </filelist>\n";
|
||||||
|
@ -968,44 +964,6 @@ class PEAR_Common extends PEAR
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
// }}}
|
|
||||||
// {{{ infoFromAny()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns package information from different sources
|
|
||||||
*
|
|
||||||
* This method is able to extract information about a package
|
|
||||||
* from a .tgz archive or from a XML package definition file.
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @param string Filename of the source ('package.xml', '<package>.tgz')
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
function infoFromAny($info)
|
|
||||||
{
|
|
||||||
if (is_string($info) && file_exists($info)) {
|
|
||||||
$tmp = substr($info, -4);
|
|
||||||
if ($tmp == '.xml') {
|
|
||||||
$info = $this->infoFromDescriptionFile($info);
|
|
||||||
} elseif ($tmp == '.tar' || $tmp == '.tgz') {
|
|
||||||
$info = $this->infoFromTgzFile($info);
|
|
||||||
} else {
|
|
||||||
$fp = fopen($info, "r");
|
|
||||||
$test = fread($fp, 5);
|
|
||||||
fclose($fp);
|
|
||||||
if ($test == "<?xml") {
|
|
||||||
$info = $this->infoFromDescriptionFile($info);
|
|
||||||
} else {
|
|
||||||
$info = $this->infoFromTgzFile($info);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (PEAR::isError($info)) {
|
|
||||||
return $this->raiseError($info);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $info;
|
|
||||||
}
|
|
||||||
|
|
||||||
// }}}
|
// }}}
|
||||||
// {{{ validatePackageInfo()
|
// {{{ validatePackageInfo()
|
||||||
|
|
||||||
|
@ -1131,12 +1089,10 @@ class PEAR_Common extends PEAR
|
||||||
$errors[] = "file $file: missing role";
|
$errors[] = "file $file: missing role";
|
||||||
} elseif (!in_array($fa['role'], $_PEAR_Common_file_roles)) {
|
} elseif (!in_array($fa['role'], $_PEAR_Common_file_roles)) {
|
||||||
$errors[] = "file $file: invalid role, should be one of: ".implode(' ', $_PEAR_Common_file_roles);
|
$errors[] = "file $file: invalid role, should be one of: ".implode(' ', $_PEAR_Common_file_roles);
|
||||||
} elseif ($fa['role'] == 'extsrc' && empty($fa['sources'])) {
|
|
||||||
$errors[] = "file $file: no source files";
|
|
||||||
}
|
}
|
||||||
// (ssb) Any checks we can do for baseinstalldir?
|
// (ssb) Any checks we can do for baseinstalldir?
|
||||||
// (cox) Perhaps checks that either the target dir and baseInstall
|
// (cox) Perhaps checks that either the target dir and
|
||||||
// doesn't cointain "../../"
|
// baseInstall doesn't cointain "../../"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -31,16 +31,11 @@
|
||||||
</maintainer>
|
</maintainer>
|
||||||
</maintainers>
|
</maintainers>
|
||||||
<release>
|
<release>
|
||||||
<version>1.0b2</version>
|
<version>1.0b3-dev</version>
|
||||||
<state>stable</state>
|
<state>stable</state>
|
||||||
<date>2002-11-26</date>
|
<date>2002-12-01</date>
|
||||||
<notes>
|
<notes>
|
||||||
Changes, Installer:
|
* fixed "info" shortcut (conflicted with "install")
|
||||||
* --force option no longer ignores errors, use
|
|
||||||
--ignore-errors instead
|
|
||||||
* installer transactions: failed installs abort
|
|
||||||
cleanly, without leaving half-installed packages
|
|
||||||
around
|
|
||||||
</notes>
|
</notes>
|
||||||
<filelist>
|
<filelist>
|
||||||
<file role="data" name="package.dtd"/>
|
<file role="data" name="package.dtd"/>
|
||||||
|
@ -91,6 +86,19 @@ Changes, Installer:
|
||||||
</deps>
|
</deps>
|
||||||
</release>
|
</release>
|
||||||
<changelog>
|
<changelog>
|
||||||
|
<release>
|
||||||
|
<version>1.0b2</version>
|
||||||
|
<state>stable</state>
|
||||||
|
<date>2002-11-26</date>
|
||||||
|
<notes>
|
||||||
|
Changes, Installer:
|
||||||
|
* --force option no longer ignores errors, use
|
||||||
|
--ignore-errors instead
|
||||||
|
* installer transactions: failed installs abort
|
||||||
|
cleanly, without leaving half-installed packages
|
||||||
|
around
|
||||||
|
</notes>
|
||||||
|
</release>
|
||||||
<release>
|
<release>
|
||||||
<version>1.0b1</version>
|
<version>1.0b1</version>
|
||||||
<state>stable</state>
|
<state>stable</state>
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
<!--
|
<!--
|
||||||
$Id: package.dtd,v 1.27 2002-07-21 07:06:56 ssb Exp $
|
$Id: package.dtd,v 1.28 2002-11-26 22:52:34 ssb Exp $
|
||||||
|
|
||||||
This is the PEAR package description, version 1.0b9.
|
This is the PEAR package description, version 1.0b9.
|
||||||
It should be used with the informal public identifier:
|
It should be used with the informal public identifier:
|
||||||
|
|
||||||
"-//PHP Group//DTD PEAR Package 1.0b9//EN//XML"
|
"-//PHP Group//DTD PEAR Package 1.0b10//EN//XML"
|
||||||
|
|
||||||
Copyright (c) 1997-2002 The PHP Group
|
Copyright (c) 1997-2002 The PHP Group
|
||||||
|
|
||||||
|
@ -55,9 +55,9 @@
|
||||||
|
|
||||||
<!ELEMENT notes (#PCDATA)>
|
<!ELEMENT notes (#PCDATA)>
|
||||||
|
|
||||||
<!ELEMENT filelist (dir|file|libfile)+>
|
<!ELEMENT filelist (dir|file)+>
|
||||||
|
|
||||||
<!ELEMENT dir (dir|file|libfile)+>
|
<!ELEMENT dir (dir|file)+>
|
||||||
<!ATTLIST dir name CDATA #REQUIRED
|
<!ATTLIST dir name CDATA #REQUIRED
|
||||||
baseinstalldir CDATA #IMPLIED>
|
baseinstalldir CDATA #IMPLIED>
|
||||||
|
|
||||||
|
@ -79,14 +79,6 @@
|
||||||
to CDATA #REQUIRED
|
to CDATA #REQUIRED
|
||||||
type CDATA #REQUIRED>
|
type CDATA #REQUIRED>
|
||||||
|
|
||||||
<!ELEMENT libfile (libname|sources|includes|libadd)+>
|
|
||||||
|
|
||||||
<!ELEMENT libname (#PCDATA)>
|
|
||||||
|
|
||||||
<!ELEMENT sources (#PCDATA)>
|
|
||||||
|
|
||||||
<!ELEMENT libadd (#PCDATA)>
|
|
||||||
|
|
||||||
<!ELEMENT deps (dep)+>
|
<!ELEMENT deps (dep)+>
|
||||||
|
|
||||||
<!ELEMENT dep (#PCDATA)>
|
<!ELEMENT dep (#PCDATA)>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue