PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » PEAR » PEAR » Bug #7067

can't bootstrap PEAR install

Details

Request #7067can't bootstrap PEAR install
Submitted2006-03-09 02:06 UTC
Fromglen at delfi dot ee
StatusBogus
PackagePEAR
PHP Version5.1.2
OSPLD Linux
Roadmaps(Not assigned)

Comments

[2006-03-09 02:06 UTC] glen at delfi dot ee

Description:
------------
(this is long post, as i'm attempting to write much
details as possible)

i'm attempting to install PEAR from sources so that i
don't have any PEAR installed on system. this results
bogus error of broken package.xml. it appears to seek
for .registry and .channel from inexistent system
directories (see the strace log)

here's the script to reproduce:
$ cat /tmp/bootstrap/bootstrap.sh
#!/bin/sh
wget http://pear.php.net/get/PEAR-1.4.8.tgz
wget http://pear.php.net/get/Console_Getopt-1.2.tgz
tar zxf Console_Getopt*.tgz
tar zxf PEAR*.tgz
cd PEAR*/
mv ../package2.xml .
rm -rf /tmp/pear-root
php -doutput_buffering=1 \
-dinclude_path=.:../Console_Getopt-1.2 \
scripts/pearcmd.php -c pearrc -d doc_dir=/docs \
-d php_dir=/usr/share/pear \
-d bin_dir=/usr/bin \
-d data_dir=/usr/share/pear/data \
-d test_dir=/usr/share/pear/tests \
install --packagingroot=/tmp/pear-root \
--offline --nodeps package2.xml

and the output looks like:
glen@builder /tmp/bootstrap $ sh -x bootstrap.sh
+ wget http://pear.php.net/get/PEAR-1.4.8.tgz
--03:52:52-- http://pear.php.net/get/PEAR-1.4.8.tgz
=> `PEAR-1.4.8.tgz'
Resolving pear.php.net... 216.92.131.66
Connecting to pear.php.net|216.92.131.66|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 283,109 (276K) [application/octet-stream]

100%[==================================================================================>]
283,109 194.20K/s

03:52:54 (193.92 KB/s) - `PEAR-1.4.8.tgz' saved
[283109/283109]

+ wget http://pear.php.net/get/Console_Getopt-1.2.tgz
--03:52:54--
http://pear.php.net/get/Console_Getopt-1.2.tgz
=> `Console_Getopt-1.2.tgz'
Resolving pear.php.net... 216.92.131.66
Connecting to pear.php.net|216.92.131.66|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3,370 (3.3K) [application/octet-stream]

100%[==================================================================================>]
3,370 --.--K/s

03:52:54 (25.66 KB/s) - `Console_Getopt-1.2.tgz' saved
[3370/3370]

+ tar zxf Console_Getopt-1.2.tgz
+ tar zxf PEAR-1.4.8.tgz
+ cd PEAR-1.4.8/
+ mv ../package2.xml .
+ rm -rf /tmp/pear-root
+ php -doutput_buffering=1
-dinclude_path=.:../Console_Getopt-1.2 scripts/pearcmd.php
-c pearrc -d doc_dir=/docs -d php_dir=/usr/share/pear -d
bin_dir=/usr/bin -d data_dir=/usr/share/pear/data -d
test_dir=/usr/share/pear/tests install
--packagingroot=/tmp/pear-root --offline --nodeps
package2.xml
Parsing of package.xml from file "package2.xml" failed
Cannot download non-local package "package2.xml"
Package "package2.xml" is not valid
install failed

running the command with strace i see:
$ strace -eopen,stat64 php -doutp....

