mirror of
https://github.com/php/php-src.git
synced 2024-11-28 12:26:37 +08:00
* doooh!
This commit is contained in:
parent
4a2c9980b8
commit
948106fd20
@ -95,7 +95,7 @@ class PEAR_Packager extends PEAR_Common
|
||||
// Copy files -----------------------------------------------
|
||||
foreach ($pkginfo['filelist'] as $fname => $atts) {
|
||||
if (!file_exists($fname)) {
|
||||
chdir($this->orig_cwd);
|
||||
chdir($this->orig_pwd);
|
||||
return $this->raiseError("File $fname does not exist");
|
||||
} else {
|
||||
$filelist[$i++] = $fname;
|
||||
@ -108,14 +108,14 @@ class PEAR_Packager extends PEAR_Common
|
||||
}
|
||||
$new_xml = $this->xmlFromInfo($pkginfo);
|
||||
if (PEAR::isError($new_xml)) {
|
||||
chdir($this->orig_cwd);
|
||||
chdir($this->orig_pwd);
|
||||
return $this->raiseError($new_xml);
|
||||
}
|
||||
$tmpdir = $this->mkTempDir(getcwd());
|
||||
$newpkgfile = $tmpdir . DIRECTORY_SEPARATOR . 'package.xml';
|
||||
$np = @fopen($newpkgfile, "w");
|
||||
if (!$np) {
|
||||
chdir($this->orig_cwd);
|
||||
chdir($this->orig_pwd);
|
||||
return $this->raiseError("PEAR_Packager: unable to rewrite $pkgfile");
|
||||
}
|
||||
fwrite($np, $new_xml);
|
||||
@ -129,15 +129,15 @@ class PEAR_Packager extends PEAR_Common
|
||||
// ----- Creates with the package.xml file
|
||||
$ok = $tar->createModify($newpkgfile, '', $tmpdir);
|
||||
if (PEAR::isError($ok)) {
|
||||
chdir($this->orig_cwd);
|
||||
chdir($this->orig_pwd);
|
||||
return $this->raiseError($ok);
|
||||
} elseif (!$ok) {
|
||||
chdir($this->orig_cwd);
|
||||
chdir($this->orig_pwd);
|
||||
return $this->raiseError('PEAR_Packager: tarball creation failed');
|
||||
}
|
||||
// ----- Add the content of the package
|
||||
if (!$tar->addModify($filelist, $pkgver)) {
|
||||
chdir($this->orig_cwd);
|
||||
chdir($this->orig_pwd);
|
||||
return $this->raiseError('PEAR_Packager: tarball creation failed');
|
||||
}
|
||||
$this->log(1, "Package $dest_package done");
|
||||
@ -147,7 +147,7 @@ class PEAR_Packager extends PEAR_Common
|
||||
$this->log(1, "Tag the released code with `pear cvstag $pkgfile'");
|
||||
$this->log(1, "(or set the CVS tag $cvstag by hand)");
|
||||
}
|
||||
chdir($this->orig_cwd);
|
||||
chdir($this->orig_pwd);
|
||||
return $dest_package;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user