Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH pod/perlmod.pod] Simpler $Revision$ based $VERSION. Plus, repentance!

2 views
Skip to first unread message

Michael G Schwern

unread,
May 3, 2003, 6:30:16 PM5/3/03
to perl5-...@perl.org
Attached is a much, much, much simpler way to set your $VERSION from a
RCS/CVS $Revision$ for perlmod.

Also, I come to repent. Way back when this was added I defended using
sprintf "%02d" saying [1]:

When you put out your 98th minor revision to your module, let me know
and we'll fix it. :)

Seriously, having 100 minor revisions is extremely rare (hell, having
100 revisions at ALL is rare)

$ cvs status lib/ExtUtils/MakeMaker.pm
===================================================================
File: MakeMaker.pm Status: Locally Modified

Working revision: 1.109 Tue Apr 8 04:16:11 2003

*embarassed cough*


--- pod/perlmod.pod 2003/05/03 22:17:32 1.1
+++ pod/perlmod.pod 2003/05/03 22:18:08
@@ -335,7 +335,7 @@
# set the version for version checking
$VERSION = 1.00;
# if using RCS/CVS, this may be preferred
- $VERSION = do { my @r = (q$Revision: 1.1 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; # must be all one line, for MakeMaker
+ $VERSION = sprintf "%d.%03d", q$Revision: 1.1 $ =~ /(\d+)/g;

@ISA = qw(Exporter);
@EXPORT = qw(&func1 &func2 &func4);


[1] http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2001-07/msg01509.html

--
The eye opening delightful morning taste of expired cheese bits in sour milk!

Andreas J. Koenig

unread,
May 3, 2003, 11:05:23 PM5/3/03
to Michael G Schwern, perl5-...@perl.org
>>>>> On Sat, 3 May 2003 15:30:16 -0700, Michael G Schwern <sch...@pobox.com> said:

> - $VERSION = do { my @r = (q$Revision: 1.1 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; # must be all one line, for MakeMaker
> + $VERSION = sprintf "%d.%03d", q$Revision: 1.1 $ =~ /(\d+)/g;

IIRC, if you ever branch in RCS, you are forced to use N.N.N.N style
revision numbers.


--
andreas

Michael G Schwern

unread,
May 4, 2003, 12:18:51 AM5/4/03
to Andreas J. Koenig, perl5-...@perl.org

IMHO rather than making the common case n this simple example
unnecessarily complex, dealing with branches is best left as an exercise
for the reader. [1] I've put the full code for dealing with branches into
ExtUtils::MakeMaker::FAQ.

[1] Note how I RESISTED THE URGE to say that branching is extremely rare

--
Do not try comedy at home! Milk & Cheese are advanced experts! Attempts at
comedy can be dangerously unfunny!

Andreas J. Koenig

unread,
May 4, 2003, 2:12:51 AM5/4/03
to Michael G Schwern, Andreas J. Koenig, perl5-...@perl.org
>>>>> On Sat, 3 May 2003 21:18:51 -0700, Michael G Schwern <sch...@pobox.com> said:

> IMHO rather than making the common case n this simple example
> unnecessarily complex, dealing with branches is best left as an exercise
> for the reader. [1] I've put the full code for dealing with branches into
> ExtUtils::MakeMaker::FAQ.

Very good.

> [1] Note how I RESISTED THE URGE to say that branching is extremely rare

I'M IMPRESSED:-)

--
andreas

Jarkko Hietaniemi

unread,
May 5, 2003, 3:34:37 PM5/5/03
to Michael G Schwern, perl5-...@perl.org
Wow, patches with repentance. Thanks, applied (change #19425)

--
Jarkko Hietaniemi <j...@iki.fi> http://www.iki.fi/jhi/ "There is this special
biologist word we use for 'stable'. It is 'dead'." -- Jack Cohen

0 new messages