Bug 10252 - Suggested small note to avoid confusion re. the version specification in PREFERRED_VERSION
Summary: Suggested small note to avoid confusion re. the version specification in PREF...
Status: RESOLVED FIXED
Alias: None
Product: Reference
Classification: Documentation
Component: handbook (show other bugs)
Version: 2.2
Hardware: x86 Multiple
: Undecided normal
Target Milestone: 2.2 M4
Assignee: Scott Rifenbark
QA Contact:
URL:
Whiteboard: 14 Sept 2016: RESOLVED
Depends on:
Blocks:
 
Reported: 2016-09-09 11:00 UTC by ulfalizer
Modified: 2016-09-14 12:18 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Done (doc changes complete)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ulfalizer 2016-09-09 11:00:38 UTC
Hello,

When using PREFERRED_VERSION, the version specified is matched against PV rather than the recipe filename. This is subtle and easy to miss.

I suggest adding the following note before the paragraph that starts with "sometimes the PREFERRED_VERSION variable...":

  Note {
  The specified version is matched against PV, which does not necessarily match
  the version part of the recipe's filename. For example, consider two recipes
  foo_1.2.3.bb and foo_git.bb where foo_git.bb contains the following assignment:
  
    PV = "1.2.2+git{SRCPV}"  
  
  In this case, the correct way to select foo_git.bb is with an assignment like
  the following:
  
    PREFERRED_VERSION_foo = "1.2.2+git%"
  
  The following assignment will *not* work:
  
    PREFERRED_VERSION_foo = "git"
  }


Cheers,
Ulf
Comment 1 ulfalizer 2016-09-09 11:07:54 UTC
Missed a $. Here's a fixed version (with shorter version strings too). :P

  Note {
  The specified version is matched against PV, which does not necessarily match
  the version part of the recipe's filename. For example, consider two recipes
  foo_1.2.bb and foo_git.bb where foo_git.bb contains the following assignment:
  
    PV = "1.1+git${SRCPV}"  
  
  In this case, the correct way to select foo_git.bb is with an assignment like
  the following:
  
    PREFERRED_VERSION_foo = "1.1+git%"
  
  The following assignment will *not* work:
  
    PREFERRED_VERSION_foo = "git"
  }
Comment 2 Scott Rifenbark 2016-09-13 18:43:22 UTC
Ulf, 

See http://www.yoctoproject.org/docs/2.2/ref-manual/ref-manual.html#var-PREFERRED_VERSION for the new note.

Thanks, 
Scott
Comment 3 ulfalizer 2016-09-13 19:15:15 UTC
Looks good to me!

Thanks,
Ulf
Comment 4 Scott Rifenbark 2016-09-14 12:18:34 UTC
Thanks, 

Setting to RESOLVED and putting the doc flag to "done."

Scott