Mailing List Archive

h2xs 1.12 Re: h2xs 1.11
>From: Tim Bunce <Tim.Bunce@ig.co.uk>
>> This also changes the default version number in the templates from 0.1 to
>> 0.01. Better than that, it adds the -v option so the default value can be
>> overridden.
>
>Thanks, but I still don't see '$VERSION = ...;' being written into the .pm file.


I have added $VERSION to the PM, and also listed it in the bootstrap arg
list. I have removed the changelog stuff from the PM's POD template,
because a manpage is not a changelog.

Apply this over the 1.11 patch.

We need to get MM to set the PM's version number, folks. Right now MM
doesn't help us at all unless the extension uses two or more XS files, and
that's a rare occasion.

Dean



*** h2xs.PL-1.11 Fri Dec 29 12:55:37 1995
--- h2xs.PL Fri Dec 29 12:54:23 1995
***************
*** 149,155 ****

=cut

! my $H2XS_VERSION = 1.11;
my $TEMPLATE_VERSION = '0.01';

use Getopt::Std;
--- 149,155 ----

=cut

! my( $H2XS_VERSION ) = '$Revision: 1.12 $' =~ /\$Revision:\s+([^\s]+)/;
my $TEMPLATE_VERSION = '0.01';

use Getopt::Std;
***************
*** 286,291 ****
--- 286,293 ----
\@EXPORT = qw(
@const_names
);
+ \$VERSION = '$TEMPLATE_VERSION';
+
END

print PM <<"END" unless $opt_c;
***************
*** 314,320 ****
END

print PM <<"END";
! bootstrap $module;

# Preloaded methods go here.

--- 316,322 ----
END

print PM <<"END";
! bootstrap $module \$VERSION;

# Preloaded methods go here.

***************
*** 351,362 ****
#
#$author, $email
#
- #=head1 MODIFICATION HISTORY
- #
- #=head2 $TEMPLATE_VERSION
- #
- #Initial release.
- #
#=head1 SEE ALSO
#
#perl(1).
--- 353,358 ----
***************
*** 485,491 ****
END
print PL "WriteMakefile(\n";
print PL " 'NAME' => '$module',\n";
! print PL " 'VERSION' => '".$TEMPLATE_VERSION."',\n";
print PL " 'LIBS' => ['$extralibs'], # e.g., '-lm' \n";
print PL " 'DEFINE' => '', # e.g., '-DHAVE_SOMETHING' \n";
print PL " 'INC' => '', # e.g., '-I/usr/include/other' \n";
--- 481,487 ----
END
print PL "WriteMakefile(\n";
print PL " 'NAME' => '$module',\n";
! print PL " 'VERSION' => '$TEMPLATE_VERSION',\n";
print PL " 'LIBS' => ['$extralibs'], # e.g., '-lm' \n";
print PL " 'DEFINE' => '', # e.g., '-DHAVE_SOMETHING' \n";
print PL " 'INC' => '', # e.g., '-I/usr/include/other' \n";
Re: h2xs 1.12 Re: h2xs 1.11 [ In reply to ]
Dean Roehrich <roehrich@cray.com> writes:

> We need to get MM to set the PM's version number, folks. Right now MM
> doesn't help us at all unless the extension uses two or more XS files, and
> that's a rare occasion.

I cannot see any justification to change any file while running
Makefile.PL. The reasonable way IMO is to go the other
direction. Makefile.PL *parses* a pm file and determines the version
number. This is currently up to the authors, and I admit, we could
make it easier for them.

I could imagine, we take a new attribute, say VERSION_DRIVER, which
points to the right pm file (or any existing file) that contains a
line that can be used to compute $VERSION. Graham has sent us some
code to do this, and I have forgotten to do something about it. Sorry.

Here is the code which allows some RCS tricks for the author:

sub pm_version {
my $pmfile = shift;
my $version = undef;
local(*PM,$_);

open(PM,$pmfile) || return undef;

while(<PM>) {
if(/^\s*\$VERSION\s*=/) {
$version = eval $_;
last;
}
}

close(PM);

return $version;
}

I'd like to hear one or two votes, then I put the code and
VERSION_DRIVER in.


> Dean



andreas
Re: h2xs 1.12 Re: h2xs 1.11 [ In reply to ]
> From: Andreas Koenig <k@anna.mind.de>
>
> Dean Roehrich <roehrich@cray.com> writes:
>
> > We need to get MM to set the PM's version number, folks. Right now MM
> > doesn't help us at all unless the extension uses two or more XS files, and
> > that's a rare occasion.
>
> I cannot see any justification to change any file while running
> Makefile.PL. The reasonable way IMO is to go the other direction.
> Makefile.PL *parses* a pm file and determines the version number.

I agree.

> This is currently up to the authors, and I admit, we could make it
> easier for them.

I agree!

> I could imagine, we take a new attribute, say VERSION_DRIVER, which
> points to the right pm file (or any existing file) that contains a
> line that can be used to compute $VERSION. Graham has sent us some
> code to do this, and I have forgotten to do something about it. Sorry.

I'd call it

VERSION_FROM => 'Module.pm'

> Here is the code which allows some RCS tricks for the author:
>
> sub pm_version {
> my $pmfile = shift;
> my $version = undef;
> local(*PM,$_);
> open(PM,$pmfile) || return undef;
> while(<PM>) {
> if(/^\s*\$VERSION\s*=/) {
> $version = eval $_;
> last;
> }
> }
> close(PM);
> return $version;
> }

I'd use a local($VERSION) and not use the return value from the eval.
I'd also loosen the /^\s* since some people may do ($VERSION = ...) =~ ...;

> I'd like to hear one or two votes, then I put the code and
> VERSION_DRIVER in.

Vote. Vote.

:-)

Tim.
Re: h2xs 1.12 Re: h2xs 1.11 [ In reply to ]
Re: h2xs 1.12 Re: h2xs 1.11 [ In reply to ]
Dean Roehrich writes:
>
> I have added $VERSION to the PM, and also listed it in the bootstrap arg
> list. I have removed the changelog stuff from the PM's POD template,
> because a manpage is not a changelog.
>

Anyone else feeling like this? I appreciate having interface changes
visible in manpage very much, this is why I put the section in the
template.

Ilya
Re: h2xs 1.12 Re: h2xs 1.11 [ In reply to ]
In message <199601012209.RAA20914@monk.mps.ohio-state.edu>, Ilya Zakharevich wr
ites:
[...]
>Anyone else feeling like this? I appreciate having interface changes
>visible in manpage very much, this is why I put the section in the
>template.
[...]

Documenting interface changes is quite useful (esp. if it is only
the "important" changes). Since the only documentation many people
see is gennerated from the POD files (for example the source code
is discarded after a succsusful install - or is kept on a machine
"normal" people can't log into), it seems wise to put it in the
POD files.
Re: h2xs 1.12 Re: h2xs 1.11 [ In reply to ]
> From: Ilya Zakharevich <ilya@math.ohio-state.edu>
>
> Dean Roehrich writes:
> >
> > I have added $VERSION to the PM, and also listed it in the bootstrap arg
> > list. I have removed the changelog stuff from the PM's POD template,
> > because a manpage is not a changelog.
>
> Anyone else feeling like this? I appreciate having interface changes
> visible in manpage very much, this is why I put the section in the template.

I also appreciate having interface changes for _recent_ releases _summarised_
in the manpage. Full gory details and ancient history can go elsewhere.

Tim.