Changes between Version 83 and Version 84 of PortfileRecipes


Ignore:
Timestamp:
Apr 22, 2015, 9:01:48 PM (9 years ago)
Author:
pixilla (Bradley Giesbrecht)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PortfileRecipes

    v83 v84  
    1919These split the version string into an array and return the desired element.
    2020These examples are based on [browser:trunk/dports/lang/php5 php5].
     21
     22== Compare versions == #vercmp
     23
     24||||||= Mac OS X Version Info =||
     25||= Darwin =||= OS X =||= Name =||
     26|| 7.0 || 10.3 || Panther ||
     27|| 8.0 || 10.4 || Tiger ||
     28|| 9.0 || 10.5 || Leopard ||
     29|| 10.0 || 10.6 || Snow Leopard ||
     30|| 11.0.0 || 10.7 || Lion ||
     31|| 12.0.0 || 10.8 || Mountain Lion ||
     32|| 13.0.0 || 10.9 || Mavericks ||
     33|| 14.0.0 || 10.10 || Yosemite ||
     34
     35{{{
     36set check.version 13.0.0
     37if {[vercmp ${check.version} ${os.version}] = 1} {
     38    puts "Yosemite or newer"
     39} elseif {[vercmp ${check.version} ${os.version}] = 0} {
     40    puts "Mavricks"
     41}
     42} elseif {[vercmp ${check.version} ${os.version}] = -1} {
     43    puts "Mountain Lion or older"
     44}
     45}}}
    2146
    2247== Fetching from a URL that uses GET parameters == #fetchwithgetparams