Update pear package to 1.9.4.
pkgsrc change * Remove unused XMLUTIL_WRKSRC. * don't patch a file which we have in our tree, go-pear.php - Remove unused code. - Prevent deprecated warnings on PHP 5.3.x. PEAR 1.9.4: Release date: 2011-07-07 00:27 UTC Release state: stable Changelog: Bug Fixes: * Bug #17350: "pear install --force" doesn't uninstall files from previous pkg versions [dufuz] * Bug #18362: A whitespace TEMP_DIR path breaks install/upgrade functionality [dufuz] * Bug #18440: bad tmp folder path on install : Unable to create path for C:/Program/tmp [dufuz] * Bug #18581: "config-get -c" not returning channel's configuration when using alias [dufuz] * Bug #18639: regression: installing xdebug fails most likely due to another fix [dufuz] Features * All System (the class) functions can now take in spaced paths as long as they are surrounded in quotes. Prior to this it was possible to do that by passing all values in as an array (by product of #18362, #18440)
This commit is contained in:
parent
9fa309d76f
commit
e833a78124
5 changed files with 38 additions and 605 deletions
|
@ -1,7 +1,7 @@
|
|||
# $NetBSD: Makefile,v 1.18 2011/06/19 15:40:21 taca Exp $
|
||||
# $NetBSD: Makefile,v 1.19 2011/08/20 14:02:29 taca Exp $
|
||||
#
|
||||
|
||||
DISTNAME= PEAR-1.9.3
|
||||
DISTNAME= PEAR-1.9.4
|
||||
PKGNAME= ${PHP_PKG_PREFIX}-${DISTNAME:S/PEAR/pear/}
|
||||
CATEGORIES= lang
|
||||
MASTER_SITES= http://download.pear.php.net/package/
|
||||
|
@ -47,9 +47,8 @@ STRUCTURES_SRCS= Structures_Graph-1.0.4${EXTRACT_SUFX}
|
|||
DISTFILES+= ${STRUCTURES_SRCS}
|
||||
|
||||
XMLUTIL_SRCS= XML_Util-1.2.1${EXTRACT_SUFX}
|
||||
XMLUTIL_WRKSRC= ${WRKDIR}/${XMLUTIL_SRCS:S/${EXTRACT_SUFX}//}
|
||||
DISTFILES+= ${XMLUTIL_SRCS}
|
||||
EXTRACT_ONLY+= ${XMLUTIL_SRCS}
|
||||
|
||||
#
|
||||
# end of base components
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$NetBSD: distinfo,v 1.10 2011/06/19 15:40:21 taca Exp $
|
||||
$NetBSD: distinfo,v 1.11 2011/08/20 14:02:29 taca Exp $
|
||||
|
||||
SHA1 (Archive_Tar-1.3.7.tgz) = 5b35a8c3bfa34ba8b29c5208f8f37504d0ce280c
|
||||
RMD160 (Archive_Tar-1.3.7.tgz) = 0b018556bf4d916440e0e661e714986edd728de2
|
||||
|
@ -6,13 +6,12 @@ Size (Archive_Tar-1.3.7.tgz) = 17610 bytes
|
|||
SHA1 (Console_Getopt-1.3.1.tgz) = 8f9ac495728ee9ba87edd109c3946f11ee72bc08
|
||||
RMD160 (Console_Getopt-1.3.1.tgz) = aae10ad272bf2a66bc80d899f60cb8e630f90d16
|
||||
Size (Console_Getopt-1.3.1.tgz) = 4471 bytes
|
||||
SHA1 (PEAR-1.9.3.tgz) = c214bb9d5e1fb9e3c5b99d2af9ae9501ccd55206
|
||||
RMD160 (PEAR-1.9.3.tgz) = eb227ec284d63e9df3d78863d2b9cf2952befe93
|
||||
Size (PEAR-1.9.3.tgz) = 295774 bytes
|
||||
SHA1 (PEAR-1.9.4.tgz) = 7c4e88ae5064827507b2c9ae0108eb5972d900db
|
||||
RMD160 (PEAR-1.9.4.tgz) = 8c57e069d305470a9313d1a617e6dd9b6d07ef08
|
||||
Size (PEAR-1.9.4.tgz) = 296332 bytes
|
||||
SHA1 (Structures_Graph-1.0.4.tgz) = 00f5c2aefad0c3f6490e5ca95da87828e64ebc57
|
||||
RMD160 (Structures_Graph-1.0.4.tgz) = d236ddff4a31cafa6fa750b4ec4a0849c48ad3f6
|
||||
Size (Structures_Graph-1.0.4.tgz) = 30318 bytes
|
||||
SHA1 (XML_Util-1.2.1.tgz) = 8072216577fb9ad684f15e0388ab0b1c0b57e2d4
|
||||
RMD160 (XML_Util-1.2.1.tgz) = 9d9dd43889312f46f39c9a43a800a8f2d8f6e9b2
|
||||
Size (XML_Util-1.2.1.tgz) = 17729 bytes
|
||||
SHA1 (patch-aa) = 6de18a37aa927f7c84f31bdad9ce7f813ea3ee4e
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
* $NetBSD: PEAR.php,v 1.1 2009/10/29 08:29:03 seb Exp $
|
||||
* $NetBSD: PEAR.php,v 1.2 2011/08/20 14:02:29 taca Exp $
|
||||
*
|
||||
* This is http://cvs.php.net/viewvc.cgi/pear-core/PEAR.php?view=co&pathrev=PEAR_1_4
|
||||
*
|
||||
|
@ -569,10 +569,10 @@ class PEAR
|
|||
$ec = 'PEAR_Error';
|
||||
}
|
||||
if ($skipmsg) {
|
||||
$a = &new $ec($code, $mode, $options, $userinfo);
|
||||
$a = new $ec($code, $mode, $options, $userinfo);
|
||||
return $a;
|
||||
} else {
|
||||
$a = &new $ec($message, $code, $mode, $options, $userinfo);
|
||||
$a = new $ec($message, $code, $mode, $options, $userinfo);
|
||||
return $a;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
* @author Tias Guns <tias@ulyssis.org>
|
||||
*/
|
||||
|
||||
/* $NetBSD: go-pear.php,v 1.3 2011/06/19 15:40:21 taca Exp $ */
|
||||
/* $NetBSD: go-pear.php,v 1.4 2011/08/20 14:02:29 taca Exp $ */
|
||||
|
||||
$sapi_name = php_sapi_name();
|
||||
|
||||
|
@ -58,6 +58,8 @@ define('GO_PEAR_VER', '1.1.2');
|
|||
|
||||
define('WIN32GUI', !WEBINSTALLER && WINDOWS && $sapi_name=='cli' && which('cscript'));
|
||||
|
||||
$destdir = getenv('DESTDIR');
|
||||
|
||||
/*
|
||||
* See bug #23069
|
||||
*/
|
||||
|
@ -102,6 +104,9 @@ Please upgrade PHP to a newer version, and try again. See you then.
|
|||
|
||||
");
|
||||
}
|
||||
if (version_compare(phpversion(), "5.3.0", '>')) {
|
||||
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
|
||||
}
|
||||
|
||||
$gopear_bundle_dir = dirname(__FILE__).'/go-pear-bundle';
|
||||
|
||||
|
@ -254,50 +259,6 @@ if (WEBINSTALLER) {
|
|||
// Anything past this step has something to do with the installation
|
||||
}
|
||||
|
||||
if (!WEBINSTALLER) {
|
||||
$tty = WINDOWS ? @fopen('\con', 'r') : @fopen('/dev/tty', 'r');
|
||||
|
||||
if (!$tty) {
|
||||
$tty = fopen('php://stdin', 'r');
|
||||
}
|
||||
|
||||
$local = isset($_SERVER['argv'][1]) && $_SERVER['argv'][1] == 'local';
|
||||
if ($local) {
|
||||
$local = "
|
||||
Running in local install mode
|
||||
";
|
||||
} elseif (WINDOWS) {
|
||||
$local = "
|
||||
Use 'php " . $_SERVER['argv'][0] . " local' to install a local copy of PEAR.
|
||||
";
|
||||
}
|
||||
print "Welcome to go-pear!
|
||||
|
||||
Go-pear will install the 'pear' command and all the files needed by
|
||||
it. This command is your tool for PEAR installation and maintenance.
|
||||
$local
|
||||
Go-pear also lets you download and install the following optional PEAR
|
||||
packages: " . implode(', ', array_keys($pfc_packages)) . ".
|
||||
|
||||
|
||||
If you wish to abort, press Control-C now, or press Enter to continue: ";
|
||||
|
||||
fgets($tty, 1024);
|
||||
|
||||
print "\n";
|
||||
|
||||
print "HTTP proxy (http://user:password@proxy.myhost.com:port), or Enter for none:";
|
||||
|
||||
if (!empty($http_proxy)) {
|
||||
print " [$http_proxy]";
|
||||
}
|
||||
print ": ";
|
||||
$tmp = trim(fgets($tty, 1024));
|
||||
if (!empty($tmp)) {
|
||||
$http_proxy = $tmp;
|
||||
}
|
||||
}
|
||||
|
||||
$origpwd = getcwd();
|
||||
|
||||
$config_vars = array_keys($config_desc);
|
||||
|
@ -349,89 +310,6 @@ we strongly recommand to use it.
|
|||
}
|
||||
}
|
||||
|
||||
while (!WEBINSTALLER) {
|
||||
print "
|
||||
Below is a suggested file layout for your new PEAR installation. To
|
||||
change individual locations, type the number in front of the
|
||||
directory. Type 'all' to change all of them or simply press Enter to
|
||||
accept these locations.
|
||||
|
||||
";
|
||||
|
||||
foreach ($config_vars as $n => $var) {
|
||||
printf("%2d. $descfmt : %s\n", $n, $config_desc[$var], $$var);
|
||||
}
|
||||
|
||||
print "\n$first-$last, 'all' or Enter to continue: ";
|
||||
$tmp = trim(fgets($tty, 1024));
|
||||
if ( empty($tmp) ) {
|
||||
if( WINDOWS && !$php_bin_set ){
|
||||
echo "**ERROR**
|
||||
Please, enter the php.exe path.
|
||||
|
||||
";
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (isset($config_vars[(int)$tmp])) {
|
||||
$var = $config_vars[(int)$tmp];
|
||||
$desc = $config_desc[$var];
|
||||
$current = $$var;
|
||||
|
||||
if(WIN32GUI){
|
||||
$tmp = win32BrowseForFolder("$desc [$current] :");
|
||||
} else {
|
||||
print "$desc [$current] : ";
|
||||
$tmp = trim(fgets($tty, 1024));
|
||||
}
|
||||
|
||||
$old = $$var;
|
||||
if(WINDOWS && $var=='php_bin' ){
|
||||
if(file_exists($tmp.DIRECTORY_SEPARATOR.'php.exe')){
|
||||
$tmp = $tmp.DIRECTORY_SEPARATOR.'php.exe';
|
||||
$php_bin_sapi = win32DetectPHPSAPI();
|
||||
if($php_bin_sapi=='cgi'){
|
||||
print "
|
||||
******************************************************************************
|
||||
NOTICE! We found php.exe under $php_bin, it uses a $php_bin_sapi SAPI.
|
||||
PEAR commandline tool works well with it.
|
||||
If you have a CLI php.exe available, we recommand to use it.
|
||||
|
||||
";
|
||||
} elseif ($php_bin_sapi=='unknown') {
|
||||
print "
|
||||
******************************************************************************
|
||||
WARNING! We found php.exe under $php_bin, it uses an $php_bin_sapi SAPI.
|
||||
PEAR commandline tool has not been tested with it.
|
||||
If you have a CLI (or CGI) php.exe available, we strongly recommand to use it.
|
||||
|
||||
";
|
||||
}
|
||||
echo "php.exe (sapi: $php_bin_sapi) found.\n\n";
|
||||
$php_bin_set = true;
|
||||
} else {
|
||||
echo "**ERROR**: no php.exe found in this folder.\n";
|
||||
$tmp='';
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($tmp) ) {
|
||||
$$var = parse_dirname($tmp);
|
||||
}
|
||||
} elseif ($tmp == 'all') {
|
||||
foreach ($config_vars as $n => $var) {
|
||||
$desc = $config_desc[$var];
|
||||
$current = $$var;
|
||||
print "$desc [$current] : ";
|
||||
$tmp = trim(fgets($tty, 1024));
|
||||
if (!empty($tmp)) {
|
||||
$$var = $tmp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
####
|
||||
# Installation stuff
|
||||
####
|
||||
|
@ -491,7 +369,7 @@ full write access to this directory and the install directory.
|
|||
continue;
|
||||
}
|
||||
|
||||
$dir = $$var;
|
||||
$dir = ($destdir ? $destdir : '').$$var;
|
||||
if (!@is_dir($dir)) {
|
||||
if (!mkdir_p($dir)) {
|
||||
if (!WEBINSTALLER) {
|
||||
|
@ -566,13 +444,7 @@ if (WEBINSTALLER) {
|
|||
}
|
||||
|
||||
if (!WEBINSTALLER) {
|
||||
$msg = "The following PEAR packages are bundled with PHP: " .
|
||||
implode(', ', array_keys($pfc_packages));
|
||||
print "\n" . wordwrap($msg, 75) . ".\n";
|
||||
print "Would you like to install these as well? [Y/n] : ";
|
||||
$install_pfc = !stristr(fgets($tty, 1024), "n");
|
||||
$install_optional_packages = array();
|
||||
print "\n";
|
||||
}
|
||||
|
||||
####
|
||||
|
@ -585,31 +457,6 @@ if (function_exists('set_include_path')) {
|
|||
ini_set('include_path', $ptmp);
|
||||
}
|
||||
|
||||
if (!extension_loaded('zlib') && !WEBINSTALLER) { // In Web context we could be in multithread env which makes dl() end up with a fatal error.
|
||||
if (WINDOWS) {
|
||||
@dl('php_zlib.dll');
|
||||
} elseif (PHP_OS == 'HP-UX') {
|
||||
@dl('zlib.sl');
|
||||
} elseif (PHP_OS == 'AIX') {
|
||||
@dl('zlib.a');
|
||||
} else {
|
||||
@dl('zlib.so');
|
||||
}
|
||||
}
|
||||
if (!extension_loaded('zlib')) {
|
||||
$urltemplate = 'http://pear.php.net/get/%s?uncompress=yes';
|
||||
$have_gzip = null;
|
||||
} else {
|
||||
$urltemplate = 'http://pear.php.net/get/%s';
|
||||
$have_gzip = true;
|
||||
}
|
||||
|
||||
print "Loading zlib: ".($have_gzip ? 'ok' : 'failed')."\n";
|
||||
|
||||
if (!$have_gzip) {
|
||||
print "Downloading uncompressed packages\n";
|
||||
};
|
||||
|
||||
if ($install_pfc) {
|
||||
$to_install = array_merge($installer_packages, array_keys($pfc_packages));
|
||||
} else {
|
||||
|
@ -648,12 +495,6 @@ displayHTMLProgress($progress = 5);
|
|||
|
||||
// Bootstrap needed ?
|
||||
$nobootstrap = false;
|
||||
if (is_dir($php_dir)) {
|
||||
$nobootstrap = true;
|
||||
foreach ($bootstrap_files as $file => $url) {
|
||||
$nobootstrap &= is_file($php_dir.'/'.$file);
|
||||
}
|
||||
}
|
||||
|
||||
if ($nobootstrap) {
|
||||
print('Using previously install ... ');
|
||||
|
@ -694,16 +535,6 @@ displayHTMLProgress($progress = 20);
|
|||
|
||||
// Extract needed ?
|
||||
$noextract = false;
|
||||
if (is_dir($php_dir)) {
|
||||
$noextract = @include_once 'PEAR/Registry.php';
|
||||
|
||||
if ($noextract) {
|
||||
$registry = new PEAR_Registry($php_dir);
|
||||
foreach ($bootstrap_pkgs as $pkg) {
|
||||
$noextract &= $registry->packageExists($pkg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($noextract) {
|
||||
print('Using previously installed installer ... ');
|
||||
|
@ -725,7 +556,7 @@ if ($noextract) {
|
|||
displayHTMLProgress($progress += round(19 / count($bootstrap_pkgs)));
|
||||
|
||||
$fullpkg = substr($tarball, 0, strrpos($tarball, '.'));
|
||||
$tar = &new Archive_Tar($tarball, $have_gzip);
|
||||
$tar = new Archive_Tar($tarball, $have_gzip);
|
||||
if (!$tar->extractModify($ptmp, $fullpkg)) {
|
||||
bail("Extraction for $fullpkg failed!\n");
|
||||
}
|
||||
|
@ -751,7 +582,7 @@ include_once "PEAR/Command.php";
|
|||
include_once "PEAR/Registry.php";
|
||||
|
||||
if (WEBINSTALLER || isset($_SERVER['argv'][1]) && $_SERVER['argv'][1] == 'local') {
|
||||
$config = &PEAR_Config::singleton($prefix."/pear.conf", '');
|
||||
$config = &PEAR_Config::singleton("@WRKSRC@"."/pear.conf", '');
|
||||
} else {
|
||||
$config = &PEAR_Config::singleton();
|
||||
}
|
||||
|
@ -768,7 +599,7 @@ $config->set('temp_dir', $temp_dir);
|
|||
$config->set('http_proxy', $http_proxy);
|
||||
$config->store();
|
||||
|
||||
$registry = new PEAR_Registry($php_dir);
|
||||
$registry = new PEAR_Registry(($destdir ? $destdir : '').$php_dir);
|
||||
PEAR_Command::setFrontendType('CLI');
|
||||
|
||||
PEAR::staticPushErrorHandling(PEAR_ERROR_DIE); //fail silently
|
||||
|
@ -783,20 +614,28 @@ displayHTMLProgress($progress = 45);
|
|||
|
||||
$install = &PEAR_Command::factory('install', $config);
|
||||
foreach ($to_install as $pkg) {
|
||||
$pkg_basename = substr($pkg, 0, strpos($pkg, '-'));
|
||||
if (strpos($pkg, '-')) {
|
||||
$pkg_basename = substr($pkg, 0, strpos($pkg, '-'));
|
||||
} else {
|
||||
$pkg_basename = $pkg;
|
||||
}
|
||||
|
||||
if (in_array($pkg, $installer_packages)) {
|
||||
$options = array('nodeps' => true);
|
||||
} else {
|
||||
$options = array('onlyreqdeps' => true);
|
||||
}
|
||||
if ($destdir) {
|
||||
$options['packagingroot'] = $destdir;
|
||||
$options['force'] = true;
|
||||
$options['nodeps'] = true;
|
||||
}
|
||||
if ($registry->packageExists($pkg) || $registry->packageExists($pkg_basename)) {
|
||||
print(str_pad("Package: $pkg", max(50,9+strlen($pkg)+4), '.').' already installed ... ok'."\n");
|
||||
displayHTMLProgress($progress += round(50 / count($to_install)));
|
||||
continue;
|
||||
}
|
||||
|
||||
$pkg_basename = substr($pkg, 0, strpos($pkg, '-'));
|
||||
if (in_array($pkg_basename, $bootstrap_pkgs)) {
|
||||
print(str_pad("Installing bootstrap package: $pkg_basename", max(50,30+strlen($pkg_basename)+4), '.')."...");
|
||||
displayHTMLProgress($progress += round(25 / count($to_install)));
|
||||
|
@ -819,170 +658,16 @@ print "\n".'Making sure every package is at the latest version........';
|
|||
$install->run('upgrade-all', array('soft' => true), array());
|
||||
print "ok\n";
|
||||
*/
|
||||
$config->set('download_dir', '/tmp' . '/download');
|
||||
$config->set('temp_dir', '/tmp');
|
||||
$config->store();
|
||||
unset($config, $registry, $install);
|
||||
displayHTMLProgress($progress = 99);
|
||||
|
||||
|
||||
// Base installation finished
|
||||
|
||||
ini_restore("include_path");
|
||||
|
||||
if (!WEBINSTALLER) {
|
||||
$sep = WINDOWS ? ';' : ':';
|
||||
$include_path = explode($sep, ini_get('include_path'));
|
||||
if (WINDOWS) {
|
||||
$found = false;
|
||||
$t = strtolower($php_dir);
|
||||
foreach($include_path as $path) {
|
||||
if ($t==strtolower($path)) {
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$found = in_array($php_dir, $include_path);
|
||||
}
|
||||
if (!$found) {
|
||||
print "
|
||||
******************************************************************************
|
||||
WARNING! The include_path defined in the currently used php.ini does not
|
||||
contain the PEAR PHP directory you just specified:
|
||||
<$php_dir>
|
||||
If the specified directory is also not in the include_path used by
|
||||
your scripts, you will have problems getting any PEAR packages working.
|
||||
";
|
||||
|
||||
if ( $php_ini = getPhpiniPath() ) {
|
||||
print "\n\nWould you like to alter php.ini <$php_ini>? [Y/n] : ";
|
||||
$alter_phpini = !stristr(fgets($tty, 1024), "n");
|
||||
if( $alter_phpini ) {
|
||||
alterPhpIni($php_ini);
|
||||
} else {
|
||||
if (WINDOWS) {
|
||||
print "
|
||||
Please look over your php.ini file to make sure
|
||||
$php_dir is in your include_path.";
|
||||
} else {
|
||||
print "
|
||||
I will add a workaround for this in the 'pear' command to make sure
|
||||
the installer works, but please look over your php.ini or Apache
|
||||
configuration to make sure $php_dir is in your include_path.
|
||||
";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
print "
|
||||
Current include path : ".ini_get('include_path')."
|
||||
Configured directory : $php_dir
|
||||
Currently used php.ini (guess) : $php_ini
|
||||
";
|
||||
|
||||
print "Press Enter to continue: ";
|
||||
fgets($tty, 1024);
|
||||
}
|
||||
|
||||
$pear_cmd = $bin_dir . DIRECTORY_SEPARATOR . 'pear';
|
||||
$pear_cmd = WINDOWS ? strtolower($pear_cmd).'.bat' : $pear_cmd;
|
||||
|
||||
// check that the installed pear and the one in tha path are the same (if any)
|
||||
$pear_old = which(WINDOWS ? 'pear.bat' : 'pear', $bin_dir);
|
||||
if ($pear_old && ($pear_old != $pear_cmd)) {
|
||||
// check if it is a link or symlink
|
||||
$islink = WINDOWS ? false : is_link($pear_old) ;
|
||||
if ($islink && readlink($pear_old) != $pear_cmd) {
|
||||
print "\n** WARNING! The link $pear_old does not point to the " .
|
||||
"installed $pear_cmd\n";
|
||||
} elseif (is_writable($pear_old) && !is_dir($pear_old)) {
|
||||
rename($pear_old, "{$pear_old}_old");
|
||||
print "\n** WARNING! Backed up old pear to {$pear_old}_old\n";
|
||||
} else {
|
||||
print "\n** WARNING! Old version found at $pear_old, please remove it or ".
|
||||
"be sure to use the new $pear_cmd command\n";
|
||||
}
|
||||
}
|
||||
|
||||
print "\nThe 'pear' command is now at your service at $pear_cmd\n";
|
||||
|
||||
// Alert the user if the pear cmd is not in PATH
|
||||
$old_dir = $pear_old ? dirname($pear_old) : false;
|
||||
if (!which('pear', $old_dir)) {
|
||||
print "
|
||||
** The 'pear' command is not currently in your PATH, so you need to
|
||||
** use '$pear_cmd' until you have added
|
||||
** '$bin_dir' to your PATH environment variable.
|
||||
|
||||
";
|
||||
|
||||
print "Run it without parameters to see the available actions, try 'pear list'
|
||||
to see what packages are installed, or 'pear help' for help.
|
||||
|
||||
For more information about PEAR, see:
|
||||
|
||||
http://pear.php.net/faq.php
|
||||
http://pear.php.net/manual/
|
||||
|
||||
Thanks for using go-pear!
|
||||
|
||||
";
|
||||
}
|
||||
}
|
||||
|
||||
if (WEBINSTALLER) {
|
||||
print "\n".'Writing WebFrontend file ... ';
|
||||
@unlink($webfrontend_file); //Delete old one
|
||||
copy ( $doc_dir.DIRECTORY_SEPARATOR.
|
||||
'PEAR_Frontend_Web'.DIRECTORY_SEPARATOR.
|
||||
'docs'.DIRECTORY_SEPARATOR.
|
||||
'index.php.txt',
|
||||
$webfrontend_file
|
||||
);
|
||||
print "ok\n";
|
||||
|
||||
if ($_GET['step'] == 'install-progress') {
|
||||
displayHTMLProgress($progress = 100);
|
||||
ob_end_clean();
|
||||
displayHTMLInstallationSummary();
|
||||
displayHTMLFooter();
|
||||
} else {
|
||||
$out = ob_get_contents();
|
||||
|
||||
$out = explode("\n", $out);
|
||||
foreach($out as $line => $value) {
|
||||
if (preg_match('/ok$/', $value)) {
|
||||
$value = preg_replace('/(ok)$/', '<span class="green">\1</span>', $value);
|
||||
};
|
||||
if (preg_match('/^install ok:/', $value)) {
|
||||
$value = preg_replace('/^(install ok:)/', '<span class="green">\1</span>', $value);
|
||||
};
|
||||
if (preg_match('/^Warning:/', $value)) {
|
||||
$value = '<span style="color: #ff0000">'.$value.'</span>';
|
||||
};
|
||||
$out[$line] = $value;
|
||||
};
|
||||
$out = nl2br(implode("\n",$out));
|
||||
ob_end_clean();
|
||||
|
||||
displayHTML('install', $out);
|
||||
}
|
||||
// Little hack, this will be fixed in PEAR later
|
||||
if ( WINDOWS ) {
|
||||
clearstatcache();
|
||||
@unlink($bin_dir.DIRECTORY_SEPARATOR.'.tmppear');
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
// Little hack, this will be fixed in PEAR later
|
||||
if ( WINDOWS ) {
|
||||
clearstatcache();
|
||||
@unlink($bin_dir.DIRECTORY_SEPARATOR.'.tmppear');
|
||||
}
|
||||
|
||||
if (WINDOWS && !WEBINSTALLER) {
|
||||
win32CreateRegEnv();
|
||||
}
|
||||
// Set of functions following
|
||||
/**
|
||||
* Parse the given dirname
|
||||
|
@ -1422,29 +1107,17 @@ function detect_install_dirs($_prefix = null) {
|
|||
} else {
|
||||
if ($_prefix === null) {
|
||||
#$prefix = dirname(PHP_BINDIR);
|
||||
$prefix = dirname(__FILE__);
|
||||
$prefix = "@PREFIX@";
|
||||
} else {
|
||||
$prefix = $_prefix;
|
||||
}
|
||||
$bin_dir = '$prefix/bin';
|
||||
#$php_dir = '$prefix/share/pear';
|
||||
$php_dir = '$prefix/PEAR';
|
||||
$doc_dir = '$php_dir/docs';
|
||||
$php_dir = '$prefix/lib/php';
|
||||
$doc_dir = '$php_dir/doc';
|
||||
$data_dir = '$php_dir/data';
|
||||
$test_dir = '$php_dir/tests';
|
||||
$temp_dir = '$prefix/temp';
|
||||
|
||||
// check if the user has installed PHP with PHP or GNU layout
|
||||
if (@is_dir("$prefix/lib/php/.registry")) {
|
||||
$php_dir = '$prefix/lib/php';
|
||||
} elseif (@is_dir("$prefix/share/pear/lib/.registry")) {
|
||||
$php_dir = '$prefix/share/pear/lib';
|
||||
$doc_dir = '$prefix/share/pear/docs';
|
||||
$data_dir = '$prefix/share/pear/data';
|
||||
$test_dir = '$prefix/share/pear/tests';
|
||||
} elseif (@is_dir("$prefix/share/php/.registry")) {
|
||||
$php_dir = '$prefix/share/php';
|
||||
}
|
||||
$test_dir = '$php_dir/test';
|
||||
$temp_dir = '@WRKSRC@/tmp';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,238 +0,0 @@
|
|||
$NetBSD: patch-aa,v 1.6 2011/03/01 03:15:16 taca Exp $
|
||||
|
||||
Add support for DESTDIR.
|
||||
|
||||
--- install/go-pear.php.orig 2010-08-24 08:12:01.000000000 +0000
|
||||
+++ install/go-pear.php
|
||||
@@ -58,6 +58,8 @@ define('GO_PEAR_VER', '1.1.2');
|
||||
|
||||
define('WIN32GUI', !WEBINSTALLER && WINDOWS && $sapi_name=='cli' && which('cscript'));
|
||||
|
||||
+$destdir = getenv('DESTDIR');
|
||||
+
|
||||
/*
|
||||
* See bug #23069
|
||||
*/
|
||||
@@ -252,6 +254,8 @@ if (WEBINSTALLER) {
|
||||
// Anything past this step has something to do with the installation
|
||||
}
|
||||
|
||||
+/*
|
||||
+
|
||||
if (!WEBINSTALLER) {
|
||||
$tty = WINDOWS ? @fopen('\con', 'r') : @fopen('/dev/tty', 'r');
|
||||
|
||||
@@ -296,6 +300,8 @@ If you wish to abort, press Control-C no
|
||||
}
|
||||
}
|
||||
|
||||
+*/
|
||||
+
|
||||
$origpwd = getcwd();
|
||||
|
||||
$config_vars = array_keys($config_desc);
|
||||
@@ -347,6 +353,8 @@ we strongly recommand to use it.
|
||||
}
|
||||
}
|
||||
|
||||
+/*
|
||||
+
|
||||
while (!WEBINSTALLER) {
|
||||
print "
|
||||
Below is a suggested file layout for your new PEAR installation. To
|
||||
@@ -430,6 +438,8 @@ If you have a CLI (or CGI) php.exe avail
|
||||
}
|
||||
}
|
||||
|
||||
+*/
|
||||
+
|
||||
####
|
||||
# Installation stuff
|
||||
####
|
||||
@@ -489,7 +499,7 @@ full write access to this directory and
|
||||
continue;
|
||||
}
|
||||
|
||||
- $dir = $$var;
|
||||
+ $dir = ($destdir ? $destdir : '').$$var;
|
||||
if (!@is_dir($dir)) {
|
||||
if (!mkdir_p($dir)) {
|
||||
if (!WEBINSTALLER) {
|
||||
@@ -564,13 +574,17 @@ if (WEBINSTALLER) {
|
||||
}
|
||||
|
||||
if (!WEBINSTALLER) {
|
||||
+/*
|
||||
$msg = "The following PEAR packages are bundled with PHP: " .
|
||||
implode(', ', array_keys($pfc_packages));
|
||||
print "\n" . wordwrap($msg, 75) . ".\n";
|
||||
print "Would you like to install these as well? [Y/n] : ";
|
||||
$install_pfc = !stristr(fgets($tty, 1024), "n");
|
||||
+*/
|
||||
$install_optional_packages = array();
|
||||
+/*
|
||||
print "\n";
|
||||
+*/
|
||||
}
|
||||
|
||||
####
|
||||
@@ -583,6 +597,8 @@ if (function_exists('set_include_path'))
|
||||
ini_set('include_path', $ptmp);
|
||||
}
|
||||
|
||||
+/*
|
||||
+
|
||||
if (!extension_loaded('zlib') && !WEBINSTALLER) { // In Web context we could be in multithread env which makes dl() end up with a fatal error.
|
||||
if (WINDOWS) {
|
||||
@dl('php_zlib.dll');
|
||||
@@ -608,6 +624,8 @@ if (!$have_gzip) {
|
||||
print "Downloading uncompressed packages\n";
|
||||
};
|
||||
|
||||
+*/
|
||||
+
|
||||
if ($install_pfc) {
|
||||
$to_install = array_merge($installer_packages, array_keys($pfc_packages));
|
||||
} else {
|
||||
@@ -646,12 +664,14 @@ displayHTMLProgress($progress = 5);
|
||||
|
||||
// Bootstrap needed ?
|
||||
$nobootstrap = false;
|
||||
+/*
|
||||
if (is_dir($php_dir)) {
|
||||
$nobootstrap = true;
|
||||
foreach ($bootstrap_files as $file => $url) {
|
||||
$nobootstrap &= is_file($php_dir.'/'.$file);
|
||||
}
|
||||
}
|
||||
+*/
|
||||
|
||||
if ($nobootstrap) {
|
||||
print('Using previously install ... ');
|
||||
@@ -692,6 +712,7 @@ displayHTMLProgress($progress = 20);
|
||||
|
||||
// Extract needed ?
|
||||
$noextract = false;
|
||||
+/*
|
||||
if (is_dir($php_dir)) {
|
||||
$noextract = @include_once 'PEAR/Registry.php';
|
||||
|
||||
@@ -702,6 +723,7 @@ if (is_dir($php_dir)) {
|
||||
}
|
||||
}
|
||||
}
|
||||
+*/
|
||||
|
||||
if ($noextract) {
|
||||
print('Using previously installed installer ... ');
|
||||
@@ -749,7 +771,7 @@ include_once "PEAR/Command.php";
|
||||
include_once "PEAR/Registry.php";
|
||||
|
||||
if (WEBINSTALLER || isset($_SERVER['argv'][1]) && $_SERVER['argv'][1] == 'local') {
|
||||
- $config = &PEAR_Config::singleton($prefix."/pear.conf", '');
|
||||
+ $config = &PEAR_Config::singleton("@WRKSRC@"."/pear.conf", '');
|
||||
} else {
|
||||
$config = &PEAR_Config::singleton();
|
||||
}
|
||||
@@ -766,7 +788,7 @@ $config->set('temp_dir', $temp_dir);
|
||||
$config->set('http_proxy', $http_proxy);
|
||||
$config->store();
|
||||
|
||||
-$registry = new PEAR_Registry($php_dir);
|
||||
+$registry = new PEAR_Registry(($destdir ? $destdir : '').$php_dir);
|
||||
PEAR_Command::setFrontendType('CLI');
|
||||
|
||||
PEAR::staticPushErrorHandling(PEAR_ERROR_DIE); //fail silently
|
||||
@@ -781,20 +803,28 @@ displayHTMLProgress($progress = 45);
|
||||
|
||||
$install = &PEAR_Command::factory('install', $config);
|
||||
foreach ($to_install as $pkg) {
|
||||
- $pkg_basename = substr($pkg, 0, strpos($pkg, '-'));
|
||||
+ if (strpos($pkg, '-')) {
|
||||
+ $pkg_basename = substr($pkg, 0, strpos($pkg, '-'));
|
||||
+ } else {
|
||||
+ $pkg_basename = $pkg;
|
||||
+ }
|
||||
|
||||
if (in_array($pkg, $installer_packages)) {
|
||||
$options = array('nodeps' => true);
|
||||
} else {
|
||||
$options = array('onlyreqdeps' => true);
|
||||
}
|
||||
+ if ($destdir) {
|
||||
+ $options['packagingroot'] = $destdir;
|
||||
+ $options['force'] = true;
|
||||
+ $options['nodeps'] = true;
|
||||
+ }
|
||||
if ($registry->packageExists($pkg) || $registry->packageExists($pkg_basename)) {
|
||||
print(str_pad("Package: $pkg", max(50,9+strlen($pkg)+4), '.').' already installed ... ok'."\n");
|
||||
displayHTMLProgress($progress += round(50 / count($to_install)));
|
||||
continue;
|
||||
}
|
||||
|
||||
- $pkg_basename = substr($pkg, 0, strpos($pkg, '-'));
|
||||
if (in_array($pkg_basename, $bootstrap_pkgs)) {
|
||||
print(str_pad("Installing bootstrap package: $pkg_basename", max(50,30+strlen($pkg_basename)+4), '.')."...");
|
||||
displayHTMLProgress($progress += round(25 / count($to_install)));
|
||||
@@ -817,12 +847,17 @@ print "\n".'Making sure every package is
|
||||
$install->run('upgrade-all', array('soft' => true), array());
|
||||
print "ok\n";
|
||||
*/
|
||||
+$config->set('download_dir', '/tmp' . '/download');
|
||||
+$config->set('temp_dir', '/tmp');
|
||||
+$config->store();
|
||||
unset($config, $registry, $install);
|
||||
displayHTMLProgress($progress = 99);
|
||||
|
||||
|
||||
// Base installation finished
|
||||
|
||||
+/*
|
||||
+
|
||||
ini_restore("include_path");
|
||||
|
||||
if (!WEBINSTALLER) {
|
||||
@@ -981,6 +1016,9 @@ if ( WINDOWS ) {
|
||||
if (WINDOWS && !WEBINSTALLER) {
|
||||
win32CreateRegEnv();
|
||||
}
|
||||
+
|
||||
+*/
|
||||
+
|
||||
// Set of functions following
|
||||
/**
|
||||
* Parse the given dirname
|
||||
@@ -1420,17 +1458,19 @@ function detect_install_dirs($_prefix =
|
||||
} else {
|
||||
if ($_prefix === null) {
|
||||
#$prefix = dirname(PHP_BINDIR);
|
||||
- $prefix = dirname(__FILE__);
|
||||
+ $prefix = "@PREFIX@";
|
||||
} else {
|
||||
$prefix = $_prefix;
|
||||
}
|
||||
$bin_dir = '$prefix/bin';
|
||||
#$php_dir = '$prefix/share/pear';
|
||||
- $php_dir = '$prefix/PEAR';
|
||||
- $doc_dir = '$php_dir/docs';
|
||||
+ $php_dir = '$prefix/lib/php';
|
||||
+ $doc_dir = '$php_dir/doc';
|
||||
$data_dir = '$php_dir/data';
|
||||
- $test_dir = '$php_dir/tests';
|
||||
- $temp_dir = '$prefix/temp';
|
||||
+ $test_dir = '$php_dir/test';
|
||||
+ $temp_dir = '@WRKSRC@/tmp';
|
||||
+
|
||||
+/*
|
||||
|
||||
// check if the user has installed PHP with PHP or GNU layout
|
||||
if (@is_dir("$prefix/lib/php/.registry")) {
|
||||
@@ -1443,6 +1483,8 @@ function detect_install_dirs($_prefix =
|
||||
} elseif (@is_dir("$prefix/share/php/.registry")) {
|
||||
$php_dir = '$prefix/share/php';
|
||||
}
|
||||
+*/
|
||||
+
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in a new issue