Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.10.15

Bug #18450 post-install script tries to set config-value global with local PEAR-install
Submitted: 2011-04-17 04:59 UTC
From: neufeind Assigned:
Status: Open Package: PEAR (version 1.9.2)
PHP Version: 5.3.6 OS:
Roadmaps: (Not assigned)    
Subscription  


 [2011-04-17 04:59 UTC] neufeind (Stefan Neufeind)
Description: ------------ Using a local PEAR-install instead of the global works as it should. But a post-install-script which tries to set a config-value seems to try to write to the global config (and fails). Test script: --------------- How to reproduce: 1) Create a "local" PEAR-installation for the current user: pear config-create /home/user/pear .pearrc 2) Install a package (as per http://www.horde.org/apps/horde/docs/?f=INSTALL.html) pear channel-discover pear.horde.org pear install horde/horde_role 3) Try to run post-install-script that tries to set a value pear run-scripts horde/horde_role Expected result: ---------------- Should set config-value for "horde_dir" for the local PEAR-installation. Actual result: -------------- Fails with: Could not save horde_dir configuration value to PEAR config. Tries to set the value for the global PEAR-installation (which fails). But the source seems to suggest it "should" work (imho): public function init($config, $pkg, $version) { $this->_config = $config; return true; } /** * Run task after prompt. * * @param array $info Parameter array. * @param string $name Postinstall phase. */ public function run($info, $phase) { if ($phase !== 'first') { return; } if (!$this->_config->set('horde_dir', $info['horde_dir'], 'user', 'pear.horde.org'))

Comments

 [2011-04-17 05:03 UTC] neufeind (Stefan Neufeind)
Workaround: After config-create for that new PEAR-repo, also install a local copy of the PEAR-package and use that pear-script to run the post-install script. 1) pear install -o PEAR 2) pear/pear run-scripts horde/horde_role (using just "pear run-scripts horde/horde_role" fails again; so must have to with using local/global PEAR-copy)