open("/tmp/bootstrap/PEAR-1.4.8/PEAR/Task/Replace.php",
O_RDONLY) = 3
stat64("/usr/share/pear/.registry", 0xbf92f85c) = -1
ENOENT (No such file or directory)
open("/tmp/bootstrap/PEAR-1.4.8/PEAR/ChannelFile.php",
O_RDONLY) = 3
open("/tmp/bootstrap/PEAR-1.4.8/PEAR/ErrorStack.php",
O_RDONLY) = 3
open("/tmp/bootstrap/PEAR-1.4.8/PEAR/XMLParser.php",
O_RDONLY) = 3
open("/tmp/bootstrap/PEAR-1.4.8/PEAR/Common.php",
O_RDONLY) = 3
stat64("/usr/share/pear/.channels", 0xbf92f21c) = -1
ENOENT (No such file or directory)
stat64("/usr/share/pear/.registry", 0xbf92f6ac) = -1
ENOENT (No such file or directory)
Parsing of package.xml from file "package2.xml" failed
Cannot download non-local package "package2.xml"
Package "package2.xml" is not valid
install failed
stat64("/tmp/tmp05Do3c", {st_mode=S_IFDIR|0700,
st_size=48, ...}) = 0
open("/tmp/tmp05Do3c", O_RDONLY|O_NONBLOCK|O_LARGEFILE|
O_DIRECTORY) = 3
Process 3302 detached

now we make the dir
$ sudo mkdir -p /usr/share/pear/.registry
$ php -doutput_buffering=1
-dinclude_path=.:../Console_Getopt-1.2 scripts/pearcmd.php
-c pearrc -d doc_dir=/docs -d php_dir=/usr/share/pear -d
bin_dir=/usr/bin -d data_dir=/usr/share/pear/data -d
test_dir=/usr/share/pear/tests install
--packagingroot=/tmp/pear-root --offline --nodeps
package2.xml

Warning: touch(): Unable to create
file /usr/share/pear/.lock because Permission denied in
Registry.php on line 751
Parsing of package.xml from file "package2.xml" failed
Cannot download non-local package "package2.xml"
Package "package2.xml" is not valid
install failed

creating lock file doesn't help either. but running
channel-update as *root* will help. this is not expected
to do packaging (as it all has to be done as non-root)

so. this works, but requires root privs:
glen@builder bootstrap/PEAR-1.4.8 $ sudo rm
-rf /usr/share/pear/
glen@builder bootstrap/PEAR-1.4.8 $ sudo php
-doutput_buffering=1
-dinclude_path=.:../Console_Getopt-1.2 scripts/pearcmd.php
-c pearrc -d doc_dir=/docs -d php_dir=/usr/share/pear -d
bin_dir=/usr/bin -d data_dir=/usr/share/pear/data -d
test_dir=/usr/share/pear/tests channel-update pear.php.net
Retrieving channel.xml from remote server
Update of Channel "pear.php.net" succeeded

glen@builder bootstrap/PEAR-1.4.8 $ rm -rf /tmp/pear-root/
glen@builder bootstrap/PEAR-1.4.8 $ php
-doutput_buffering=1
-dinclude_path=.:../Console_Getopt-1.2 scripts/pearcmd.php
-c pearrc -d doc_dir=/docs -d php_dir=/usr/share/pear -d
bin_dir=/usr/bin -d data_dir=/usr/share/pear/data -d
test_dir=/usr/share/pear/tests install
--packagingroot=/tmp/pear-root --offline --nodeps
package2.xml
warning: pear/PEAR requires package
"pear/Archive_Tar" (recommended version 1.3.1)
warning: pear/PEAR requires package
"pear/Console_Getopt" (recommended version 1.2)
pear/PEAR can optionally use package
"pear/XML_RPC" (version >= 1.4.0)
install ok: channel://pear.php.net/PEAR-1.4.8
PEAR: Optional feature webinstaller available (PEAR's
web-based installer)
PEAR: Optional feature gtkinstaller available (PEAR's
PHP-GTK-based installer)
PEAR: Optional feature gtk2installer available (PEAR's
PHP-GTK2-based installer)
To install use "pear install pear/PEAR#featurename"