Portfiles based off of Subversion trunk?

Rainer Müller raimue at macports.org
Thu Jan 13 09:41:15 PST 2011


Hello Jon,

On 2011-01-13 09:33 , Jon Hermansen wrote:
> I'm writing some Portfiles as an experiment for some tools I use at
> work. We keep these packages in Subversion and I am currently using
> 'fetch.type svn' to pull the sources. Is there a way that I can specify
> that my packages' version numbers are based on the checked out revision?
> Does TCL have backticks or something similar, and could I use that to
> pull this data in?

Usually Portfiles are supposed to generate reproducible results, which
means that they are currently not meant to track a HEAD revision.

At the moment, the version is set at the time of parsing the Portfile.
As this happens before the fetch, the svn revision number is not yet
available.

But even if we store the real version number based on the svn revision
in the registry it wouldn't work. With portdbformat sqlite in
registry2.0, Portfiles are stored in the registry to support
activate/deactivate hooks. The version number would need to be updated
inside the Portfile to work correctly.

I would recommend to manually update the Portfile to the current HEAD
revision or use a sed script to automate the task.

Use something like this:

  svn.revision 123
  version ${svn.revision}

HTH,
Rainer


More information about the macports-users mailing list