Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 34814

Summary: man 5 ebuild : best_version error in description of function return
Product: [OLD] Docs-developer Reporter: Andrew Bevitt <andrewbevitt>
Component: Portage DocumentationAssignee: Portage team <dev-portage>
Status: RESOLVED INVALID    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Andrew Bevitt 2003-12-01 04:44:15 UTC
best_version <package name>
  This function will look up package name in the database of currently 
  installed  programs  and  echo the  "best version" of the package that 
  is currently installed.  
// Here is problem
  The function returns 0 if there is a package that matches package name. 
  Otherwise, the function will return 1.

if best_version <pkg>/<cat> ; 

Returns true when the package is installed, but that line above says it will
return 0, or false, at least to me...

Reproducible: Always
Steps to Reproduce:
Comment 1 SpanKY gentoo-dev 2003-12-01 07:27:52 UTC
it is correct ... nick for some reason decided to return shell true/false :P

you have to use this syntax:
if best_version blah/blah ; then
you cant use this:
if [ `best_version blah/blah` ] ; then