Changes between Version 46 and Version 47 of PortfileRecipes


Ignore:
Timestamp:
Feb 25, 2013, 4:30:02 AM (11 years ago)
Author:
larryv (Lawrence Velázquez)
Comment:

add examples for extracting minor and patch versions

Legend:

Unmodified
Added
Removed
Modified
  • PortfileRecipes

    v46 v47  
    22[[PageOutline(2-3,Table of Contents,inline)]]
    33
    4 == Branch and major versions == #branch
     4== Branch versions and version segments == #branch
    55
    66Often times, when a port's version is x.y.z, you want to be able to refer to just the x.y part, for a download URL or for other reasons. The de facto standard way to do this is
     
    1111This example is from [browser:trunk/dports/devel/glib2 glib2].
    1212
    13 If you need to refer just to the x part (the major version) you can similarly do:
     13If you need to refer just one part of the version, you can similarly use:
    1414{{{
    1515set major               [lindex [split ${version} .] 0]
    16 }}}
    17 This splits the version string into an array and returns just the first element.
    18 This example is from [browser:trunk/dports/lang/php5 php5].
     16set minor               [lindex [split ${version} .] 1]
     17set patch               [lindex [split ${version} .] 2]
     18}}}
     19These split the version string into an array and return the desired element.
     20These examples are based on [browser:trunk/dports/lang/php5 php5].
    1921
    2022== Fetching from a URL that uses GET parameters == #fetchwithgetparams