[Orca-checkins] r382 - in trunk/orca: . packages/version-0.41 packages/version-0.42 packages/version-0.42/lib packages/version-0.42/t
Blair Zajac
blair at orcaware.com
Sat Aug 21 12:12:28 PDT 2004
Author: blair
Date: Sat Aug 21 12:10:28 2004
New Revision: 382
Added:
trunk/orca/packages/version-0.42/
- copied from r381, trunk/orca/packages/version-0.41/
Removed:
trunk/orca/packages/version-0.41/
Modified:
trunk/orca/INSTALL
trunk/orca/configure.in
trunk/orca/packages/version-0.42/Changes
trunk/orca/packages/version-0.42/META.yml
trunk/orca/packages/version-0.42/Makefile.PL
trunk/orca/packages/version-0.42/README
trunk/orca/packages/version-0.42/lib/version.pm
trunk/orca/packages/version-0.42/t/01base.t
trunk/orca/packages/version-0.42/util.c
trunk/orca/packages/version-0.42/version.xs
Log:
Upgrade the Perl version module from 0.41 to 0.42 and require the new
module for Orca.
* configure.in:
Bump version's version number to 0.42.
* INSTALL (Determine which Perl modules need compiling and installing):
Update all references to version's version number from 0.41 to
0.42.
* packages/version-0.42:
Renamed from packages/version-0.41. Directory contents updated
from version-0.42.tar.gz.
Modified: trunk/orca/INSTALL
==============================================================================
--- trunk/orca/INSTALL (original)
+++ trunk/orca/INSTALL Sat Aug 21 12:10:28 2004
@@ -178,7 +178,7 @@
RRDs >= 1.000491 >= 1.0.49 1.0.49
Storable >= 2.13 >= 2.13 2.13
Time::HiRes Not required by Orca 1.59
- version >= 0.41 >= 0.41 0.41
+ version >= 0.42 >= 0.42 0.42
All seven of these modules are included with the Orca distribution
in the packages directory. When you configure Orca in step 3),
@@ -290,10 +290,10 @@
version
- http://www.perl.com/CPAN/authors/id/J/JP/JPEACOCK/version-0.41.tar.gz
+ http://www.perl.com/CPAN/authors/id/J/JP/JPEACOCK/version-0.42.tar.gz
- % gunzip -c version-0.41.tar.gz | tar xvf -
- % cd version-0.41
+ % gunzip -c version-0.42.tar.gz | tar xvf -
+ % cd version-0.42
% perl Makefile.PL
% make
% make test
Modified: trunk/orca/configure.in
==============================================================================
--- trunk/orca/configure.in (original)
+++ trunk/orca/configure.in Sat Aug 21 12:10:28 2004
@@ -43,8 +43,8 @@
STORABLE_VER=2.13
TIME_HIRES_DIR=Time-HiRes-1.59
TIME_HIRES_VER=1.59
-VERSION_DIR=version-0.41
-VERSION_VER=0.41
+VERSION_DIR=version-0.42
+VERSION_VER=0.42
AC_SUBST(COMPRESS_ZLIB_DIR)
AC_SUBST(DATA_DUMPER_DIR)
Modified: trunk/orca/packages/version-0.42/Changes
==============================================================================
--- trunk/orca/packages/version-0.41/Changes (original)
+++ trunk/orca/packages/version-0.42/Changes Sat Aug 21 12:10:28 2004
@@ -1,4 +1,19 @@
------------------------------------------------------------------------
+r372 | jpeacock | 2004-08-18 07:04:02 -0400 (Wed, 18 Aug 2004) | 12 lines
+
+* Makefile.PL
+ swap () for {} in macro expansion to make Win32 happy again
+
+* t/01base.t
+* lib/version.pm
+* README
+* version.xs
+* util.c
+ Change default stringification of alpha versions to be more like
+ their floating point counterparts (since that is normally how they
+ are used in practice).
+
+------------------------------------------------------------------------
r319 | jpeacock | 2004-07-12 23:07:10 -0400 (Mon, 12 Jul 2004) | 13 lines
* util.c
Modified: trunk/orca/packages/version-0.42/META.yml
==============================================================================
--- trunk/orca/packages/version-0.41/META.yml (original)
+++ trunk/orca/packages/version-0.42/META.yml Sat Aug 21 12:10:28 2004
@@ -1,7 +1,7 @@
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: version
-version: 0.41
+version: 0.42
version_from: lib/version.pm
installdirs: site
requires:
Modified: trunk/orca/packages/version-0.42/Makefile.PL
==============================================================================
--- trunk/orca/packages/version-0.41/Makefile.PL (original)
+++ trunk/orca/packages/version-0.42/Makefile.PL Sat Aug 21 12:10:28 2004
@@ -12,6 +12,6 @@
# Un-comment this if you add C files to link with later:
'OBJECT' => '$(O_FILES)', # link all the C files too
dist => {
- PREOP => 'svn log > ${DISTVNAME}/Changes',
+ PREOP => 'svn log > $(DISTVNAME)/Changes',
},
);
Modified: trunk/orca/packages/version-0.42/README
==============================================================================
--- trunk/orca/packages/version-0.41/README (original)
+++ trunk/orca/packages/version-0.42/README Sat Aug 21 12:10:28 2004
@@ -1,4 +1,4 @@
-version 0.41
+version 0.42
====================
Provides the same version objects as included in Perl v5.9.0 (and hopefully in
Modified: trunk/orca/packages/version-0.42/lib/version.pm
==============================================================================
--- trunk/orca/packages/version-0.41/lib/version.pm (original)
+++ trunk/orca/packages/version-0.42/lib/version.pm Sat Aug 21 12:10:28 2004
@@ -12,7 +12,7 @@
@EXPORT = qw(qv);
-$VERSION = 0.41; # stop using CVS and switch to subversion
+$VERSION = 0.42; # stop using CVS and switch to subversion
$CLASS = 'version';
Modified: trunk/orca/packages/version-0.42/t/01base.t
==============================================================================
--- trunk/orca/packages/version-0.41/t/01base.t (original)
+++ trunk/orca/packages/version-0.42/t/01base.t Sat Aug 21 12:10:28 2004
@@ -48,7 +48,7 @@
# Test quoted number processing
diag "tests with quoted numbers" unless $ENV{PERL_CORE};
$version = $CLASS->new("5.005_03");
- is ( "$version" , "5.5_30" , '"5.005_03" eq "5.5_30"' );
+ is ( "$version" , "5.005_030" , '"5.005_03" eq "5.005_030"' );
$version = $CLASS->new("v1.23");
is ( "$version" , "1.23.0" , '"v1.23" eq "1.23.0"' );
Modified: trunk/orca/packages/version-0.42/util.c
==============================================================================
--- trunk/orca/packages/version-0.41/util.c (original)
+++ trunk/orca/packages/version-0.42/util.c Sat Aug 21 12:10:28 2004
@@ -31,6 +31,7 @@
bool saw_under = 0;
SV* sv = newSVrv(rv, "version"); /* create an SV and upgrade the RV */
(void)sv_upgrade(sv, SVt_PVAV); /* needs to be an AV type */
+ AvREAL_on((AV*)sv);
/* pre-scan the imput string to check for decimals */
while ( *pos == '.' || *pos == '_' || isDIGIT(*pos) )
@@ -117,7 +118,15 @@
}
if ( qv ) { /* quoted versions always become full version objects */
I32 len = av_len((AV *)sv);
- for ( len = 2 - len; len > 0; len-- )
+ /* This for loop appears to trigger a compiler bug on OS X, as it
+ loops infinitely. Yes, len is negative. No, it makes no sense.
+ Compiler in question is:
+ gcc version 3.3 20030304 (Apple Computer, Inc. build 1640)
+ for ( len = 2 - len; len > 0; len-- )
+ av_push((AV *)sv, newSViv(0));
+ */
+ len = 2 - len;
+ while (len-- > 0)
av_push((AV *)sv, newSViv(0));
}
return s;
@@ -146,6 +155,7 @@
AV *av = (AV *)SvRV(ver);
SV* sv = newSVrv(rv, "version"); /* create an SV and upgrade the RV */
(void)sv_upgrade(sv, SVt_PVAV); /* needs to be an AV type */
+ AvREAL_on((AV*)sv);
for ( key = 0; key <= av_len(av); key++ )
{
I32 rev = SvIV(*av_fetch(av, key, FALSE));
@@ -247,11 +257,14 @@
digit = SvIVX(*av_fetch((AV *)vs, i, 0));
Perl_sv_catpvf(aTHX_ sv,"%03d", (int)PERL_ABS(digit));
}
+
if ( len > 0 )
{
digit = SvIVX(*av_fetch((AV *)vs, len, 0));
if ( (int)PERL_ABS(digit) != 0 || len == 1 )
{
+ if ( digit < 0 ) /* alpha version */
+ Perl_sv_catpv(aTHX_ sv,"_");
/* Don't display additional trailing zeros */
Perl_sv_catpvf(aTHX_ sv,"%03d", (int)PERL_ABS(digit));
}
@@ -323,12 +336,13 @@
SV *
Perl_vstringify(pTHX_ SV *vs)
{
- I32 i, len, digit;
+ I32 len, digit;
if ( SvROK(vs) )
vs = SvRV(vs);
len = av_len((AV *)vs);
+ digit = SvIVX(*av_fetch((AV *)vs, len, 0));
- if ( len < 2 )
+ if ( len < 2 || ( len == 2 && digit < 0 ) )
return vnumify(vs);
else
return vnormal(vs);
Modified: trunk/orca/packages/version-0.42/version.xs
==============================================================================
--- trunk/orca/packages/version-0.41/version.xs (original)
+++ trunk/orca/packages/version-0.42/version.xs Sat Aug 21 12:10:28 2004
@@ -26,7 +26,7 @@
newXS("version::(nomethod", XS_version_noop, file);
newXS("UNIVERSAL::VERSION", XS_version_VERSION, file);
-version
+void
new(class,...)
char *class
PPCODE:
@@ -69,7 +69,6 @@
PPCODE:
{
SV *rs;
- SV *rvs;
SV * robj = ST(1);
IV swap = (IV)SvIV(ST(2));
More information about the Orca-checkins
mailing list