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

Bug #6507 deps are lost after importing a package v1
Submitted: 2006-01-17 12:18 UTC
From: farell Assigned: farell
Status: Closed Package: PEAR_PackageFileManager
PHP Version: 4.4.1 OS: Windows XP
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 6 + 42 = ?

 
 [2006-01-17 12:18 UTC] farell
Description: ------------ This is an old and nasty bug. Both PFM 1(1.5.x) and PFM 2(1.6.x) classes are affected. I'll fix it in CVS, because i've already found the solution. Just to keep aware Greg and Arnaud. Here is the problem: After import a previous package v1.0, if you want to change again some options, you'll lose the dependencies list. Even if 'cleardependencies' is set to false. This is due to internal clear of "deps" option array. You can reproduce bug with any package.xml v1 that have dependencies declared. Test script: --------------- <?php require_once 'PEAR/PackageFileManager.php'; function varDump($var) { echo '<pre style="background-color:#eee">'; var_dump($var); echo '</pre>'; } $pfm =& new PEAR_PackageFileManager(); $packagefile = 'import_package.xml'; $options = array( 'cleardependencies' => false ); $res = $pfm->importOptions($packagefile, $options); varDump($res); $options = array( 'packagedirectory' => '.', 'baseinstalldir' => 'HTML', 'version' => '2.0.0', 'state' => 'devel', 'notes' => 'my new release note' ); $res = $pfm->setOptions($options); varDump($res); $res = $pfm->getOptions(); varDump($res); varDump($pfm->_packageXml); varDump($pfm->_oldPackageXml['release_deps']); varDump($pfm->_oldPackageXml['maintainers']); ?> Expected result: ---------------- $pfm->getOptions() returns an array with: "deps" not an empty array when ["cleardependencies"]=> bool(false) Actual result: -------------- options : ["deps"]=> array(0) { } ["cleardependencies"]=> bool(false)

Comments

 [2006-01-17 12:28 UTC] farell
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.