Changes between Version 10 and Version 11 of PortfileRecipes


Ignore:
Timestamp:
Aug 10, 2009, 10:34:16 PM (15 years ago)
Author:
ryandesign (Ryan Carsten Schmidt)
Comment:

add fetchwithgetparams section

Legend:

Unmodified
Added
Removed
Modified
  • PortfileRecipes

    v10 v11  
    1717This splits the version string into an array and returns just the first element.
    1818This example is from [browser:trunk/dports/lang/php5 php5].
     19
     20== Fetching from a URL that uses GET parameters == #fetchwithgetparams
     21
     22Usually you set master_sites to the URL to the directory you want to download from, and at fetch time MacPorts appends a slash (if necessary) and the distfiles variable to this to create the complete URL. For example, [browser:trunk/dports/archivers/bzip2 bzip2] says
     23
     24{{{
     25name                    bzip2
     26version                 1.0.5
     27...
     28homepage                http://www.bzip.org/
     29master_sites            ${homepage}${version}
     30}}}
     31
     32so master_sites evaluates to !http://www.bzip.org/1.0.5, distfiles is the default bzip2-1.0.5.tar.gz, so the final URL MacPorts will download from is !http://www.bzip.org/1.0.5/bzip2-1.0.5.tar.gz.
     33
     34But sometimes the only download URL available is one that requires GET parameters, for example if you want to download an attachment from a Trac wiki. In this case, list the entire download URL in master_sites, and at the end, leave an empty dummy parameter. MacPorts will still append the slash and the distname, but since it'll be assigned to the dummy GET parameter, the server won't mind. This example is from [browser:trunk/dports/devel/gtkimageview gtkimageview]:
     35
     36{{{
     37master_sites    ${homepage}attachment/wiki/WikiStart/${distfiles}?format=raw&dummy=
     38}}}
    1939
    2040== Using glob results in "Cannot stat: <list of files>" == #glob