append svn revision to port version

Bradley Giesbrecht pixilla at macports.org
Fri Dec 9 14:25:24 PST 2011


On Dec 9, 2011, at 1:56 PM, Dan Ports wrote:

> On Fri, Dec 09, 2011 at 12:42:53PM -0800, Bradley Giesbrecht wrote:
>> Is there any interest in adding the svn revision to the MACPORTS_VERSION when port is built from trunk?
>> 
>> I wrote a shell script "getversion.sh" and call it from configure to add "-$REVISION" when MACPORTS_VERSION  revision/patch-level is 99 and svn info is successful.
> 
> Sounds like a good idea to me. I would probably use `svnversion` rather
> than `svn info` to get the revision number. In addition to being a
> little simpler, it'll also indicate whether the working copy had local
> modifications (or mixed revisions or more esoteric things).

From svnversion --help:
   4123:4168     mixed revision working copy
   4168M         modified working copy
   4123S         switched working copy
   4123P         partial working copy, from a sparse checkout
   4123:4168MS   mixed revision, modified, switched working copy


Dan, I am not that familiar with svn. Are you suggesting something like the following?

base/getversion.sh:
# Path to me.
DIRNAME=$(dirname $0)
SVN_REVISION=$(svnversion -n $DIRNAME)


Regards,
Bradley Giesbrecht (pixilla)






More information about the macports-dev mailing list