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

Bug #6076 optional is not set for conversion of package2.xml to "has" rel
Submitted: 2005-11-25 22:16 UTC
From: farell Assigned: cellog
Status: Closed Package: PEAR
PHP Version: 4.4.0 OS: Windows XP
Roadmaps: (Not assigned)    
Subscription  


 [2005-11-25 22:16 UTC] farell
Description: ------------ Again with PEAR 1.4.5 and PFM 1.6.0a4 2nd problem found is also related to convertion to package.xml v1 with exportCompatiblePackageFile1() function. nothing forbid to write something like : $pkg->setPearinstallerDep('1.4.3'); $pkg->addPackageDepWithChannel('required', 'PEAR', 'pear.php.net'); (even if it's said nothing here, i agree) last line came from old package v1 syntax, with PEAR 1.3 and PFM 1.5, when i wanted to give a dependency relation as: $pkg1->addDependency('PEAR', false, 'has'); ==> that tell i want at least PEAR as mandatory package. In such condition, writing 2 dependencies to PEAR with 2 syntax, gave a notice error (see below) Test script: --------------- <?php //require_once 'PEAR/Packager.php'; require_once 'PEAR/PackageFileManager2.php'; PEAR::setErrorHandling(PEAR_ERROR_DIE); // Package name and license used $package = 'HTML_QuickForm_advmultiselect'; $license = 'PHP License 3.0'; // Full description of the package $description = <<<DESCR The HTML_QuickForm_advmultiselect package adds an element to the HTML_QuickForm package that is two select boxes next to each other emulating a multi-select. DESCR; // Summary of description of the package $summary = 'Element for HTML_QuickForm that emulate a multi-select.'; // base of install directory $baseinstalldir = 'HTML/QuickForm'; // Configuration of PEAR::PackageFileManager $optionsUpdate = array( 'packagedirectory' => '.', 'filelistgenerator' => 'cvs', 'baseinstalldir' => $baseinstalldir, 'changelogoldtonew' => false, 'simpleoutput' => false, 'ignore' => array('package.xml', basename(__FILE__)) ); $pkg = new PEAR_PackageFileManager2(); $pkg->setOptions($optionsUpdate); $pkg->setPackage($package); $pkg->setChannel('pear.php.net'); $pkg->setPearinstallerDep('1.4.3'); $pkg->setSummary($summary); $pkg->setDescription($description); $pkg->setLicense($license); $pkg->setPackageType('php'); $pkg->addRelease(); $pkg->setAPIVersion('1.0.0'); $pkg->setAPIStability('stable'); $pkg->setReleaseVersion('1.1.0'); $pkg->setReleaseStability('stable'); $pkg->setNotes('a first note'); $pkg->addMaintainer('lead', 'farell', 'Laurent Laville', 'pear@laurent-laville.org'); $pkg->addPackageDepWithChannel('required', 'PEAR', 'pear.php.net'); $pkgV1 = &$pkg->exportCompatiblePackageFile1(); ?> Expected result: ---------------- no notice error, or a warning message that tell writing $pkg->addPackageDepWithChannel('required', 'PEAR', 'pear.php.net'); is forbidden and should be deprecated in favor of $pkg->setPearinstallerDep('1.4.3'); Actual result: -------------- Notice: Undefined index: optional in [...]\PEAR\PackageFileManager2.php on line 650

Comments

 [2006-01-08 23:00 UTC] farell
Once again a bug for PEAR-core, due to share code. To solve it on PEAR 1.4.6 http://cvs.php.net/viewcvs.cgi/pear-core/PEAR/PackageFile/v2.php?annotate=1.122 Add after line 1655: $s['rel'] = 'has'; the missing code $s['optional'] = $optional; And all will run fine ! Laurent I'll waiting Greg agreement before re-assign bug to PEAR package.
 [2006-01-23 17:44 UTC] cellog
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.