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

Request #5527 alternative approach to determining glibc version
Submitted: 2005-09-26 21:04 UTC
From: bertrand at togg dot com Assigned: cellog
Status: Closed Package: PEAR
PHP Version: 4.3.11 OS: FC3
Roadmaps: (Not assigned)    
Subscription  


 [2005-09-26 21:04 UTC] bertrand at togg dot com
Description: ------------ I loosed cpp: # mv /usr/bin/cpp /usr/bin/cpp.sav # hash -d cpp # pear uninstall HTML_Template_Sigma sh: /usr/bin/cpp: No such file or directory pear/html_menu can be optionally used by installed package "pear/HTML_Template_Sigma" pear/HTML_Template_Sigma (version >= 1.1.2) can be optionally used by installed package "pear/html_progress" uninstall ok: channel://pear.php.net/HTML_Template_Sigma-1.1.3 [root@ancilla tw19]# pear install HTML_Template_Sigma sh: /usr/bin/cpp: No such file or directory downloading HTML_Template_Sigma-1.1.3.tgz ... Starting to download HTML_Template_Sigma-1.1.3.tgz (27,068 bytes) .........done: 27,068 bytes install ok: channel://pear.php.net/HTML_Template_Sigma-1.1.3 What is this cpp complain ? Where is pear needing that ? Should I try to install raw pear in this state ? (HTML_Template_Sigma is just an example here) (reported on irc #pear , forward to the person possible)

Comments

 [2005-09-27 02:55 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. OS_Guess, in order to construct architecture information, uses cpp to grab the glibc version. I just added a !file_exists('/usr/bin/cpp') || !is_executable('/usr/bin/cpp') check that should remove the error message.
 [2005-09-27 22:01 UTC] toggg
Verified with a cvs checkout, the message is cleared, no problem. Anyway, I must re-open the bug: No directory is fixed for cpp, even if some "norms" exist, that could also be /usr/local/bin/ ... Is not some sortof "whereis" possible ? In fact, we are not aware of the goal, here, is the glibc version needed afterall?
 [2005-09-28 16:03 UTC] cellog
only for arch dependencies and installconditions. Since this is very specific to OSes that have cpp in /usr/bin/cpp, I don't see any reason to change this immediately.
 [2005-10-09 01:24 UTC] soporte at onfocus dot cl
I have yet another aproach for the popen() and cpp stuff: Index: Guess.php =================================================================== RCS file: /repository/pear-core/OS/Guess.php,v retrieving revision 1.19 diff -u -a -r1.19 Guess.php --- Guess.php 27 Sep 2005 02:55:26 -0000 1.19 +++ Guess.php 9 Oct 2005 01:17:14 -0000 @@ -74,7 +74,7 @@ // Darwin home-eden.local 7.5.0 Darwin Kernel Version 7.5.0: Thu Aug 5 19:26:16 PDT 2004; root:xnu/xnu-517.7.21.obj~3/RELEASE_PPC Power Macintosh // // Mac OS X early versions -// +// // }}} @@ -207,6 +207,27 @@ if (!file_exists('/usr/bin/cpp') || !is_executable('/usr/bin/cpp')) { return $glibc = ''; } + if ($features_file = @fopen('/usr/include/features.h','rb') ) { + + while (!feof($features_file)) { + + $line = fgets($features_file, 4096); + + if ( strpos($line,'define') && strpos ($line,'__GLIBC__') ) { + //major version number + $glibc_major = substr($line ,17); + + } elseif ( strpos($line,'define') && strpos ($line,'__GLIBC_MINOR__') ) { + // got the minor version number + $glibc_minor = substr($line ,23); + + } + } + fclose($features_file); + + return 'glibc' . trim($glibc_major) . "." . trim($glibc_minor) ; + + } $tmpfile = System::mktemp("glibctest"); $fp = fopen($tmpfile, "w"); fwrite($fp, "#include <features.h>\n__GLIBC__ __GLIBC_MINOR__\n"); of course your folks can to this better, you can think adding that patch as an alternative, or simple remove that "tricky" popen() call (BTW.. a warning is issued when popen() is forbidden ( listed on disable_functions) )
 [2005-10-09 03:03 UTC] cellog
not a bad idea, reopening as a feature request
 [2005-10-09 06:45 UTC] soporte at onfocus dot cl
_detectGlibcVersion() is affected by open_basedir (AFAIK) cellog: Why the glibc _version_ is specifically needed (???) what's done with that information ? probably I'm missing something...
 [2005-10-26 19:34 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.