Links to know aboutMusic The Chiara String Quartet Chiara Quartet (MySpace) Greenwood Music Camp UNL School of Music PHP PEAR Installer Manifesto phpDocumentor PEAR phar docblock PHP_Parser PHP_Parser_DocblockParser PHP_ParserGenerator PHP_LexerGenerator PEAR_PackageFileManager PHP_Archive Games_Chess Blogs Joshua Eichorn Paul M. Jones Davey Shafik Popular EntriesSetting up your own PEAR channel with Chiara_PEAR_Server - the official way
(28) Do you develop a website? It is infinitely better to synchronize live and development sites using the PEAR Installer(25) Using PEAR 1.4.0 to install PEAR packages on a remote host(19) doing the PEAR thing(19) phpDocumentor and __get/__set/__call - give us your ideas (RFC)(17) CategoriesPowered by |
Monday, January 31. 2005Post-install Scripts in PEAR 1.4.0Comments
Display comments as
(Linear | Threaded)
It looks interesting … but I’ve read and re-read the docs about PEAR, and a thing that would be really really great, would be to see PEAR live at the same time in /usr/share/php AND in /usr/local/share/php as perl does.
And AFAIK there is no such feature in PEAR, and thats a real *pain* for linux distros packagers/maintainers
to MadCoder:
Two separate installs of PEAR can easily be constructed and maintained, all you need is two separate configuration files, but this has nothing to do with post-installation scripts. Just because it is not done automatically does not make things a real pain. Most users don’t NEED two installations. Please don’t reply to this post with more comments on this issue, but if you have more to say, feel free to post to pear-dev@lists.php.net with your comments. Greg
A couple thoughts. About the structure of the postinstall script, why not use __construct() instead of init()? I know we’re in PHP4 land, but why not look forward?
Also, just a random idea…why not tie in a way to run unit tests post-install and revert the install if the tests fail? On security, I don’t know what other setups are like, but I’ve seen several servers where PEAR was installed by root. That means every pear command after that has to be executed with root priviledges. With the potential for malicious post-install scripts, this seems like a dangerous situation. Perhaps the post-install scripts shouldn’t be runable as root? I dunno.
Ryan King said:
> A couple thoughts. About the structure of the postinstall script, why not use __construct() instead of init()? I > know we’re in PHP4 land, but why not look forward? init() does not serve the same purpose as a constructor. It instead passes in post-creation values for initialization. If it was a constructor, I would have called it such > Also, just a random idea…why not tie in a way to run unit tests post-install and revert the install if the tests > fail? This may be possible, but certainly not as a default option in the installer without unmaintainable complexity. Per-package install checks would be neat. In order to revert an install, the installer would need to maintain a listing of complete state. This is better handled by a pre-installation script. > On security, I don’t know what other setups are like, but I’ve seen several servers where PEAR was installed by > root. That means every pear command after that has to be executed with root priviledges. With the potential for > malicious post-install scripts, this seems like a dangerous situation. Perhaps the post-install scripts shouldn’t > be runable as root? I dunno. I do think that it should be possible to run them manually, but you’re right, automatically is always a bad thing if run as root. Greg
It does strike me as a little dangerous, I know “dpkg -i somepackage.deb” will install and run any old installation script (Although AFAIK they should be signed..), I wonder if a simple measure would be:
Error: package ABC.php wants to run an install script, **IMPORTANT: Please ensure you trust the source of this package *** then use “pear install –run-scripts …….” to install it. I guess if we start signing our packages it may help.. (trusted keys on pear.php.net?)
I was thinking exactly the way Alan suggests. Perhaps post-install scripts should truly be post-install however. In other words:
CODE: $ pear install Blah<br />
install OK channel://pear.php.net/Blah<br />
**NOTICE: Blah ships install scripts in files:<br />
/usr/share/pear/Blah/script1.php<br />
/usr/share/pear/Blah/script2.php<br />
Please ensure you trust the Blah package.<br />
To run the script, use “pear run-scripts Blah”<br />
$ pear run-scripts Blah In this way, there would never be anything automatic about post-install scripts. This should eliminate the absolute necessity of signing packages, but I do think signing them would be a great thing if the gpg binary wasn’t required to validate them. That eliminates a large number of windows users, since setting up gpg is not a piece of cake. Perhaps some experts on keys could have more answers.
One important thing is missing, or I missed to see it. If running the post-install scripts during an upgrade, the install scripts need the old version of the package. Beside that, install vs. upgrade shouldn’t change for different parameter groups, thus it should be passed to init() once, instead of to run() each time. init() could then also be the place to pass the old package version.
You’re absolutely right about the old version, and that this should be passed into init().
|
Links in this article
PEAR Installer ManifestoCalendar
QuicksearchMy Latest ReleasesTop Exitspear.php.net (406)
www.php.net (107) www.chiaraquartet.net (106) pecl.php.net (103) www.vmware.com (90) Blog Administration |
|||||||||||||||||||||||||||||||||||||||||||||||||
Regarding http://greg.chiaraquartet.net/archives/5-Post-install-Scripts-in-PEAR-1.4.0.html, I have taken the suggestions into account and reworked the way post-install scripts work.First off, the xml representation has not changed a bit, but now post-inst
Tracked: Feb 07, 11:59