Changes between Version 1 and Version 2 of PortfileRecipes


Ignore:
Timestamp:
May 14, 2009, 6:33:40 AM (15 years ago)
Author:
ryandesign (Ryan Carsten Schmidt)
Comment:

add branch and major version section

Legend:

Unmodified
Added
Removed
Modified
  • PortfileRecipes

    v1 v2  
    11= Portfile Recipes =
     2
     3== Branch and major versions == #branch
     4
     5Often 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
     6{{{
     7set branch              [join [lrange [split ${version} .] 0 1] .]
     8}}}
     9This splits the version string into an array, takes the first two elements of the array, and glues them back together again.
     10This example is from [browser:trunk/dports/devel/glib2 glib2].
     11
     12If you need to refer just to the x part (the major version) you can similarly do:
     13{{{
     14set major               [lindex [split ${version} .] 0]
     15}}}
     16This splits the version string into an array and returns just the first element.
     17This example is from [browser:trunk/dports/lang/php5 php5].
    218
    319== Using glob results in "Cannot stat: <list of files>" == #glob