Automagic revision numbers with Perl Modules and SVN
Steve Bertrand
steve at ibctech.ca
Fri Jun 12 13:49:00 UTC 2009
Steve Bertrand wrote:
> Hey all,
>
> I've been migrating all of my projects from CVS to SVN (starting over
> from the beginning).
>
> All of the projects in question are Perl modules.
[..snip..]
> Any guidance to fix the version numbering (especially to fix the FreeBSD
> package db) to make it automagic again, is very welcome:
Well, it took longer than I had hoped/expected, but I've finally got my
version automatic again. For the archives:
# cd project_dir
# svn propset svn:keywords "Revision"
...and:
%svn diff -r56 EagleUser.pm
...
-$VERSION = sprintf "%d.%03d", q$Revision: 1.9 $ =~ /: (\d+)\.(\d+)/;
+$VERSION = sprintf "%d", q$Revision$ =~ /(\d+)/;
It took me quite a while to get that change right. Many of the examples
on the 'net did not have the sprintf(), which resulted in $VERSION == 1
no matter what. Once I did the next commit, the current revision was
inserted into 'Revision'.
...now, my desired result:
%pkg_version -v | grep Eagle
bsdpan-EagleUser-73
Cheers and thanks!
Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3233 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20090612/6c841b40/smime.bin
More information about the freebsd-questions
mailing list