[MacPorts] PortfileRecipes modified

MacPorts noreply at macports.org
Mon Aug 10 15:34:23 PDT 2009


Changed page "PortfileRecipes" by ryandesign at macports.org from 70.253.74.1*
Page URL: <http://trac.macports.org/wiki/PortfileRecipes>
Diff URL: <http://trac.macports.org/wiki/PortfileRecipes?action=diff&version=11>
Revision 11
Comment: add fetchwithgetparams section

-------8<------8<------8<------8<------8<------8<------8<------8<--------
Index: PortfileRecipes
=========================================================================
--- PortfileRecipes (version: 10)
+++ PortfileRecipes (version: 11)
@@ -16,6 +16,26 @@
 }}}
 This splits the version string into an array and returns just the first element.
 This example is from [browser:trunk/dports/lang/php5 php5].
+
+== Fetching from a URL that uses GET parameters == #fetchwithgetparams
+
+Usually 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
+
+{{{
+name                    bzip2
+version                 1.0.5
+...
+homepage                http://www.bzip.org/
+master_sites            ${homepage}${version}
+}}}
+
+so 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.
+
+But 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]:
+
+{{{
+master_sites	${homepage}attachment/wiki/WikiStart/${distfiles}?format=raw&dummy=
+}}}
 
 == Using glob results in "Cannot stat: <list of files>" == #glob
 glob returns a list which is not handled by some commands (eg, xinstall); instead, wrap the command in an eval.  Instead of

-------8<------8<------8<------8<------8<------8<------8<------8<--------

* The IP shown here might not mean anything if the user or the server is
behind a proxy.

--
MacPorts <http://www.macports.org/>
Ports system for Mac OS

This is an automated message. Someone at http://www.macports.org/ added your email
address to be notified of changes on PortfileRecipes. If it was not you, please
report to .


More information about the macports-changes mailing list