Even though I'm sure I probably shouldn't do this, I did figure out how:<div><br></div><div><blockquote class="gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; ">
svn.revision [exec svn info <a href="https://svn.example.com/foo/bar/baz">https://svn.example.com/foo/bar/baz</a> | perl -n -e "if ( /^Last Changed Rev: (\\d+)$/ ) { print \$1 };"]</blockquote><div><br></div>
<div>Rainer, I'm not sure I understand your explanation completely. If I:</div><div><ol><li>portindex</li><li>increment the revision of the project's directory</li><li>port install portname</li></ol>and then run 'port info --version portname' will I see the revision my Portfile gave when I ran 'portindex' originally?</div>
<div><br></div><div>Even with that discrepancy, I think I can work around it by determining if we're running 'portindex' or 'port livecheck', etc. and do the right thing instead of always overriding svn.revision based on what my Subversion server says. Of course, this will probably mean I'll have to do some bookkeeping, store data into a local file, or something to that effect - which I'm perfectly fine with.</div>
<div><br></div><div>Criticism/comments welcome.</div><br><div class="gmail_quote">On Thu, Jan 13, 2011 at 11:14 AM, Jon Hermansen <span dir="ltr"><<a href="mailto:jon.hermansen@gmail.com">jon.hermansen@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hey Rainer,<div> Yep, that's how I figured it'd work. I may end up using $Rev$ in the Portfile, since my ports are now in our Subversion repository and that is a relatively easy way to track when they change.</div>
<div><br></div><div>Thanks for the help!<div><div></div><div class="h5"><br><br><div class="gmail_quote">On Thu, Jan 13, 2011 at 9:41 AM, Rainer Müller <span dir="ltr"><<a href="mailto:raimue@macports.org" target="_blank">raimue@macports.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Jon,<br>
<div><br>
On 2011-01-13 09:33 , Jon Hermansen wrote:<br>
> I'm writing some Portfiles as an experiment for some tools I use at<br>
> work. We keep these packages in Subversion and I am currently using<br>
> 'fetch.type svn' to pull the sources. Is there a way that I can specify<br>
> that my packages' version numbers are based on the checked out revision?<br>
> Does TCL have backticks or something similar, and could I use that to<br>
> pull this data in?<br>
<br>
</div>Usually Portfiles are supposed to generate reproducible results, which<br>
means that they are currently not meant to track a HEAD revision.<br>
<br>
At the moment, the version is set at the time of parsing the Portfile.<br>
As this happens before the fetch, the svn revision number is not yet<br>
available.<br>
<br>
But even if we store the real version number based on the svn revision<br>
in the registry it wouldn't work. With portdbformat sqlite in<br>
registry2.0, Portfiles are stored in the registry to support<br>
activate/deactivate hooks. The version number would need to be updated<br>
inside the Portfile to work correctly.<br>
<br>
I would recommend to manually update the Portfile to the current HEAD<br>
revision or use a sed script to automate the task.<br>
<br>
Use something like this:<br>
<br>
svn.revision 123<br>
version ${svn.revision}<br>
<br>
HTH,<br>
<font color="#888888">Rainer<br>
</font></blockquote></div><br></div></div></div>
</blockquote></div><br></div>