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

Bug #5072 If channel not registered, addMaintainers() fails?
Submitted: 2005-08-11 22:26 UTC
From: pmjones Assigned: cellog
Status: Closed Package: PEAR_PackageFileManager
PHP Version: 5.0.4 OS: Mac OS X
Roadmaps: (Not assigned)    
Subscription  


 [2005-08-11 22:26 UTC] pmjones
Description: ------------ When trying to addMaintainer() under a custom channel (solarphp.com), package creation was failing with the message "Add maintainers to a package before generating the package.xml." Then, after successfully performing "pear channel-discover solarphp.com", the addMaintainer() call worked just fine and the package was able to be generated. Not sure where the bug lies, or if this is the expected behavior.

Comments

 [2005-10-25 02:26 UTC] cellog
can you attach the script you were using?
 [2005-10-26 13:30 UTC] pmjones
This is from Solar; the primary author was Clay Loveless (although I added some mods). <?php // --------------------------------------------------------------------- // // SETUP // // get all files in the info directory, reverse-sorted $dir = dirname(__FILE__) . '/info'; $list = scandir($dir, 1); // grab number for most-recent version and set directory $version = $list[0]; $dir .= "/$version"; // get release-specific info $stability = file_get_contents("$dir/stability"); $summary = file_get_contents("$dir/summary"); $descr = file_get_contents("$dir/description"); $notes = file_get_contents("$dir/notes"); $notes = str_replace("\t", ' ', $notes); // get maintainers $list = file("$dir/maintainers"); $maintainers = array(); foreach ($list as $data) { // ignore blank lines if (trim($data) == '') { continue; } $person = explode(',', trim($data)); array_walk($person, 'trim'); $maintainers[] = $person; } // --------------------------------------------------------------------- // // BUILD // require_once 'PEAR/PackageFileManager2.php'; PEAR::setErrorHandling(PEAR_ERROR_PRINT); $pkg = new PEAR_PackageFileManager2; $opts = array( 'baseinstalldir' => '/', 'packagefile' => 'package2.xml', 'packagedirectory' => dirname(__FILE__) . '/pkg/', 'filelistgenerator' => 'file', 'exceptions' => array('tests/*' => 'test', 'docs/*' => 'doc') ); $e = $pkg->setOptions($opts); $pkg->setPackage('Solar'); $pkg->setSummary($summary); $pkg->setDescription($descr); foreach ($maintainers as $person) { $result = call_user_func_array( array($pkg, 'addMaintainer'), $person ); } $pkg->setChannel('solarphp.com'); $pkg->setAPIVersion($version); $pkg->setReleaseVersion($version); $pkg->setReleaseStability($stability); $pkg->setAPIStability($stability); $pkg->setPackageType('php'); $pkg->addRelease(); $pkg->setNotes($notes); $pkg->setPhpDep('5.0.0'); $pkg->setPearinstallerDep('1.4.0a12'); $pkg->setLicense('LGPL', 'http://www.opensource.org/licenses/lgpl-license.php'); $pkg->generateContents(); $pkg->addGlobalReplacement('package-info', '@package-version@', 'version'); // --------------------------------------------------------------------- // // OUTPUT // $compat =& $pkg->exportCompatiblePackageFile1(); if (isset($argv[1]) && $argv[1] == 'make') { $compat->writePackageFile(); $pkg->writePackageFile(); } else { $compat->debugPackageFile(); $pkg->debugPackageFile(); } ?>
 [2005-11-04 23:37 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. This is most definitely fixed in cvs through other unrelated work.