r2160 - in packages/libversion-perl/trunk: . debian lib lib/version
t vutil
Krzysztof Krzyzaniak
eloy at costa.debian.org
Tue Feb 21 15:37:11 UTC 2006
Author: eloy
Date: 2006-02-21 15:37:10 +0000 (Tue, 21 Feb 2006)
New Revision: 2160
Added:
packages/libversion-perl/trunk/vperl/
packages/libversion-perl/trunk/vutil/vxs.pm
packages/libversion-perl/trunk/vutil/vxs.xs
Removed:
packages/libversion-perl/trunk/lib/version/vxs.pm
packages/libversion-perl/trunk/lib/version/vxs.xs
Modified:
packages/libversion-perl/trunk/Build.PL
packages/libversion-perl/trunk/Changes
packages/libversion-perl/trunk/MANIFEST
packages/libversion-perl/trunk/META.yml
packages/libversion-perl/trunk/README
packages/libversion-perl/trunk/debian/changelog
packages/libversion-perl/trunk/lib/version.pm
packages/libversion-perl/trunk/lib/version.pod
packages/libversion-perl/trunk/t/coretests.pm
packages/libversion-perl/trunk/vutil/vutil.c
Log:
eloy: new upstream version
Modified: packages/libversion-perl/trunk/Build.PL
===================================================================
--- packages/libversion-perl/trunk/Build.PL 2006-02-21 15:35:43 UTC (rev 2159)
+++ packages/libversion-perl/trunk/Build.PL 2006-02-21 15:37:10 UTC (rev 2160)
@@ -1,6 +1,53 @@
#!/usr/bin/perl
use Module::Build;
+my $perl_only;
+
+my $t = Module::Build->new(
+ module_name => 'version',
+ get_options => {
+ 'perl_only' => { store => \$perl_only },
+ },
+);
+
+my %build_arguments = (
+ dist_name => 'version',
+ dist_version_from => 'lib/version.pm',
+ license => 'perl',
+ requires => {
+ perl => '> 5.005, !=5.9.1, !=5.9.2',
+ },
+ dynamic_config => 1,
+);
+
+mkdir $t->config_dir();
+
+if ( $perl_only ) { #or not $t->have_c_compiler() ) {
+ $build_arguments{module_name} = 'version::vpp';
+ if ( $] > 5.008001 ) {
+ $build_arguments{requires} = {
+ 'Scalar::Util' => 1.08,
+ };
+ }
+ $build_arguments{pm_files} = {
+ './lib/version.pm' => './lib/version.pm',
+ './vperl/vpp.pm' => 'lib/version/vpp.pm',
+ };
+}
+else {
+ $build_arguments{c_source} = './vutil';
+ $build_arguments{module_name} = 'version::vxs';
+ $build_arguments{pm_files} = {
+ './lib/version.pm' => './lib/version.pm',
+ './vutil/vxs.pm' => 'lib/version/vxs.pm'
+ };
+ $build_arguments{xs_files} = {
+ './vutil/vxs.xs' => 'lib/version/vxs.xs'
+ };
+ $build_arguments{add_to_cleanup} =
+ ['lib/version/vxs.*'];
+}
+
my $class = Module::Build->subclass
(
class => 'version::Builder',
@@ -13,14 +60,6 @@
},
);
-my $m = $class->new(
- module_name => 'version::vxs',
- dist_name => 'version',
- license => 'perl',
- c_source => './vutil',
- requires => {
- 'perl' => '> 5.005, !=5.9.1, !=5.9.2',
- 'Module::Build' => '0.2611',
- },
-);
+my $m = $class->new(%build_arguments);
+
$m->create_build_script;
Modified: packages/libversion-perl/trunk/Changes
===================================================================
--- packages/libversion-perl/trunk/Changes 2006-02-21 15:35:43 UTC (rev 2159)
+++ packages/libversion-perl/trunk/Changes 2006-02-21 15:37:10 UTC (rev 2160)
@@ -1,3 +1,40 @@
+2006-02-19 John Peacock <jpeacock at cpan.org>
+
+ Another workaround for incomplete testing
+
+2006-02-17 John Peacock <jpeacock at cpan.org>
+
+ Emergency release to fix up M::B 0.2611 problem
+
+2006-02-16 John Peacock <jpeacock at cpan.org>
+
+ Neglected to clean up after XS code (since we are playing games).
+
+2006-02-16 John Peacock <jpeacock at cpan.org>
+
+ No, really, the final changes before releasing to CPAN. :(
+
+2006-02-16 John Peacock <jpeacock at cpan.org>
+
+ Final updates for 0.54 release to CPAN.
+
+2006-02-14 John Peacock <jpeacock at cpan.org>
+
+ Merge from version-combined branch. Equivalent to RELEASE_0_53_03.
+
+2006-02-09 John Peacock <jpeacock at cpan.org>
+
+ Commit changes prior to push to implement pure Perl alternative.
+
+ * Build.PL
+ Need to exclude building on all 5.9.x bleadperl releases.
+
+ * lib/version.pod
+ Forgot a quote in one of the example code fragments.
+
+ * vutil/vutil.c
+ Sync with bleadperl. Only warn if 'use warnings' is set.
+
2006-01-10 John Peacock <jpeacock at cpan.org>
Release 0.53 to CPAN.
Modified: packages/libversion-perl/trunk/MANIFEST
===================================================================
--- packages/libversion-perl/trunk/MANIFEST 2006-02-21 15:35:43 UTC (rev 2159)
+++ packages/libversion-perl/trunk/MANIFEST 2006-02-21 15:37:10 UTC (rev 2160)
@@ -3,8 +3,6 @@
lib/version.pm
lib/version.pod
lib/version/typemap
-lib/version/vxs.pm
-lib/version/vxs.xs
Makefile.PL
MANIFEST
META.yml
@@ -12,6 +10,9 @@
t/01base.t
t/02derived.t
t/coretests.pm
+vperl/vpp.pm
vutil/vutil.c
vutil/vutil.h
vutil/ppport.h
+vutil/vxs.pm
+vutil/vxs.xs
Modified: packages/libversion-perl/trunk/META.yml
===================================================================
--- packages/libversion-perl/trunk/META.yml 2006-02-21 15:35:43 UTC (rev 2159)
+++ packages/libversion-perl/trunk/META.yml 2006-02-21 15:37:10 UTC (rev 2160)
@@ -1,17 +1,17 @@
---
name: version
-version: 0.53
+version: 0.56
author: ~
abstract: ~
license: perl
requires:
- Module::Build: 0.2611
perl: '> 5.005, !=5.9.1, !=5.9.2'
+dynamic_config: 1
provides:
version:
file: lib/version.pm
- version: 0.53
+ version: 0.56
version::vxs:
- file: lib/version/vxs.pm
- version: 0.53
+ file: vutil/vxs.pm
+ version: 0.55
generated_by: Module::Build version 0.2611
Modified: packages/libversion-perl/trunk/README
===================================================================
--- packages/libversion-perl/trunk/README 2006-02-21 15:35:43 UTC (rev 2159)
+++ packages/libversion-perl/trunk/README 2006-02-21 15:37:10 UTC (rev 2160)
@@ -1,4 +1,4 @@
-version 0.53
+version 0.56
==================================
Provides the same version objects as included in Perl v5.9.x (and hopefully in
@@ -9,40 +9,32 @@
in the core). If you are testing bleadperl, you will need to check out the
latest release of 5.9.x to get the changes included in 0.50.
-Major changes in 0.53
+
+Major changes in 0.56 (was 0.55)
==================================
-The version parsing code always ignored trailing text that couldn't be
-parsed. Now carp about it and show what was ignored. Suggested by David
-Wheeler.
+Nothing at all. This is the second in a series of "not very well tested
+Build.PL" changes. If you want the pure Perl implementation installed you
+must follow the instructions below; the Build.PL file will not do this by
+itself.
-Major changes in 0.52
+Major changes in 0.54
==================================
-Check for malformed initializer ("1_2") based on discussion about
-some bleadperl bugs with vector printing:
+This release includes an optional pure Perl implementation (in case
+you don't have a C-compiler or if some reason you want your code to be
+much slower). You can test it by calling the build script as
- sprintf of version objects
- <https://rt.perl.org/rt3/Ticket/Display.html?id=37897>
+ $ perl Build.PL --perl_only
-Minor changes in 0.51
-==================================
-Continue rewriting the POD as the situation changes with regards to support
-for version objects in various scaffolding programs (CPAN indexer does so
-support version objects).
+and it will install the Perl only version.
-Major changes in 0.50
-==================================
-Completely rewritten POD to hopefully make it clear what is the recommended
-Best Practices (to go along with Damien's book). I also hid the forthcoming
-pure Perl module better (you cannot accidently use it, in other words,
-since it only exists on my hard-drive for now). I also dealt with the
-following bugs:
+NOTE: there is also a significant change in the behavior of the XS module.
+Versions prior to 0.54 mistakenly cloned an existing object, if new()
+was called as an object method. In other words:
- fails tests on AIX 5.1
- <https://rt.cpan.org/Ticket/Display.html?id=15254>
+ $v2 = $v1->new(); # formerly would assign the value of $v1 to $v2
- Missing vpp.pm
- <https://rt.cpan.org/Ticket/Display.html?id=16249>
+This behavior was wrong, and I apologize profusely.
Please read the POD documentation for usage/details. See the CHANGES file
@@ -59,7 +51,7 @@
DEPENDENCIES
-the same C compiler used to build Perl
+The same C compiler used to build Perl (or not).
COPYRIGHT AND LICENCE
Modified: packages/libversion-perl/trunk/debian/changelog
===================================================================
--- packages/libversion-perl/trunk/debian/changelog 2006-02-21 15:35:43 UTC (rev 2159)
+++ packages/libversion-perl/trunk/debian/changelog 2006-02-21 15:37:10 UTC (rev 2160)
@@ -1,3 +1,9 @@
+libversion-perl (0.56-1) unstable; urgency=low
+
+ * New upstream release
+
+ -- Krzysztof Krzyzaniak (eloy) <eloy at debian.org> Tue, 21 Feb 2006 16:35:51 +0100
+
libversion-perl (0.53-1) unstable; urgency=low
* New upstream release
Deleted: packages/libversion-perl/trunk/lib/version/vxs.pm
===================================================================
--- packages/libversion-perl/trunk/lib/version/vxs.pm 2006-02-21 15:35:43 UTC (rev 2159)
+++ packages/libversion-perl/trunk/lib/version/vxs.pm 2006-02-21 15:37:10 UTC (rev 2160)
@@ -1,24 +0,0 @@
-#!perl -w
-package version::vxs;
-
-use 5.005_03;
-use strict;
-
-require Exporter;
-require DynaLoader;
-use vars qw(@ISA $VERSION $CLASS @EXPORT);
-
- at ISA = qw(Exporter DynaLoader);
-
- at EXPORT = qw(qv);
-
-$VERSION = 0.53;
-
-$CLASS = 'version::vxs';
-
-local $^W; # shut up the 'redefined' warning for UNIVERSAL::VERSION
-bootstrap version::vxs if $] < 5.009;
-
-# Preloaded methods go here.
-
-1;
Deleted: packages/libversion-perl/trunk/lib/version/vxs.xs
===================================================================
--- packages/libversion-perl/trunk/lib/version/vxs.xs 2006-02-21 15:35:43 UTC (rev 2159)
+++ packages/libversion-perl/trunk/lib/version/vxs.xs 2006-02-21 15:37:10 UTC (rev 2160)
@@ -1,257 +0,0 @@
-#include "EXTERN.h"
-#include "perl.h"
-#include "XSUB.h"
-#include "vutil.h"
-
-/* --------------------------------------------------
- * $Revision: 2.5 $
- * --------------------------------------------------*/
-
-typedef SV *version_vxs;
-
-MODULE = version::vxs PACKAGE = version::vxs
-
-PROTOTYPES: DISABLE
-VERSIONCHECK: DISABLE
-
-BOOT:
- /* register the overloading (type 'A') magic */
- PL_amagic_generation++;
- newXS("version::vxs::()", XS_version__vxs_noop, file);
- newXS("version::vxs::(\"\"", XS_version__vxs_stringify, file);
- newXS("version::vxs::(0+", XS_version__vxs_numify, file);
- newXS("version::vxs::(cmp", XS_version__vxs_vcmp, file);
- newXS("version::vxs::(<=>", XS_version__vxs_vcmp, file);
- newXS("version::vxs::(bool", XS_version__vxs_boolean, file);
- newXS("version::vxs::(nomethod", XS_version__vxs_noop, file);
- newXS("UNIVERSAL::VERSION", XS_version__vxs_VERSION, file);
-
-void
-new(...)
-PPCODE:
-{
- SV *vs = ST(1);
- SV *rv;
- char *class;
-
- /* get the class if called as an object method */
- if ( sv_isobject(ST(0)) ) {
- class = HvNAME(SvSTASH(SvRV(ST(0))));
- }
- else {
- class = (char *)SvPV_nolen(ST(0));
- }
-
- if (items == 3 )
- {
- STRLEN n_a;
- vs = sv_newmortal();
- sv_setpvf(vs,"v%s",SvPV(ST(2),n_a));
- }
- if ( items == 1 )
- {
- /* no parameter provided */
- if ( sv_isobject(ST(0)) )
- {
- /* copy existing object */
- vs = ST(0);
- }
- else
- {
- /* create empty object */
- vs = sv_newmortal();
- sv_setpv(vs,"");
- }
- }
-
- rv = new_version(vs);
- if ( strcmp(class,"version::vxs") != 0 ) /* inherited new() */
- sv_bless(rv, gv_stashpv(class,TRUE));
-
- PUSHs(sv_2mortal(rv));
-}
-
-void
-stringify (lobj,...)
- version_vxs lobj
-PPCODE:
-{
- PUSHs(sv_2mortal(vstringify(lobj)));
-}
-
-void
-numify (lobj,...)
- version_vxs lobj
-PPCODE:
-{
- PUSHs(sv_2mortal(vnumify(lobj)));
-}
-
-void
-vcmp (lobj,...)
- version_vxs lobj
-PPCODE:
-{
- SV *rs;
- SV * robj = ST(1);
- IV swap = (IV)SvIV(ST(2));
-
- if ( ! sv_derived_from(robj, "version::vxs") )
- {
- robj = sv_2mortal(new_version(robj));
- }
-
- if ( swap )
- {
- rs = newSViv(vcmp(robj,lobj));
- }
- else
- {
- rs = newSViv(vcmp(lobj,robj));
- }
-
- PUSHs(sv_2mortal(rs));
-}
-
-void
-boolean(lobj,...)
- version_vxs lobj
-PPCODE:
-{
- SV *rs;
- rs = newSViv( vcmp(lobj,new_version(newSVpvn("0",1))) );
- PUSHs(sv_2mortal(rs));
-}
-
-void
-noop(lobj,...)
- version_vxs lobj
-CODE:
-{
- Perl_croak(aTHX_ "operation not supported with version object");
-}
-
-void
-is_alpha(lobj)
- version_vxs lobj
-PPCODE:
-{
- if ( hv_exists((HV*)SvRV(lobj), "alpha", 5 ) )
- XSRETURN_YES;
- else
- XSRETURN_NO;
-}
-
-void
-qv(ver)
- SV *ver
-PPCODE:
-{
-#ifdef SvVOK
- if ( !SvVOK(ver) ) { /* not already a v-string */
-#endif
- SV *vs = sv_newmortal();
- char *version;
- if ( SvNOK(ver) ) /* may get too much accuracy */
- {
- char tbuf[64];
- sprintf(tbuf,"%.9"NVgf, SvNVX(ver));
- version = savepv(tbuf);
- }
- else
- {
- STRLEN n_a;
- version = savepv(SvPV(ver,n_a));
- }
- (void)scan_version(version,vs,TRUE);
- Safefree(version);
-
- PUSHs(vs);
-#ifdef SvVOK
- }
- else
- {
- PUSHs(sv_2mortal(new_version(ver)));
- }
-#endif
-}
-
-void
-normal(ver)
- SV *ver
-PPCODE:
-{
- PUSHs(sv_2mortal(vnormal(ver)));
-}
-
-void
-VERSION(sv,...)
- SV *sv
-PPCODE:
-{
- HV *pkg;
- GV **gvp;
- GV *gv;
- char *undef;
-
- if (SvROK(sv)) {
- sv = (SV*)SvRV(sv);
- if (!SvOBJECT(sv))
- Perl_croak(aTHX_ "Cannot find version of an unblessed reference");
- pkg = SvSTASH(sv);
- }
- else {
- pkg = gv_stashsv(sv, FALSE);
- }
-
- gvp = pkg ? (GV**)hv_fetch(pkg,"VERSION",7,FALSE) : Null(GV**);
-
- if (gvp && isGV(gv = *gvp) && SvOK(sv = GvSV(gv))) {
- SV *nsv = sv_newmortal();
- sv_setsv(nsv, sv);
- sv = nsv;
- if ( !sv_derived_from(sv, "version::vxs"))
- upg_version(sv);
- undef = Nullch;
- }
- else {
- sv = (SV*)&PL_sv_undef;
- undef = "(undef)";
- }
-
- if (items > 1) {
- SV *req = ST(1);
- STRLEN len;
-
- if (undef) {
- if (pkg)
- Perl_croak(aTHX_ "%s does not define $%s::VERSION--version check failed",
- HvNAME(pkg), HvNAME(pkg));
- else {
- char *str = SvPVx(ST(0), len);
-
- Perl_croak(aTHX_ "%s defines neither package nor VERSION--version check failed", str);
- }
- }
-
- if ( !sv_derived_from(req, "version::vxs")) {
- /* req may very well be R/O, so create a new object */
- SV *nsv = sv_newmortal();
- sv_setsv(nsv, req);
- req = nsv;
- upg_version(req);
- }
-
- if ( vcmp( req, sv ) > 0 )
- Perl_croak(aTHX_ "%s version %"SVf" (%"SVf") required--"
- "this is only version %"SVf" (%"SVf")", HvNAME(pkg),
- vnumify(req),vnormal(req),vnumify(sv),vnormal(sv));
- }
-
- if ( SvOK(sv) && sv_derived_from(sv, "version::vxs") )
- PUSHs(vnumify(sv));
- else
- PUSHs(sv);
-
- XSRETURN(1);
-}
Modified: packages/libversion-perl/trunk/lib/version.pm
===================================================================
--- packages/libversion-perl/trunk/lib/version.pm 2006-02-21 15:35:43 UTC (rev 2159)
+++ packages/libversion-perl/trunk/lib/version.pm 2006-02-21 15:37:10 UTC (rev 2160)
@@ -11,18 +11,18 @@
@EXPORT = qw(qv);
-$VERSION = 0.53;
+$VERSION = 0.56;
$CLASS = 'version';
-eval { require version::vxs; };
+eval "use version::vxs $VERSION";
if ( $@ ) # don't have the XS version installed
{
-# eval { require version::vpp }; # don't tempt fate
+ eval "use version::vpp $VERSION"; # don't tempt fate
die "$@" if ( $@ );
-# push @ISA, "version::PP";
-# *qv = \&version::vpp::qv;
+ push @ISA, "version::vpp";
+ *qv = \&version::vpp::qv;
}
else # use XS module
{
Modified: packages/libversion-perl/trunk/lib/version.pod
===================================================================
--- packages/libversion-perl/trunk/lib/version.pod 2006-02-21 15:35:43 UTC (rev 2159)
+++ packages/libversion-perl/trunk/lib/version.pod 2006-02-21 15:37:10 UTC (rev 2160)
@@ -110,7 +110,7 @@
$v = version->new(1.002); # 1.002, but compares like 1.2.0
$v = version->new(1.002003); # 1.002003
- $v2 = version->new( "1.2.3"); # v1.2.3
+ $v2 = version->new("1.2.3"); # v1.2.3
In specific, version numbers initialized as L<Numeric Versions> will
stringify in Numeric form. Version numbers initialized as L<Extended Versions>
@@ -161,7 +161,7 @@
# Prints
$v = version->new( "v1.200"); # v1.200.0
$v = version->new("v1.20.0"); # v1.20.0
- $v = qv("v1.2.3); # v1.2.3
+ $v = qv("v1.2.3"); # v1.2.3
$v = qv("1.2.3"); # v1.2.3
$v = qv("1.20"); # v1.20.0
@@ -236,9 +236,15 @@
or as an object method:
$v1 = version->new(12.3);
+ $v2 = $v1->new(12.3);
+
+and in each case, $v1 and $v2 will be identical. NOTE: if you create
+a new object using an existing object like this:
+
$v2 = $v1->new();
-and in each case, $v1 and $v2 will be identical.
+the new object B<will not> be a clone of the existing object. In the
+example case, $v2 will be an empty object of the same type as $v1.
=back
Modified: packages/libversion-perl/trunk/t/coretests.pm
===================================================================
--- packages/libversion-perl/trunk/t/coretests.pm 2006-02-21 15:35:43 UTC (rev 2159)
+++ packages/libversion-perl/trunk/t/coretests.pm 2006-02-21 15:37:10 UTC (rev 2160)
@@ -213,7 +213,8 @@
"new from existing object");
ok ($new_version == $version, "class->new($version) identical");
$new_version = $version->new();
- ok ($new_version == $version, "$version->new() also identical");
+ isa_ok ($new_version, $CLASS );
+ is ($new_version, "0.000", "version->new() doesn't clone");
$new_version = $version->new("1.2.3");
is ($new_version, "v1.2.3" , '$version->new("1.2.3") works too');
Copied: packages/libversion-perl/trunk/vperl (from rev 2159, packages/libversion-perl/branches/upstream/current/vperl)
Modified: packages/libversion-perl/trunk/vutil/vutil.c
===================================================================
--- packages/libversion-perl/trunk/vutil/vutil.c 2006-02-21 15:35:43 UTC (rev 2159)
+++ packages/libversion-perl/trunk/vutil/vutil.c 2006-02-21 15:37:10 UTC (rev 2160)
@@ -284,7 +284,9 @@
}
s = scan_version(version, ver, qv);
if ( *s != '\0' )
- warn( "Version string '%s' contains invalid data; "
+ if(ckWARN(WARN_MISC))
+ Perl_warner(aTHX_ packWARN(WARN_MISC),
+ "Version string '%s' contains invalid data; "
"ignoring: '%s'", version, s);
Safefree(version);
return ver;
Copied: packages/libversion-perl/trunk/vutil/vxs.pm (from rev 2159, packages/libversion-perl/branches/upstream/current/vutil/vxs.pm)
Copied: packages/libversion-perl/trunk/vutil/vxs.xs (from rev 2159, packages/libversion-perl/branches/upstream/current/vutil/vxs.xs)
More information about the Pkg-perl-cvs-commits
mailing list