[Orca-checkins] r334 - in trunk/orca: . config packages packages/version-0.39 packages/version-0.39/lib packages/version-0.39/t

Blair Zajac blair at orcaware.com
Sat Jun 5 23:04:23 PDT 2004


Author: blair
Date: Sat Jun  5 23:02:34 2004
New Revision: 334

Added:
   trunk/orca/packages/version-0.39/
   trunk/orca/packages/version-0.39/Changes
   trunk/orca/packages/version-0.39/MANIFEST
   trunk/orca/packages/version-0.39/META.yml
   trunk/orca/packages/version-0.39/Makefile.PL
   trunk/orca/packages/version-0.39/README
   trunk/orca/packages/version-0.39/lib/
   trunk/orca/packages/version-0.39/lib/version.pm
   trunk/orca/packages/version-0.39/ppport.h
   trunk/orca/packages/version-0.39/t/
   trunk/orca/packages/version-0.39/t/01base.t   (contents, props changed)
   trunk/orca/packages/version-0.39/typemap   (contents, props changed)
   trunk/orca/packages/version-0.39/util.c
   trunk/orca/packages/version-0.39/util.h
   trunk/orca/packages/version-0.39/version.xs
Modified:
   trunk/orca/INSTALL
   trunk/orca/config/acinclude.m4
   trunk/orca/configure.in
   trunk/orca/packages/Makefile.in
Log:
Add the Perl module version 0.39 to the distribution.  It will be used
to let the user require specific versions of Orca.

* configure.in
  (VERSION_DIR):
    New variable pointing to the version directory.
  (VERSION_VER):
    New variable holding the required version of the version module.
  Check for the required version of the Perl version module.

* config/acinclude.m4
  (BORP_PERL_MODULE):
    Remove the word 'version' from the checking message.

* INSTALL (Determine which Perl modules need compiling and installing):
  Add version 0.39 to the list of Perl modules.
  Add instructions on how to download and install the version module.

* packages/Makefile.in:
  Add rules to build the Perl version module.

* packages/version-0.39:
  Directory contents copied from version-0.39.tar.gz.


Modified: trunk/orca/INSTALL
==============================================================================
--- trunk/orca/INSTALL	(original)
+++ trunk/orca/INSTALL	Sat Jun  5 23:02:34 2004
@@ -178,6 +178,7 @@
     RRDs                    >= 1.000461    >= 1.0.46    1.0.46
     Storable                >= 2.12        >= 2.12      2.12
     Time::HiRes             Not required by Orca        1.59
+    version                 >= 0.39        >= 0.39      0.39
 
     All seven of these modules are included with the Orca distribution
     in the packages directory.  When you configure Orca in step 3),
@@ -287,6 +288,17 @@
       % make test
       % make install
 
+    version
+
+      http://www.perl.com/CPAN/authors/id/J/JP/JPEACOCK/version-0.39.tar.gz
+
+      % gunzip -c version-0.39.tar.gz | tar xvf -
+      % cd version-0.39
+      % perl Makefile.PL
+      % make
+      % make test
+      % make install
+
  5) Make Orca and any necessary Perl modules.
 
     To make Orca and these Perl modules run the following command:

Modified: trunk/orca/config/acinclude.m4
==============================================================================
--- trunk/orca/config/acinclude.m4	(original)
+++ trunk/orca/config/acinclude.m4	Sat Jun  5 23:02:34 2004
@@ -5,7 +5,7 @@
 dnl BORP_PERL_MODULE(DEFINE, PATH_TO_PERL, MODULE_NAME, MODULE_VERSION,
 dnl    [ACTION_IF_FOUND, [ACTION_IF_NOT_FOUND]]
 AC_DEFUN([BORP_PERL_MODULE], [
-  AC_MSG_CHECKING([if Perl module $3 version $4 is installed])
+  AC_MSG_CHECKING([if Perl module $3 $4 is installed])
   if $2 ./config/check_for_perl_mod $3 $4; then
     $1=yes
     ifelse([$5], , , [$5])

Modified: trunk/orca/configure.in
==============================================================================
--- trunk/orca/configure.in	(original)
+++ trunk/orca/configure.in	Sat Jun  5 23:02:34 2004
@@ -43,6 +43,8 @@
 STORABLE_VER=2.12
 TIME_HIRES_DIR=Time-HiRes-1.59
 TIME_HIRES_VER=1.59
+VERSION_DIR=version-0.39
+VERSION_VER=0.39
 
 AC_SUBST(COMPRESS_ZLIB_DIR)
 AC_SUBST(DATA_DUMPER_DIR)
@@ -53,6 +55,8 @@
 AC_SUBST(RRDTOOL_DIR)
 AC_SUBST(STORABLE_DIR)
 AC_SUBST(TIME_HIRES_DIR)
+AC_SUBST(VERSION_DIR)
+
 AC_SUBST(COMPRESS_ZLIB_VER)
 AC_SUBST(DATA_DUMPER_VER)
 AC_SUBST(DATE_PARSE_VER)
@@ -62,6 +66,7 @@
 AC_SUBST(RRDTOOL_VER)
 AC_SUBST(STORABLE_VER)
 AC_SUBST(TIME_HIRES_VER)
+AC_SUBST(VERSION_VER)
 
 # Get the current working directory and the config directory.
 cwd=`pwd`
@@ -517,6 +522,24 @@
 AC_SUBST(DISTCLEAN_TIME_HIRES)
 AC_SUBST(PERL_USE_TIME_HIRES)
 
+BORP_PERL_MODULE(orca_cv_perl_module_version,
+                 $PERL,
+                 version,
+                 $VERSION_VER)
+test "$ALWAYS_BUILD_PERL_MODULES" && orca_cv_perl_module_version=no
+if test "$orca_cv_perl_module_version" = no; then
+  MAKE_VERSION=make_version
+  TEST_VERSION=test_version
+  INSTALL_PERL_VERSION=install_perl_version
+  CLEAN_VERSION=clean_version
+  DISTCLEAN_VERSION=distclean_version
+fi
+AC_SUBST(MAKE_VERSION)
+AC_SUBST(TEST_VERSION)
+AC_SUBST(INSTALL_PERL_VERSION)
+AC_SUBST(CLEAN_VERSION)
+AC_SUBST(DISTCLEAN_VERSION)
+
 # Define the INSTALL and MKDIR variables to point to the scripts in
 # the config directory.
 INSTALL="$config_dir/install-sh -c"

Modified: trunk/orca/packages/Makefile.in
==============================================================================
--- trunk/orca/packages/Makefile.in	(original)
+++ trunk/orca/packages/Makefile.in	Sat Jun  5 23:02:34 2004
@@ -18,6 +18,7 @@
 math_intervalsearch_dir          = @MATH_INTERVALSEARCH_DIR@
 rrdtool_dir                      = @RRDTOOL_DIR@
 storable_dir                     = @STORABLE_DIR@
+version_dir                      = @VERSION_DIR@
 
 MAKE_COMPRESS_ZLIB               = @MAKE_COMPRESS_ZLIB@
 MAKE_DATA_DUMPER                 = @MAKE_DATA_DUMPER@
@@ -27,6 +28,7 @@
 MAKE_MATH_INTERVALSEARCH         = @MAKE_MATH_INTERVALSEARCH@
 MAKE_RRDTOOL                     = @MAKE_RRDTOOL@
 MAKE_STORABLE                    = @MAKE_STORABLE@
+MAKE_VERSION                     = @MAKE_VERSION@
 MAKE_TARGETS                     = $(MAKE_COMPRESS_ZLIB) \
                                    $(MAKE_DATA_DUMPER) \
                                    $(MAKE_DATE_PARSE) \
@@ -34,7 +36,8 @@
                                    $(MAKE_DIGEST_MD5) \
                                    $(MAKE_MATH_INTERVALSEARCH) \
                                    $(MAKE_RRDTOOL) \
-                                   $(MAKE_STORABLE)
+                                   $(MAKE_STORABLE) \
+                                   $(MAKE_VERSION)
 
 TEST_COMPRESS_ZLIB               = @TEST_COMPRESS_ZLIB@
 TEST_DATA_DUMPER                 = @TEST_DATA_DUMPER@
@@ -44,6 +47,7 @@
 TEST_MATH_INTERVALSEARCH         = @TEST_MATH_INTERVALSEARCH@
 TEST_RRDTOOL                     = @TEST_RRDTOOL@
 TEST_STORABLE                    = @TEST_STORABLE@
+TEST_VERSION                     = @TEST_VERSION@
 TEST_TARGETS                     = $(TEST_COMPRESS_ZLIB) \
                                    $(TEST_DATA_DUMPER) \
                                    $(TEST_DATE_PARSE) \
@@ -51,7 +55,8 @@
                                    $(TEST_DIGEST_MD5) \
                                    $(TEST_MATH_INTERVALSEARCH) \
                                    $(TEST_RRDTOOL) \
-                                   $(TEST_STORABLE)
+                                   $(TEST_STORABLE) \
+                                   $(TEST_VERSION)
 
 INSTALL_PERL_COMPRESS_ZLIB       = @INSTALL_PERL_COMPRESS_ZLIB@
 INSTALL_PERL_DATA_DUMPER         = @INSTALL_PERL_DATA_DUMPER@
@@ -61,6 +66,7 @@
 INSTALL_PERL_MATH_INTERVALSEARCH = @INSTALL_PERL_MATH_INTERVALSEARCH@
 INSTALL_PERL_RRDTOOL             = @INSTALL_PERL_RRDTOOL@
 INSTALL_PERL_STORABLE            = @INSTALL_PERL_STORABLE@
+INSTALL_PERL_VERSION             = @INSTALL_PERL_VERSION@
 INSTALL_PERL_TARGETS             = $(INSTALL_PERL_COMPRESS_ZLIB) \
                                    $(INSTALL_PERL_DATA_DUMPER) \
                                    $(INSTALL_PERL_DATE_PARSE) \
@@ -68,7 +74,8 @@
                                    $(INSTALL_PERL_DIGEST_MD5) \
                                    $(INSTALL_PERL_MATH_INTERVALSEARCH) \
                                    $(INSTALL_PERL_RRDTOOL) \
-                                   $(INSTALL_PERL_STORABLE)
+                                   $(INSTALL_PERL_STORABLE) \
+                                   $(INSTALL_PERL_VERSION)
 
 INSTALL_LIB_RRDTOOL              = @INSTALL_LIB_RRDTOOL@
 INSTALL_LIB_TARGETS              = $(INSTALL_LIB_RRDTOOL)
@@ -81,6 +88,7 @@
 CLEAN_MATH_INTERVALSEARCH        = @CLEAN_MATH_INTERVALSEARCH@
 CLEAN_RRDTOOL                    = @CLEAN_RRDTOOL@
 CLEAN_STORABLE                   = @CLEAN_STORABLE@
+CLEAN_VERSION                    = @CLEAN_VERSION@
 CLEAN_TARGETS                    = $(CLEAN_COMPRESS_ZLIB) \
                                    $(CLEAN_DATA_DUMPER) \
                                    $(CLEAN_DATE_PARSE) \
@@ -88,7 +96,8 @@
                                    $(CLEAN_DIGEST_MD5) \
                                    $(CLEAN_MATH_INTERVALSEARCH) \
                                    $(CLEAN_RRDTOOL) \
-                                   $(CLEAN_STORABLE)
+                                   $(CLEAN_STORABLE) \
+                                   $(CLEAN_VERSION)
 
 DISTCLEAN_COMPRESS_ZLIB          = @DISTCLEAN_COMPRESS_ZLIB@
 DISTCLEAN_DATA_DUMPER            = @DISTCLEAN_DATA_DUMPER@
@@ -98,14 +107,16 @@
 DISTCLEAN_MATH_INTERVALSEARCH    = @DISTCLEAN_MATH_INTERVALSEARCH@
 DISTCLEAN_RRDTOOL                = @DISTCLEAN_RRDTOOL@
 DISTCLEAN_STORABLE               = @DISTCLEAN_STORABLE@
-DISTCLEAN_TARGETS        	 = $(DISTCLEAN_COMPRESS_ZLIB) \
+DISTCLEAN_VERSION                = @DISTCLEAN_VERSION@
+DISTCLEAN_TARGETS                = $(DISTCLEAN_COMPRESS_ZLIB) \
                                    $(DISTCLEAN_DATA_DUMPER) \
                                    $(DISTCLEAN_DATE_PARSE) \
                                    $(DISTCLEAN_DEVEL_DPROF) \
                                    $(DISTCLEAN_DIGEST_MD5) \
                                    $(DISTCLEAN_MATH_INTERVALSEARCH) \
                                    $(DISTCLEAN_RRDTOOL) \
-                                   $(DISTCLEAN_STORABLE)
+                                   $(DISTCLEAN_STORABLE) \
+                                   $(DISTCLEAN_VERSION)
 
 all: Makefile $(MAKE_TARGETS)
 
@@ -163,6 +174,12 @@
 $(storable_dir)/Makefile: $(storable_dir)/Makefile.PL $(PERL)
 	cd $(storable_dir) && $(PERL) Makefile.PL
 
+make_version: $(version_dir)/Makefile
+	cd $(version_dir) && $(MAKE) OPTIMIZE="$(CFLAGS)"
+
+$(version_dir)/Makefile: $(version_dir)/Makefile.PL $(PERL)
+	cd $(version_dir) && $(PERL) Makefile.PL
+
 test:
 
 test_modules: $(TEST_TARGETS)
@@ -191,6 +208,9 @@
 test_storable: $(storable_dir)/Makefile
 	cd $(storable_dir) && $(MAKE) OPTIMIZE="$(CFLAGS)" test
 
+test_version: $(version_dir)/Makefile
+	cd $(version_dir) && $(MAKE) OPTIMIZE="$(CFLAGS)" test
+
 install: $(INSTALL_LIB_TARGETS)
 
 install_lib_rrdtool: make_rrdtool
@@ -222,6 +242,9 @@
 install_perl_storable: $(storable_dir)/Makefile
 	cd $(storable_dir) && $(MAKE) OPTIMIZE="$(CFLAGS)" UNINST="$(UNINST)" install
 
+install_perl_version: $(version_dir)/Makefile
+	cd $(version_dir) && $(MAKE) OPTIMIZE="$(CFLAGS)" UNINST="$(UNINST)" install
+
 clean: $(CLEAN_TARGETS)
 
 clean_compress_zlib: clean_rrdtool
@@ -269,6 +292,12 @@
 	  (cd $(storable_dir) && $(MAKE) clean); \
 	fi
 
+clean_version:
+	@if test -r $(version_dir)/Makefile; then \
+	  echo 'cd $(version_dir) && $(MAKE) clean'; \
+	  (cd $(version_dir) && $(MAKE) clean); \
+	fi
+
 distclean: $(DISTCLEAN_TARGETS)
 	$(RM) Makefile
 
@@ -289,5 +318,7 @@
 
 distclean_storable:            clean_storable
 
+distclean_version:             clean_version
+
 Makefile: Makefile.in
 	cd .. && CONFIG_FILES=packages/Makefile ./config.status

Added: trunk/orca/packages/version-0.39/Changes
==============================================================================
--- (empty file)
+++ trunk/orca/packages/version-0.39/Changes	Sat Jun  5 23:02:34 2004
@@ -0,0 +1,439 @@
+2004-04-13 21:15:32 John Peacock <jpeacock at cpan.org>
+	
+	M    util.c
+	     Change scan_vstring to treat alpha versions like numeric if
+	     appropriate (only one decimal)
+	
+	M    t/01base.t
+	     Alter testing and add new tests for alpha version code
+	
+	M    lib/version.pm
+	     Continue to improve (hopefully) POD including new alpha version
+	     behavior
+	
+	M    README
+	     Big red warnings about changing behavior
+	
+2004-04-12 20:53:52 John Peacock <jpeacock at cpan.org>
+	
+	New branch to fix alpha versions
+	
+2004-04-11 10:44:55 John Peacock <jpeacock at cpan.org>
+	
+	M    MANIFEST
+	     Forgot to delete the version::AlphaBeta files from packing list
+	
+2004-04-11 10:43:34 John Peacock <jpeacock at cpan.org>
+	
+	D    lib/version
+	D    t/02AlphaBeta.t
+	     Delete these files and release independently on CPAN
+	
+	M    util.c
+	     new() of version object makes copy
+	
+	M    t/01base.t
+	     test new() on existing version object
+	
+	M    lib/version.pm
+	M    README
+	     Document new() and elimination of version::AlphaBeta from this distro
+	
+	M    version.xs
+	     Only call vnumify() if a version object in UNIVERSAL::VERSION
+	
+2004-04-09 23:58:31 John Peacock <jpeacock at cpan.org>
+	
+	Brnach for new version
+	
+2004-04-03 14:30:01 John Peacock <jpeacock at cpan.org>
+	
+	*    lib/version.pm
+	     Change all uses of "new version" to "version->new()"
+	     Check all examples against current code/behavior
+	     Add doc warnings for edge cases
+	
+2004-03-27 22:45:18 John Peacock <jpeacock at cpan.org>
+	
+	*    util.c
+	     quoted versions, e.g qv() and v-string, always get at least 3 terms 
+	     change vstringify() to vnormal()
+	     new vstringify() to display either vnumify() or vnormal() form
+	
+	*    util.h
+	     Add #define for SVf (SV format) only needed for Perl 5.005_03
+	
+	*    version.xs
+	     new XS class function normal()
+	     UNIVERSAL::VERSION warning displays both numify() and normal() forms,
+	     also returns exclusively numify() form
+	
+	*    lib/version.pm
+	     Extensive POD rewrite to explain normal form and how stringify works
+	
+	*    t/01base.t
+	     Altered tests to correspond to new stringify behavior
+	
+	*    README
+	     Add warning about new stringify behavior
+	
+	*    ppport.h
+	     Copied from recent bleadperl build
+	
+2004-03-23 21:07:08 John Peacock <jpeacock at cpan.org>
+	
+	Create a new tag before changing anything
+	
+2004-02-01 20:30:01 John Peacock <jpeacock at cpan.org>
+	
+	*    README
+	     Include a short blurb on the qv() operator
+	
+	*    lib/version.pm
+	     Reformat the description of the qv() operator
+	     Change the $VERSION for a release
+	
+	*    version.xs
+	     Support using qv() with v-strings in Perl 5.8.1+
+	
+	*    t/01base.t
+	     Tests for qv() and v-strings
+	
+2004-02-01 20:29:11 John Peacock <jpeacock at cpan.org>
+	
+	Copy the files prior to updating to new version
+	
+2004-01-29 22:35:40 John Peacock <jpeacock at cpan.org>
+	
+	Tag for 0.35.0 release
+	
+2004-01-29 21:46:15 John Peacock <jpeacock at cpan.org>
+	
+	*    lib/version.pm
+	     Update the $VERSION prior to release
+	
+	*    MANIFEST
+	     Remove Changes as it is now autocreated
+	
+	*    Makefile.PL
+	     Autocreate Changes as part of 'dist' target
+	
+	*    util.c
+	     Correct handling of v-strings in new_version()
+	
+	*    version.xs, util.c
+	     Change use of SvPV_nolen() with SvPV() so that 5.005_03 works again
+	
+	*    t/01base.t
+	     Add tests for v-string creation (skipped on Perl < 5.8.0)
+	
+2004-01-29 20:35:12 John Peacock <jpeacock at cpan.org>
+	
+	*    Create a branch from which to eventually release 0.35
+	
+2004-01-29 20:31:22 John Peacock <jpeacock at cpan.org>
+	
+	*    Belately create tag for version 0.34
+	
+2003-12-29 10:35:34 John Peacock <jpeacock at cpan.org>
+	
+	*    typemap
+	     Stop automatically dereferencing input variable
+	*    lib/version.pm
+	     Update $VERSION for a change
+	*    README
+	     Include warning on memory leaks
+	*    util.c
+	     (new_version): use upg_version exclusively
+	     (upg_version): move code from new_version here
+	*    version.xs
+	     Stop dereferencing input variables
+	     Stop assuming that the PV has a value
+	
+2003-12-28 23:39:08 John Peacock <jpeacock at cpan.org>
+	
+	*    t/01base.t
+	     Replace postfix increment with prefix increment to prevent erroneous
+	     "Attempt to free..." errors
+	     Add test of CVS $Revision: $ style versions
+	
+	*    util.c
+	     Rewrite new_version to free temporary string variable
+	
+	*    version.xs
+	     Rewrite version->new() to eliminate temp string for CVS $Revision: $
+	     Rewrite version->qv() to use scan_version instead of new_version
+	
+2003-12-21 13:00:05 John Peacock <jpeacock at cpan.org>
+	
+	M    version.xs
+	     Go through code to ensure that there are no leaking scalars
+	     Sadly, there are still leaks from version::VERSION of unknown origins
+	
+2003-12-20 19:27:00 John Peacock <jpeacock at cpan.org>
+	
+	M    t/02AlphaBeta.t
+	M    lib/version/AlphaBeta.pm
+	     Implement an alternate object representation
+	     Overload stringify() with custom function
+	
+2003-10-25 21:17:52 John Peacock <jpeacock at cpan.org>
+	
+	M    t/02AlphaBeta.t
+	     Add empty derived class and modify tests to run
+	M    t/01base.t
+	     Work around bug with postfix increment under all Perl < bleadperl
+	
+2003-09-10 15:05:07 John Peacock <jpeacock at cpan.org>
+	
+	Fix for Ticket #3764 - need to strip final term before chop()
+	Implement qv() function and document/test
+	
+	
+2003-09-10 06:40:15 John Peacock <jpeacock at cpan.org>
+	
+	Remove the changes file from the repository.
+	Generate it before release:
+	
+		svn log file:///var/svn/modules/version/trunk
+	
+	and eventually by 'release.pl --changes'
+	
+	
+2003-09-10 06:36:49 John Peacock <jpeacock at cpan.org>
+	
+	Finish backporting bleadperl changes
+	Special case test for 5.005_03
+	Patch ppport.h to support IVSIZE for 5.005_03
+	
+	
+2003-09-10 05:13:09 John Peacock <jpeacock at cpan.org>
+	
+	No, really delete the lines from MANIFEST
+	Last bit of clean up in the POD
+	
+2003-09-10 04:59:31 John Peacock <jpeacock at cpan.org>
+	
+	Delete version::Empty module and include in t/01base.t instead
+	Correct MANIFEST (delete missing files and add ppport.h)
+	Make version::stringify() return at least three subversions
+	
+2003-09-09 15:20:40 John Peacock <jpeacock at cpan.org>
+	
+	Integrate changes from bleadperl
+	Combine emptyclass.t test into 01base.t
+	Use ppport.h instead of homebrewed #define's
+	
+	
+2003-09-07 09:13:53 John Peacock <jpeacock at cpan.org>
+	
+	Extend version::new() to handle derived classes
+	Abstract t/01base.t into external file
+	Create and test empty derived class
+	
+	FIX: "attempt to free unreferenced scalar" during testing
+	
+2003-07-09 10:11:57 John Peacock <jpeacock at cpan.org>
+	
+	Merge changes made accidently on branch back to head
+	
+2003-06-13 21:34:50 John Peacock <jpeacock at cpan.org>
+	
+	Forgot to commit this before releasing.
+	
+2003-06-13 15:02:11 John Peacock <jpeacock at cpan.org>
+	
+	Correct the example code (again) to correct for CVS update problems
+	
+2003-06-13 14:56:27 John Peacock <jpeacock at cpan.org>
+	
+	Reformatted POD's from <Matthew.Persico at Lazard.com>
+	
+2003-06-13 12:51:14 John Peacock <jpeacock at cpan.org>
+	
+	Change reference from "beta" to "alpha" to follow PAUSE convention
+	Add new function ->is_alpha() to test for alpha versions
+	Add docs for all logical operations on version objects
+	Fix example to have matching versions (old CVS issue)
+	
+2003-06-13 12:48:05 John Peacock <jpeacock at cpan.org>
+	
+	Implement version::AlphaBeta module
+	Copy repository history from CVS into subversion
+	
+2003-06-13 12:48:02 John Peacock <jpeacock at cpan.org>
+	
+	To prepare to load /home/jpeacock/tmp/version-0.28 into version/trunk,
+	perform 2 renames.
+	
+	* version/trunk/t/1.t: Renamed from version/trunk/t/version.t.
+	* version/trunk/lib/version.pm: Renamed from version/trunk/version.pm.
+	
+2003-01-05 17:45:41 John Peacock <jpeacock at cpan.org>
+	
+	Extract most recent log messages for main file
+	
+2003-01-05 17:43:51 John Peacock <jpeacock at cpan.org>
+	
+	Rewrite POD to call a v-string a v-string
+	Reformat POD to look nicer
+	
+2003-01-05 17:42:16 John Peacock <jpeacock at cpan.org>
+	
+	Make vnumify return an actual NV (instead of an SV which looks like one)
+	
+2003-01-05 17:40:50 John Peacock <jpeacock at cpan.org>
+	
+	Make warnings even more dire
+	
+2003-01-05 17:37:32 John Peacock <jpeacock at cpan.org>
+	
+	change comment message to more accurately reflect the test
+	
+2002-12-27 10:15:29 John Peacock <jpeacock at cpan.org>
+	
+	Rewrite to support new model of "Numeric Versions" and "String Versions"
+	
+2002-12-17 21:28:48 John Peacock <jpeacock at cpan.org>
+	
+	New version to cope with GSAR's vision of bare number versions
+	
+2002-12-05 06:51:34 John Peacock <jpeacock at cpan.org>
+	
+	Make -w clean tests
+	
+2002-12-05 05:41:24 John Peacock <jpeacock at cpan.org>
+	
+	Bring into sync with perl-current
+	
+2002-11-18 05:35:54 John Peacock <jpeacock at cpan.org>
+	
+	Bring current with repository version
+	
+2002-11-18 05:33:23 John Peacock <jpeacock at cpan.org>
+	
+	Fix compile errors under threaded Perl's
+	Supress {Unquoted string version} warnings
+	
+2002-11-18 05:33:23 John Peacock <jpeacock at cpan.org>
+	
+	
+	Fix compile errors under threaded Perls
+	
+2002-11-18 05:24:17 John Peacock <jpeacock at cpan.org>
+	
+	Fix compile errors under threaded Perl's
+	Supress {Unquoted string "version"} warnings
+	
+2002-10-14 21:27:00 John Peacock <jpeacock at cpan.org>
+	
+	Fix typos
+	Fix handling of null versions
+	
+2002-10-10 20:41:54 John Peacock <jpeacock at cpan.org>
+	
+	use Perl_croak from C code
+	
+2002-10-08 20:51:20 John Peacock <jpeacock at cpan.org>
+	
+	Recover gracefully to null versions (rather than core)
+	
+2002-10-08 20:44:24 John Peacock <jpeacock at cpan.org>
+	
+	Recover gracefully to null versions (rather than core)
+	
+2002-10-04 22:57:00 John Peacock <jpeacock at cpan.org>
+	
+	Document extended decimal version parsing
+	
+2002-10-04 21:01:45 John Peacock <jpeacock at cpan.org>
+	
+	Force all files to next major revision (so the version works)
+	
+2002-10-04 20:53:33 John Peacock <jpeacock at cpan.org>
+	
+	Add tests for 1.002003 => 1.2.3
+	
+2002-10-04 20:53:10 John Peacock <jpeacock at cpan.org>
+	
+	Add support for 1.002003 => 1.2.3
+	
+2002-10-04 20:31:01 John Peacock <jpeacock at cpan.org>
+	
+	Remove dependency on Exporter.pm
+	
+2002-09-29 19:46:23 John Peacock <jpeacock at cpan.org>
+	
+	Update with version from perl-current
+	
+2002-09-29 19:44:47 John Peacock <jpeacock at cpan.org>
+	
+	Change vstringify and vnumify
+	Reword main POD slightly
+	
+2002-09-28 14:38:15 John Peacock <jpeacock at cpan.org>
+	
+	Final changes to release to CPAN
+	Merged code into perl-current
+	
+2002-09-28 06:21:16 John Peacock <jpeacock at cpan.org>
+	
+	Ready to release to CPAN
+	
+2002-09-28 06:15:34 John Peacock <jpeacock at cpan.org>
+	
+	POD changes
+	
+2002-09-28 06:15:16 John Peacock <jpeacock at cpan.org>
+	
+	Cannot use SvPV_nolen in 5.005_03
+	
+2002-09-22 21:40:02 John Peacock <jpeacock at cpan.org>
+	
+	Document the UNIVERSAL::VERSION replacement
+	
+2002-09-22 21:23:01 John Peacock <jpeacock at cpan.org>
+	
+	Successfully create and test my own UNIVERSAL::VERSION replacement
+	
+2002-09-16 15:35:58 John Peacock <jpeacock at cpan.org>
+	
+	Improve the testing of beta versions
+	
+2002-09-16 08:12:49 John Peacock <jpeacock at cpan.org>
+	
+	More POD changes
+	
+2002-09-16 07:52:08 John Peacock <jpeacock at cpan.org>
+	
+	Add additional testing
+	Add POD
+	
+2002-09-16 06:17:41 John Peacock <jpeacock at cpan.org>
+	
+	Finally works in 5.005_03, 5.6.1, and 5.8.0
+	
+2002-09-15 06:13:51 John Peacock <jpeacock at cpan.org>
+	
+	Doesn't work any more?
+	
+2002-09-14 16:08:23 John Peacock <jpeacock at cpan.org>
+	
+	working AV objects in 5.6.x only
+	
+2002-09-14 16:08:23 John Peacock <jpeacock at cpan.org>
+	
+	*** empty log message ***
+	
+2002-09-13 23:12:25 John Peacock <jpeacock at cpan.org>
+	
+	Finished for the night
+	
+2002-09-13 22:28:39 John Peacock <jpeacock at cpan.org>
+	
+	almost working AV style version objects
+	
+2002-09-13 21:59:09 John Peacock <jpeacock at cpan.org>
+	
+	Initial revision
+	

Added: trunk/orca/packages/version-0.39/MANIFEST
==============================================================================
--- (empty file)
+++ trunk/orca/packages/version-0.39/MANIFEST	Sat Jun  5 23:02:34 2004
@@ -0,0 +1,11 @@
+Makefile.PL
+MANIFEST
+README
+t/01base.t
+lib/version.pm
+version.xs
+util.c
+util.h
+ppport.h
+typemap
+META.yml                                Module meta-data (added by MakeMaker)

Added: trunk/orca/packages/version-0.39/META.yml
==============================================================================
--- (empty file)
+++ trunk/orca/packages/version-0.39/META.yml	Sat Jun  5 23:02:34 2004
@@ -0,0 +1,11 @@
+# http://module-build.sourceforge.net/META-spec.html
+#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
+name:         version
+version:      0.39
+version_from: lib/version.pm
+installdirs:  site
+requires:
+    Test::More:                    0.45
+
+distribution_type: module
+generated_by: ExtUtils::MakeMaker version 6.21

Added: trunk/orca/packages/version-0.39/Makefile.PL
==============================================================================
--- (empty file)
+++ trunk/orca/packages/version-0.39/Makefile.PL	Sat Jun  5 23:02:34 2004
@@ -0,0 +1,17 @@
+use ExtUtils::MakeMaker;
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+WriteMakefile(
+    'NAME'		=> 'version',
+    'VERSION_FROM'	=> 'lib/version.pm', # finds $VERSION
+    'PREREQ_PM'		=> {Test::More => 0.45}, # e.g., Module::Name => 1.1
+    'LIBS'		=> [''], # e.g., '-lm'
+    'DEFINE'		=> '', # e.g., '-DHAVE_SOMETHING'
+	# Insert -I. if you add *.h files later:
+    'INC'		=> '', # e.g., '-I/usr/include/other'
+	# 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 | gnuify-changelog.pl > ${DISTVNAME}/Changes',
+			    },
+);

Added: trunk/orca/packages/version-0.39/README
==============================================================================
--- (empty file)
+++ trunk/orca/packages/version-0.39/README	Sat Jun  5 23:02:34 2004
@@ -0,0 +1,50 @@
+version 0.39
+====================
+
+Provides the same version objects as included in Perl v5.9.0 (and hopefully in
+the 5.10.0 release).  In fact, if you attempt to use this module with a version
+of Perl >= v5.9.0, this module will not do anything, since the code already
+exists in the Perl core.
+
+This release changes the behavior of alpha versions with only 1 decimal
+place, to make them behave more like their floating-point counterparts.
+This may lead to some confusion over the stringified representation of
+alpha versions.  See the POD for more details.
+
+IMPORTANT NOTE: version-0.37 introduced a segfault when trying to use the
+UNIVERSAL::VERSION routine on modules without a $VERSION scalar.  This was
+fixed in version-0.38.
+
+IMPORTANT NOTE2: This version changes the default stringification for some
+version objects.  Be sure and read the updated POD for details.  This also
+affect the return value of the replacement UNIVERSAL::VERSION method.
+
+IMPORTANT NOTE3: The replacement UNIVERSAL::VERSION method supplied by this
+module currently leaks memory, so don't call it in a loop in your code
+until this has been corrected (this is a very uncommon mode of operation,
+so it is not as serious a problem as it could be otherwise).
+
+NOT SO IMPORTANT NOTE: The version::AlphaBeta module has been removed from
+this distribution and released independently on CPAN.
+
+Please read the POD documentation for usage/details.
+
+INSTALLATION
+
+To install this module type the following:
+
+   perl Makefile.PL
+   make
+   make test
+   make install
+
+DEPENDENCIES
+
+the same C compiler used to build Perl
+
+COPYRIGHT AND LICENCE
+
+This module can be distributed under the same terms as Perl.
+
+Copyright (C) 2004 John Peacock
+

Added: trunk/orca/packages/version-0.39/lib/version.pm
==============================================================================
--- (empty file)
+++ trunk/orca/packages/version-0.39/lib/version.pm	Sat Jun  5 23:02:34 2004
@@ -0,0 +1,531 @@
+#!perl -w
+package version;
+
+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.39; # stop using CVS and switch to subversion
+
+$CLASS = 'version';
+
+local $^W; # shut up the 'redefined' warning for UNIVERSAL::VERSION
+bootstrap version if $] < 5.009;
+
+# Preloaded methods go here.
+
+1;
+__END__
+
+=head1 NAME
+
+version - Perl extension for Version Objects
+
+=head1 SYNOPSIS
+
+  use version;
+  $version = version->new("12.2.1"); # must be quoted for Perl < 5.8.1
+  print $version; 		# 12.2.1
+  print $version->numify; 	# 12.002001
+  if ( $version gt  "12.2" )	# true
+
+  $alphaver = version->new("1.2_3"); # must be quoted!
+  print $alphaver;		# 1.2_3
+  print $alphaver->is_alpha();  # true
+  
+  $ver = qv(1.2);               # 1.2.0
+  $ver = qv("1.2");             # 1.2.0
+
+  $perlver = version->new(5.005_03); # must not be quoted!
+  print $perlver;		# 5.5.30
+
+=head1 DESCRIPTION
+
+Overloaded version objects for all versions of Perl.  This module
+implements all of the features of version objects which will be part
+of Perl 5.10.0 except automatic version object creation.
+
+=head2 What IS a version
+
+For the purposes of this module, a version "number" is a sequence of
+positive integral values separated by decimal points and optionally a
+single underscore.  This corresponds to what Perl itself uses for a
+version, as well as extending the "version as number" that is discussed
+in the various editions of the Camel book.
+
+There are actually two distinct ways to initialize versions:
+
+=over 4
+
+=item * Numeric Versions
+
+Any initial parameter which "looks like a number", see L<Numeric
+Versions>.
+
+=item * Quoted Versions
+
+Any initial parameter which contains more than one decimal point
+or contains an embedded underscore, see L<Quoted Versions>.  The
+most recent development version of Perl (5.9.x) and the next major
+release (5.10.0) will automatically create version objects for bare
+numbers containing more than one decimal point in the appropriate
+context.
+
+=back
+
+Both of these methods will produce similar version objects, in that
+the default stringification will yield the version L<Normal Form> only 
+if required:
+
+  $v  = version->new(1.002);     # 1.002, but compares like 1.2.0
+  $v  = version->new(1.002003);  # 1.2.3
+  $v2 = version->new( "1.2.3");  # 1.2.3
+  $v3 = version->new(  1.2.3);   # 1.2.3 for Perl >= 5.8.1
+
+Please see L<"Quoting"> for more details on how Perl will parse various
+input values.
+
+Any value passed to the new() operator will be parsed only so far as it
+contains a numeric, decimal, or underscore character.  So, for example:
+
+  $v1 = version->new("99 and 94/100 percent pure"); # $v1 == 99.0
+  $v2 = version->new("something"); # $v2 == "" and $v2->numify == 0
+
+However, see L<New Operator> for one case where non-numeric text is
+acceptable when initializing version objects.
+
+=head2 What about v-strings?
+
+Beginning with Perl 5.6.0, an alternate method to code arbitrary strings
+of bytes was introduced, called v-strings.  They were intended to be an
+easy way to enter, for example, Unicode strings (which contain two bytes
+per character).  Some programs have used them to encode printer control
+characters (e.g. CRLF).  They were also intended to be used for $VERSION.
+Their use has been problematic from the start and they will be phased out
+beginning in Perl 5.10.0.
+
+There are two ways to enter v-strings: a bare number with two or more
+decimal places, or a bare number with one or more decimal places and a 
+leading 'v' character (also bare).  For example:
+
+  $vs1 = 1.2.3; # encoded as \1\2\3
+  $vs2 = v1.2;  # encoded as \1\2 
+
+The first of those two syntaxes is destined to be the default way to create
+a version object in 5.10.0, whereas the second will issue a mandatory
+deprecation warning beginning at the same time.  In both cases, a v-string
+encoded version will always be stringified in the version L<Normal Form>.
+
+Consequently, the use of v-strings to initialize version objects with
+this module is only possible with Perl 5.8.1 or better (which contain special
+code to enable it).  Their use is B<strongly> discouraged in all 
+circumstances (especially the leading 'v' style), since the meaning will
+change depending on which Perl you are running.  It is better to use
+L<"Quoted Versions"> to ensure the proper interpretation.
+
+=head2 Numeric Versions
+
+These correspond to historical versions of Perl itself prior to 5.6.0,
+as well as all other modules which follow the Camel rules for the
+$VERSION scalar.  A numeric version is initialized with what looks like
+a floating point number.  Leading zeros B<are> significant and trailing
+zeros are implied so that a minimum of three places is maintained
+between subversions.  What this means is that any subversion (digits
+to the right of the decimal place) that contains less than three digits
+will have trailing zeros added to make up the difference, but only for
+purposes of comparison with other version objects.  For example:
+
+  $v = version->new(      1.2);    # prints 1.2, compares as 1.200.0
+  $v = version->new(     1.02);    # prints 1.02, compares as 1.20.0
+  $v = version->new(    1.002);    # prints 1.002, compares as 1.2.0
+  $v = version->new(   1.0023);    # 1.2.300
+  $v = version->new(  1.00203);    # 1.2.30
+  $v = version->new( 1.002_03);    # 1.2.30   See "Quoting"
+  $v = version->new( 1.002003);    # 1.2.3
+
+All of the preceeding examples except the second to last are true
+whether or not the input value is quoted.  The important feature is that
+the input value contains only a single decimal.
+
+IMPORTANT NOTE: If your numeric version contains more than 3 significant
+digits after the decimal place, it will be split on each multiple of 3, so
+1.0003 becomes 1.0.300, due to the need to remain compatible with Perl's
+own 5.005_03 == 5.5.30 interpretation.
+
+=head2 Quoted Versions
+
+These are the newest form of versions, and correspond to Perl's own
+version style beginning with 5.6.0.  Starting with Perl 5.10.0,
+and most likely Perl 6, this is likely to be the preferred form.  This
+method requires that the input parameter be quoted, although Perl's after 
+5.9.0 can use bare numbers with multiple decimal places as a special form
+of quoting.
+
+Unlike L<Numeric Versions>, Quoted Versions may have more than
+a single decimal point, e.g. "5.6.1" (for all versions of Perl).  If a
+Quoted Version has only one decimal place (and no embedded underscore),
+it is interpreted exactly like a L<Numeric Version>.  
+
+So, for example:
+
+  $v = version->new( "1.002");    # 1.2
+  $v = version->new( "1.2.3");    # 1.2.3
+  $v = version->new("1.0003");    # 1.0.300
+
+In addition to conventional versions, Quoted Versions can be
+used to create L<Alpha Versions>.
+
+In general, Quoted Versions permit the greatest amount of freedom
+to specify a version, whereas Numeric Versions enforce a certain
+uniformity.  See also L<New Operator> for an additional method of
+initializing version objects.
+
+=head2 Object Methods
+
+Overloading has been used with version objects to provide a natural
+interface for their use.  All mathematical operations are forbidden,
+since they don't make any sense for base version objects.
+
+=over 4
+
+=item * New Operator
+
+Like all OO interfaces, the new() operator is used to initialize
+version objects.  One way to increment versions when programming is to
+use the CVS variable $Revision, which is automatically incremented by
+CVS every time the file is committed to the repository.
+
+In order to facilitate this feature, the following
+code can be employed:
+
+  $VERSION = version->new(qw$Revision: 2.7 $);
+
+and the version object will be created as if the following code
+were used:
+
+  $VERSION = version->new("v2.7");
+
+In other words, the version will be automatically parsed out of the
+string, and it will be quoted to preserve the meaning CVS normally
+carries for versions.  The CVS $Revision$ increments differently from
+numeric versions (i.e. 1.10 follows 1.9), so it must be handled as if
+it were a L<Quoted Version>.
+
+New in 0.38, a new version object can be created as a copy of an existing
+version object:
+
+  $v1 = version->new(12.3);
+  $v2 = version->new($v1);
+
+and $v1 and $v2 will be identical.
+
+=back
+
+=over 4
+
+=item * qv()
+
+An alternate way to create a new version object is through the exported
+qv() sub.  This is not strictly like other q? operators (like qq, qw),
+in that the only delimiters supported are parentheses (or spaces).  It is
+the best way to initialize a short version without triggering the floating
+point interpretation.  For example:
+
+  $v1 = qv(1.2);         # 1.2.0
+  $v2 = qv("1.2");       # also 1.2.0
+
+As you can see, either a bare number or a quoted string can be used, and
+either will yield the same version number.
+
+=back
+
+For the subsequent examples, the following three objects will be used:
+
+  $ver   = version->new("1.2.3.4"); # see "Quoting" below
+  $alpha = version->new("1.2.3_4"); # see "Alpha versions" below
+  $nver  = version->new(1.2);       # see "Numeric Versions" above
+
+=over 4
+
+=item * Normal Form
+
+For any version object which is initialized with multiple decimal
+places (either quoted or if possible v-string), or initialized using
+the L<qv()> operator, the stringified representation is returned in
+a normalized or reduced form (no extraneous zeros):
+
+  print $ver->normal;         # prints as 1.2.3
+  print $ver->stringify;      # ditto
+  print $ver;                 # ditto
+  print $nver->normal;        # prints as 1.2.0
+  print $nver->stringify;     # prints as 1.2, see "Stringification" 
+
+In order to preserve the meaning of the processed version, the 
+normalized representation will always contain at least three sub terms.
+In other words, the following is guaranteed to always be true:
+
+  my $newver = version->new($ver->stringify);
+  if ($newver eq $ver ) # always true
+    {...}
+
+=back
+
+=over 4
+
+=item * Numification
+
+Although all mathematical operations on version objects are forbidden
+by default, it is possible to retrieve a number which roughly
+corresponds to the version object through the use of the $obj->numify
+method.  For formatting purposes, when displaying a number which
+corresponds a version object, all sub versions are assumed to have
+three decimal places.  So for example:
+
+  print $ver->numify;         # prints 1.002003
+  print $nver->numify;        # prints 1.2
+
+Unlike the stringification operator, there is never any need to append
+trailing zeros to preserve the correct version value.
+
+=back
+
+=over 4
+
+=item * Stringification
+
+In order to mirror as much as possible the existing behavior of ordinary
+$VERSION scalars, the stringification operation will display differently,
+depending on whether the version was initialized as a L<Numeric Version>
+or L<Quoted Version>.
+
+What this means in practice is that if the normal CPAN and Camel rules are
+followed ($VERSION is a floating point number with no more than 3 decimal
+places), the stringified output will be exactly the same as the numified
+output.  There will be no visible difference, although the internal 
+representation will be different, and the L<Comparison operators> will 
+function using the internal coding.
+
+If a version object is initialized using a L<Quoted Version> form, or if
+the number of significant decimal places exceed three, then the stringified
+form will be the L<Normal Form>.  The $obj->normal operation can always be
+used to produce the L<Normal Form>, even if the version was originally a
+L<Numeric Version>.
+
+  print $ver->stringify;    # prints 1.2.3
+  print $nver->stringify;   # prints 1.2
+
+=back
+
+=over 4
+
+=item * Comparison operators
+
+Both cmp and <=> operators perform the same comparison between terms
+(upgrading to a version object automatically).  Perl automatically
+generates all of the other comparison operators based on those two.
+In addition to the obvious equalities listed below, appending a single
+trailing 0 term does not change the value of a version for comparison
+purposes.  In other words "v1.2" and "1.2.0" will compare as identical.
+
+For example, the following relations hold:
+
+  As Number       As String          Truth Value
+  ---------       ------------       -----------
+  $ver >  1.0     $ver gt "1.0"      true
+  $ver <  2.5     $ver lt            true
+  $ver != 1.3     $ver ne "1.3"      true
+  $ver == 1.2     $ver eq "1.2"      false
+  $ver == 1.2.3   $ver eq "1.2.3"    see discussion below
+
+It is probably best to chose either the numeric notation or the string
+notation and stick with it, to reduce confusion.  Perl6 version objects
+B<may> only support numeric comparisons.  See also L<"Quoting">.
+
+WARNING: Comparing version with unequal numbers of decimal places (whether
+explicitely or implicitely initialized), may yield unexpected results at
+first glance.  For example, the following inequalities hold:
+
+  version->new(0.96)     > version->new(0.95); # 0.960.0 > 0.950.0
+  version->new("0.96.1") < version->new(0.95); # 0.096.1 < 0.950.0
+
+For this reason, it is best to use either exclusively L<Numeric Versions> or
+L<Quoted Versions> with multiple decimal places.
+
+=back
+
+=over 4
+
+=item * Logical Operators 
+
+If you need to test whether a version object
+has been initialized, you can simply test it directly:
+
+  $vobj = version->new($something);
+  if ( $vobj )   # true only if $something was non-blank
+
+You can also test whether a version object is an L<Alpha version>, for
+example to prevent the use of some feature not present in the main
+release:
+
+  $vobj = version->new("1.2_3"); # MUST QUOTE
+  ...later...
+  if ( $vobj->is_alpha )       # True
+
+=back
+
+=head2 Quoting
+
+Because of the nature of the Perl parsing and tokenizing routines,
+certain initialization values B<must> be quoted in order to correctly
+parse as the intended version, and additionally, some initial values
+B<must not> be quoted to obtain the intended version.
+
+Except for L<Alpha versions>, any version initialized with something
+that looks like a number (a single decimal place) will be parsed in
+the same way whether or not the term is quoted.  In order to be
+compatible with earlier Perl version styles, any use of versions of
+the form 5.006001 will be translated as 5.6.1.  In other words, a
+version with a single decimal place will be parsed as implicitly
+having three places between subversions.
+
+The complicating factor is that in bare numbers (i.e. unquoted), the
+underscore is a legal numeric character and is automatically stripped
+by the Perl tokenizer before the version code is called.  However, if
+a number containing one or more decimals and an underscore is quoted, i.e.
+not bare, that is considered a L<Alpha Version> and the underscore is
+significant.
+
+If you use a mathematic formula that resolves to a floating point number,
+you are dependent on Perl's conversion routines to yield the version you
+expect.  You are pretty safe by dividing by a power of 10, for example,
+but other operations are not likely to be what you intend.  For example:
+
+  $VERSION = version->new((qw$Revision: 1.4)[1]/10);
+  print $VERSION;          # yields 0.14
+  $V2 = version->new(100/9); # Integer overflow in decimal number
+  print $V2;               # yields something like 11.111.111.100
+
+Perl 5.8.1 and beyond will be able to automatically quote v-strings
+(although a warning may be issued under 5.9.x and 5.10.0), but that
+is not possible in earlier versions of Perl.  In other words:
+
+  $version = version->new("v2.5.4");  # legal in all versions of Perl
+  $newvers = version->new(v2.5.4);    # legal only in Perl >= 5.8.1
+
+
+=head2 Types of Versions Objects
+
+There are two types of Version Objects:
+
+=over 4
+
+=item * Ordinary versions
+
+These are the versions that normal modules will use.  Can contain as
+many subversions as required.  In particular, those using RCS/CVS can
+use the following:
+
+  $VERSION = version->new(qw$Revision: 2.7 $);
+
+and the current RCS Revision for that file will be inserted
+automatically.  If the file has been moved to a branch, the Revision
+will have three or more elements; otherwise, it will have only two.
+This allows you to automatically increment your module version by
+using the Revision number from the primary file in a distribution, see
+L<ExtUtils::MakeMaker/"VERSION_FROM">.
+
+=item * Alpha versions
+
+For module authors using CPAN, the convention has been to note
+unstable releases with an underscore in the version string, see
+L<CPAN>.  Alpha releases will test as being newer than the more recent
+stable release, and less than the next stable release.  For example:
+
+  $alphaver = version->new("12.3_1"); # must quote
+
+obeys the relationship
+
+  12.3 < $alphaver < 12.4
+
+As a matter of fact, if is also true that
+
+  12.3.0 < $alphaver < 12.3.1
+
+where the subversion is identical but the alpha release is less than
+the non-alpha release.
+
+Alpha versions with a single decimal place will be treated exactly as if
+they were L<Numeric Versions>, for parsing purposes.  The stringification for
+alpha versions with a single decimal place may seem suprising, since any
+trailing zeros will visible.  For example, the above $alphaver will print as
+
+  12.300_100
+
+Alpha versions with more than a single decimal place will be treated 
+exactly as if they were L<Quoted Versions>, and will display without any
+trailing (or leading) zeros, in the L<Version Normal> form.  For example,
+
+  $newver = version->new("12.3.1_1");
+  print $newver; # 12.3.1_1
+
+=head2 Replacement UNIVERSAL::VERSION
+
+In addition to the version objects, this modules also replaces the core
+UNIVERSAL::VERSION function with one that uses version objects for its
+comparisons.  The return from this operator is always the numified form,
+and the warning message generated includes both the numified and normal
+forms (for clarity).
+
+For example:
+
+  package Foo;
+  $VERSION = 1.2;
+
+  package Bar;
+  $VERSION = "1.3.5"; # works with all Perl's (since it is quoted)
+
+  package main;
+  use version;
+
+  print $Foo::VERSION; # prints 1.2
+
+  print $Bar::VERSION; # prints 1.003005
+
+  eval "use CGI 10"; # some far future release
+  print $@; # prints "CGI version 10 (10.0.0) required..."
+
+IMPORTANT NOTE: This may mean that code which searches for a specific
+string (to determine whether a given module is available) may need to be
+changed.
+
+The replacement UNIVERSAL::VERSION, when used as a function, like this:
+
+  print $module->VERSION;
+
+will follow the stringification rules; i.e. Numeric versions will be displayed
+with the numified format, and the rest will be displayed with the Normal
+format.  Technically, the $module->VERSION function returns a string (PV) that
+can be converted to a number following the normal Perl rules, when used in a
+numeric context.
+
+
+=head1 EXPORT
+
+qv - quoted version initialization operator
+
+=head1 AUTHOR
+
+John Peacock E<lt>jpeacock at rowman.comE<gt>
+
+=head1 SEE ALSO
+
+L<perl>.
+
+=cut

Added: trunk/orca/packages/version-0.39/ppport.h
==============================================================================
--- (empty file)
+++ trunk/orca/packages/version-0.39/ppport.h	Sat Jun  5 23:02:34 2004
@@ -0,0 +1,1098 @@
+
+/* ppport.h -- Perl/Pollution/Portability Version 2.011_02 
+ *
+ * Automatically Created by Devel::PPPort on Tue Mar 23 21:50:21 2004 
+ *
+ * Do NOT edit this file directly! -- Edit PPPort.pm instead.
+ *
+ * Version 2.x, Copyright (C) 2001, Paul Marquess.
+ * Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
+ * This code may be used and distributed under the same license as any
+ * version of Perl.
+ * 
+ * This version of ppport.h is designed to support operation with Perl
+ * installations back to 5.004, and has been tested up to 5.8.1.
+ *
+ * If this version of ppport.h is failing during the compilation of this
+ * module, please check if a newer version of Devel::PPPort is available
+ * on CPAN before sending a bug report.
+ *
+ * If you are using the latest version of Devel::PPPort and it is failing
+ * during compilation of this module, please send a report to perlbug at perl.com
+ *
+ * Include all following information:
+ *
+ *  1. The complete output from running "perl -V"
+ *
+ *  2. This file.
+ *
+ *  3. The name & version of the module you were trying to build.
+ *
+ *  4. A full log of the build that failed.
+ *
+ *  5. Any other information that you think could be relevant.
+ *
+ *
+ * For the latest version of this code, please retreive the Devel::PPPort
+ * module from CPAN.
+ * 
+ */
+
+/*
+ * In order for a Perl extension module to be as portable as possible
+ * across differing versions of Perl itself, certain steps need to be taken.
+ * Including this header is the first major one, then using dTHR is all the
+ * appropriate places and using a PL_ prefix to refer to global Perl
+ * variables is the second.
+ *
+ */
+
+
+/* If you use one of a few functions that were not present in earlier
+ * versions of Perl, please add a define before the inclusion of ppport.h
+ * for a static include, or use the GLOBAL request in a single module to
+ * produce a global definition that can be referenced from the other
+ * modules.
+ * 
+ * Function:            Static define:           Extern define:
+ * newCONSTSUB()        NEED_newCONSTSUB         NEED_newCONSTSUB_GLOBAL
+ *
+ */
+ 
+
+/* To verify whether ppport.h is needed for your module, and whether any
+ * special defines should be used, ppport.h can be run through Perl to check
+ * your source code. Simply say:
+ * 
+ * 	perl -x ppport.h *.c *.h *.xs foo/bar*.c [etc]
+ * 
+ * The result will be a list of patches suggesting changes that should at
+ * least be acceptable, if not necessarily the most efficient solution, or a
+ * fix for all possible problems. It won't catch where dTHR is needed, and
+ * doesn't attempt to account for global macro or function definitions,
+ * nested includes, typemaps, etc.
+ * 
+ * In order to test for the need of dTHR, please try your module under a
+ * recent version of Perl that has threading compiled-in.
+ *
+ */ 
+
+
+/*
+#!/usr/bin/perl
+ at ARGV = ("*.xs") if !@ARGV;
+%badmacros = %funcs = %macros = (); $replace = 0;
+foreach (<DATA>) {
+	$funcs{$1} = 1 if /Provide:\s+(\S+)/;
+	$macros{$1} = 1 if /^#\s*define\s+([a-zA-Z0-9_]+)/;
+	$replace = $1 if /Replace:\s+(\d+)/;
+	$badmacros{$2}=$1 if $replace and /^#\s*define\s+([a-zA-Z0-9_]+).*?\s+([a-zA-Z0-9_]+)/;
+	$badmacros{$1}=$2 if /Replace (\S+) with (\S+)/;
+}
+foreach $filename (map(glob($_), at ARGV)) {
+	unless (open(IN, "<$filename")) {
+		warn "Unable to read from $file: $!\n";
+		next;
+	}
+	print "Scanning $filename...\n";
+	$c = ""; while (<IN>) { $c .= $_; } close(IN);
+	$need_include = 0; %add_func = (); $changes = 0;
+	$has_include = ($c =~ /#.*include.*ppport/m);
+
+	foreach $func (keys %funcs) {
+		if ($c =~ /#.*define.*\bNEED_$func(_GLOBAL)?\b/m) {
+			if ($c !~ /\b$func\b/m) {
+				print "If $func isn't needed, you don't need to request it.\n" if
+				$changes += ($c =~ s/^.*#.*define.*\bNEED_$func\b.*\n//m);
+			} else {
+				print "Uses $func\n";
+				$need_include = 1;
+			}
+		} else {
+			if ($c =~ /\b$func\b/m) {
+				$add_func{$func} =1 ;
+				print "Uses $func\n";
+				$need_include = 1;
+			}
+		}
+	}
+
+	if (not $need_include) {
+		foreach $macro (keys %macros) {
+			if ($c =~ /\b$macro\b/m) {
+				print "Uses $macro\n";
+				$need_include = 1;
+			}
+		}
+	}
+
+	foreach $badmacro (keys %badmacros) {
+		if ($c =~ /\b$badmacro\b/m) {
+			$changes += ($c =~ s/\b$badmacro\b/$badmacros{$badmacro}/gm);
+			print "Uses $badmacros{$badmacro} (instead of $badmacro)\n";
+			$need_include = 1;
+		}
+	}
+	
+	if (scalar(keys %add_func) or $need_include != $has_include) {
+		if (!$has_include) {
+			$inc = join('',map("#define NEED_$_\n", sort keys %add_func)).
+			       "#include \"ppport.h\"\n";
+			$c = "$inc$c" unless $c =~ s/#.*include.*XSUB.*\n/$&$inc/m;
+		} elsif (keys %add_func) {
+			$inc = join('',map("#define NEED_$_\n", sort keys %add_func));
+			$c = "$inc$c" unless $c =~ s/^.*#.*include.*ppport.*$/$inc$&/m;
+		}
+		if (!$need_include) {
+			print "Doesn't seem to need ppport.h.\n";
+			$c =~ s/^.*#.*include.*ppport.*\n//m;
+		}
+		$changes++;
+	}
+	
+	if ($changes) {
+		open(OUT,"ppport.h.$$");
+		print OUT $c;
+		close(OUT);
+		open(DIFF, "diff -u $filename ppport.h.$$|");
+		while (<DIFF>) { s!ppport\.h\.$$!$filename.patched!; print STDOUT; }
+		close(DIFF);
+		unlink("ppport.h.$$");
+	} else {
+		print "Looks OK\n";
+	}
+}
+__DATA__
+*/
+
+#ifndef _P_P_PORTABILITY_H_
+#define _P_P_PORTABILITY_H_
+
+#ifndef PERL_REVISION
+#   ifndef __PATCHLEVEL_H_INCLUDED__
+#       define PERL_PATCHLEVEL_H_IMPLICIT
+#       include <patchlevel.h>
+#   endif
+#   if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
+#       include <could_not_find_Perl_patchlevel.h>
+#   endif
+#   ifndef PERL_REVISION
+#	define PERL_REVISION	(5)
+        /* Replace: 1 */
+#       define PERL_VERSION	PATCHLEVEL
+#       define PERL_SUBVERSION	SUBVERSION
+        /* Replace PERL_PATCHLEVEL with PERL_VERSION */
+        /* Replace: 0 */
+#   endif
+#endif
+
+#define PERL_BCDVERSION ((PERL_REVISION * 0x1000000L) + (PERL_VERSION * 0x1000L) + PERL_SUBVERSION)
+
+/* It is very unlikely that anyone will try to use this with Perl 6 
+   (or greater), but who knows.
+ */
+#if PERL_REVISION != 5
+#	error ppport.h only works with Perl version 5
+#endif /* PERL_REVISION != 5 */
+
+#ifndef ERRSV
+#	define ERRSV perl_get_sv("@",FALSE)
+#endif
+
+#if (PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5))
+/* Replace: 1 */
+#	define PL_Sv		Sv
+#	define PL_compiling	compiling
+#	define PL_copline	copline
+#	define PL_curcop	curcop
+#	define PL_curstash	curstash
+#	define PL_defgv		defgv
+#	define PL_dirty		dirty
+#	define PL_dowarn	dowarn
+#	define PL_hints		hints
+#	define PL_na		na
+#	define PL_perldb	perldb
+#	define PL_rsfp_filters	rsfp_filters
+#	define PL_rsfpv		rsfp
+#	define PL_stdingv	stdingv
+#	define PL_sv_no		sv_no
+#	define PL_sv_undef	sv_undef
+#	define PL_sv_yes	sv_yes
+/* Replace: 0 */
+#endif
+
+#ifdef HASATTRIBUTE
+#  if (defined(__GNUC__) && defined(__cplusplus)) || defined(__INTEL_COMPILER)
+#    define PERL_UNUSED_DECL
+#  else
+#    define PERL_UNUSED_DECL __attribute__((unused))
+#  endif
+#else
+#  define PERL_UNUSED_DECL
+#endif
+
+#ifndef dNOOP
+#  define NOOP (void)0
+#  define dNOOP extern int Perl___notused PERL_UNUSED_DECL
+#endif
+
+#ifndef dTHR
+#  define dTHR          dNOOP
+#endif
+
+#ifndef dTHX
+#  define dTHX          dNOOP
+#  define dTHXa(x)      dNOOP
+#  define dTHXoa(x)     dNOOP
+#endif
+
+#ifndef pTHX
+#    define pTHX	void
+#    define pTHX_
+#    define aTHX
+#    define aTHX_
+#endif         
+
+#ifndef dAX
+#   define dAX I32 ax = MARK - PL_stack_base + 1
+#endif
+#ifndef dITEMS
+#   define dITEMS I32 items = SP - MARK
+#endif
+
+/* IV could also be a quad (say, a long long), but Perls
+ * capable of those should have IVSIZE already. */
+#if !defined(IVSIZE) && defined(LONGSIZE)
+#   define IVSIZE LONGSIZE
+#endif
+#ifndef IVSIZE
+#   define IVSIZE 4 /* A bold guess, but the best we can make. */
+#endif
+
+#ifndef UVSIZE
+#   define UVSIZE IVSIZE
+#endif
+
+#ifndef NVTYPE
+#   if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
+#       define NVTYPE long double
+#   else
+#       define NVTYPE double
+#   endif
+typedef NVTYPE NV;
+#endif
+
+#ifndef INT2PTR
+
+#if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
+#  define PTRV                  UV
+#  define INT2PTR(any,d)        (any)(d)
+#else
+#  if PTRSIZE == LONGSIZE
+#    define PTRV                unsigned long
+#  else
+#    define PTRV                unsigned
+#  endif
+#  define INT2PTR(any,d)        (any)(PTRV)(d)
+#endif
+#define NUM2PTR(any,d)  (any)(PTRV)(d)
+#define PTR2IV(p)       INT2PTR(IV,p)
+#define PTR2UV(p)       INT2PTR(UV,p)
+#define PTR2NV(p)       NUM2PTR(NV,p)
+#if PTRSIZE == LONGSIZE
+#  define PTR2ul(p)     (unsigned long)(p)
+#else
+#  define PTR2ul(p)     INT2PTR(unsigned long,p)        
+#endif
+
+#endif /* !INT2PTR */
+
+#ifndef boolSV
+#	define boolSV(b) ((b) ? &PL_sv_yes : &PL_sv_no)
+#endif
+
+#ifndef gv_stashpvn
+#	define gv_stashpvn(str,len,flags) gv_stashpv(str,flags)
+#endif
+
+#ifndef newSVpvn
+#	define newSVpvn(data,len) ((len) ? newSVpv ((data), (len)) : newSVpv ("", 0))
+#endif
+
+#ifndef newRV_inc
+/* Replace: 1 */
+#	define newRV_inc(sv) newRV(sv)
+/* Replace: 0 */
+#endif
+
+/* DEFSV appears first in 5.004_56 */
+#ifndef DEFSV
+#  define DEFSV	GvSV(PL_defgv)
+#endif
+
+#ifndef SAVE_DEFSV
+#    define SAVE_DEFSV SAVESPTR(GvSV(PL_defgv))
+#endif
+
+#ifndef newRV_noinc
+#  ifdef __GNUC__
+#    define newRV_noinc(sv)               \
+      ({                                  \
+          SV *nsv = (SV*)newRV(sv);       \
+          SvREFCNT_dec(sv);               \
+          nsv;                            \
+      })
+#  else
+#    if defined(USE_THREADS)
+static SV * newRV_noinc (SV * sv)
+{
+          SV *nsv = (SV*)newRV(sv);       
+          SvREFCNT_dec(sv);               
+          return nsv;                     
+}
+#    else
+#      define newRV_noinc(sv)    \
+        (PL_Sv=(SV*)newRV(sv), SvREFCNT_dec(sv), (SV*)PL_Sv)
+#    endif
+#  endif
+#endif
+
+/* Provide: newCONSTSUB */
+
+/* newCONSTSUB from IO.xs is in the core starting with 5.004_63 */
+#if (PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION < 63))
+
+#if defined(NEED_newCONSTSUB)
+static
+#else
+extern void newCONSTSUB(HV * stash, char * name, SV *sv);
+#endif
+
+#if defined(NEED_newCONSTSUB) || defined(NEED_newCONSTSUB_GLOBAL)
+void
+newCONSTSUB(stash,name,sv)
+HV *stash;
+char *name;
+SV *sv;
+{
+	U32 oldhints = PL_hints;
+	HV *old_cop_stash = PL_curcop->cop_stash;
+	HV *old_curstash = PL_curstash;
+	line_t oldline = PL_curcop->cop_line;
+	PL_curcop->cop_line = PL_copline;
+
+	PL_hints &= ~HINT_BLOCK_SCOPE;
+	if (stash)
+		PL_curstash = PL_curcop->cop_stash = stash;
+
+	newSUB(
+
+#if (PERL_VERSION < 3) || ((PERL_VERSION == 3) && (PERL_SUBVERSION < 22))
+     /* before 5.003_22 */
+		start_subparse(),
+#else
+#  if (PERL_VERSION == 3) && (PERL_SUBVERSION == 22)
+     /* 5.003_22 */
+     		start_subparse(0),
+#  else
+     /* 5.003_23  onwards */
+     		start_subparse(FALSE, 0),
+#  endif
+#endif
+
+		newSVOP(OP_CONST, 0, newSVpv(name,0)),
+		newSVOP(OP_CONST, 0, &PL_sv_no),   /* SvPV(&PL_sv_no) == "" -- GMB */
+		newSTATEOP(0, Nullch, newSVOP(OP_CONST, 0, sv))
+	);
+
+	PL_hints = oldhints;
+	PL_curcop->cop_stash = old_cop_stash;
+	PL_curstash = old_curstash;
+	PL_curcop->cop_line = oldline;
+}
+#endif
+
+#endif /* newCONSTSUB */
+
+#ifndef START_MY_CXT
+
+/*
+ * Boilerplate macros for initializing and accessing interpreter-local
+ * data from C.  All statics in extensions should be reworked to use
+ * this, if you want to make the extension thread-safe.  See ext/re/re.xs
+ * for an example of the use of these macros.
+ *
+ * Code that uses these macros is responsible for the following:
+ * 1. #define MY_CXT_KEY to a unique string, e.g. "DynaLoader_guts"
+ * 2. Declare a typedef named my_cxt_t that is a structure that contains
+ *    all the data that needs to be interpreter-local.
+ * 3. Use the START_MY_CXT macro after the declaration of my_cxt_t.
+ * 4. Use the MY_CXT_INIT macro such that it is called exactly once
+ *    (typically put in the BOOT: section).
+ * 5. Use the members of the my_cxt_t structure everywhere as
+ *    MY_CXT.member.
+ * 6. Use the dMY_CXT macro (a declaration) in all the functions that
+ *    access MY_CXT.
+ */
+
+#if defined(MULTIPLICITY) || defined(PERL_OBJECT) || \
+    defined(PERL_CAPI)    || defined(PERL_IMPLICIT_CONTEXT)
+
+/* This must appear in all extensions that define a my_cxt_t structure,
+ * right after the definition (i.e. at file scope).  The non-threads
+ * case below uses it to declare the data as static. */
+#define START_MY_CXT
+
+#if (PERL_VERSION < 4 || (PERL_VERSION == 4 && PERL_SUBVERSION < 68 ))
+/* Fetches the SV that keeps the per-interpreter data. */
+#define dMY_CXT_SV \
+	SV *my_cxt_sv = perl_get_sv(MY_CXT_KEY, FALSE)
+#else /* >= perl5.004_68 */
+#define dMY_CXT_SV \
+	SV *my_cxt_sv = *hv_fetch(PL_modglobal, MY_CXT_KEY,		\
+				  sizeof(MY_CXT_KEY)-1, TRUE)
+#endif /* < perl5.004_68 */
+
+/* This declaration should be used within all functions that use the
+ * interpreter-local data. */
+#define dMY_CXT	\
+	dMY_CXT_SV;							\
+	my_cxt_t *my_cxtp = INT2PTR(my_cxt_t*,SvUV(my_cxt_sv))
+
+/* Creates and zeroes the per-interpreter data.
+ * (We allocate my_cxtp in a Perl SV so that it will be released when
+ * the interpreter goes away.) */
+#define MY_CXT_INIT \
+	dMY_CXT_SV;							\
+	/* newSV() allocates one more than needed */			\
+	my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
+	Zero(my_cxtp, 1, my_cxt_t);					\
+	sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))
+
+/* This macro must be used to access members of the my_cxt_t structure.
+ * e.g. MYCXT.some_data */
+#define MY_CXT		(*my_cxtp)
+
+/* Judicious use of these macros can reduce the number of times dMY_CXT
+ * is used.  Use is similar to pTHX, aTHX etc. */
+#define pMY_CXT		my_cxt_t *my_cxtp
+#define pMY_CXT_	pMY_CXT,
+#define _pMY_CXT	,pMY_CXT
+#define aMY_CXT		my_cxtp
+#define aMY_CXT_	aMY_CXT,
+#define _aMY_CXT	,aMY_CXT
+
+#else /* single interpreter */
+
+#define START_MY_CXT	static my_cxt_t my_cxt;
+#define dMY_CXT_SV	dNOOP
+#define dMY_CXT		dNOOP
+#define MY_CXT_INIT	NOOP
+#define MY_CXT		my_cxt
+
+#define pMY_CXT		void
+#define pMY_CXT_
+#define _pMY_CXT
+#define aMY_CXT
+#define aMY_CXT_
+#define _aMY_CXT
+
+#endif 
+
+#endif /* START_MY_CXT */
+
+#ifndef IVdf
+#  if IVSIZE == LONGSIZE
+#       define	IVdf		"ld"
+#       define	UVuf		"lu"
+#       define	UVof		"lo"
+#       define	UVxf		"lx"
+#       define	UVXf		"lX"
+#   else
+#       if IVSIZE == INTSIZE
+#           define	IVdf	"d"
+#           define	UVuf	"u"
+#           define	UVof	"o"
+#           define	UVxf	"x"
+#           define	UVXf	"X"
+#       endif
+#   endif
+#endif
+
+#ifndef NVef
+#   if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && \
+	defined(PERL_PRIfldbl) /* Not very likely, but let's try anyway. */ 
+#       define NVef		PERL_PRIeldbl
+#       define NVff		PERL_PRIfldbl
+#       define NVgf		PERL_PRIgldbl
+#   else
+#       define NVef		"e"
+#       define NVff		"f"
+#       define NVgf		"g"
+#   endif
+#endif
+
+#ifndef AvFILLp			/* Older perls (<=5.003) lack AvFILLp */
+#   define AvFILLp AvFILL
+#endif
+
+#ifdef SvPVbyte
+#   if PERL_REVISION == 5 && PERL_VERSION < 7
+       /* SvPVbyte does not work in perl-5.6.1, borrowed version for 5.7.3 */
+#       undef SvPVbyte
+#       define SvPVbyte(sv, lp) \
+          ((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK) \
+           ? ((lp = SvCUR(sv)), SvPVX(sv)) : my_sv_2pvbyte(aTHX_ sv, &lp))
+       static char *
+       my_sv_2pvbyte(pTHX_ register SV *sv, STRLEN *lp)
+       {   
+           sv_utf8_downgrade(sv,0);
+           return SvPV(sv,*lp);
+       }
+#   endif
+#else
+#   define SvPVbyte SvPV
+#endif
+
+#ifndef SvPV_nolen
+#   define SvPV_nolen(sv) \
+        ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
+         ? SvPVX(sv) : sv_2pv_nolen(sv))
+    static char *
+    sv_2pv_nolen(pTHX_ register SV *sv)
+    {   
+        STRLEN n_a;
+        return sv_2pv(sv, &n_a);
+    }
+#endif
+
+#ifndef get_cv
+#   define get_cv(name,create) perl_get_cv(name,create)
+#endif
+
+#ifndef get_sv
+#   define get_sv(name,create) perl_get_sv(name,create)
+#endif
+
+#ifndef get_av
+#   define get_av(name,create) perl_get_av(name,create)
+#endif
+
+#ifndef get_hv
+#   define get_hv(name,create) perl_get_hv(name,create)
+#endif
+
+#ifndef call_argv
+#   define call_argv perl_call_argv
+#endif
+
+#ifndef call_method
+#   define call_method perl_call_method
+#endif
+
+#ifndef call_pv
+#   define call_pv perl_call_pv
+#endif
+
+#ifndef call_sv
+#   define call_sv perl_call_sv
+#endif
+
+#ifndef eval_pv
+#   define eval_pv perl_eval_pv
+#endif
+
+#ifndef eval_sv
+#   define eval_sv perl_eval_sv
+#endif
+
+#ifndef PERL_SCAN_GREATER_THAN_UV_MAX
+#   define PERL_SCAN_GREATER_THAN_UV_MAX 0x02
+#endif
+
+#ifndef PERL_SCAN_SILENT_ILLDIGIT
+#   define PERL_SCAN_SILENT_ILLDIGIT 0x04
+#endif
+
+#ifndef PERL_SCAN_ALLOW_UNDERSCORES
+#   define PERL_SCAN_ALLOW_UNDERSCORES 0x01
+#endif
+
+#ifndef PERL_SCAN_DISALLOW_PREFIX
+#   define PERL_SCAN_DISALLOW_PREFIX 0x02
+#endif
+
+#if (PERL_VERSION > 6) || ((PERL_VERSION == 6) && (PERL_SUBVERSION >= 1))
+#define I32_CAST
+#else
+#define I32_CAST (I32*)
+#endif
+
+#ifndef grok_hex
+static UV _grok_hex (pTHX_ char *string, STRLEN *len, I32 *flags, NV *result) {
+    NV r = scan_hex(string, *len, I32_CAST len);
+    if (r > UV_MAX) {
+        *flags |= PERL_SCAN_GREATER_THAN_UV_MAX;
+        if (result) *result = r;
+        return UV_MAX;
+    }
+    return (UV)r;
+}
+        
+#   define grok_hex(string, len, flags, result)     \
+        _grok_hex(pTHX_ (string), (len), (flags), (result))
+#endif 
+
+#ifndef grok_oct
+static UV _grok_oct (pTHX_ char *string, STRLEN *len, I32 *flags, NV *result) {
+    NV r = scan_oct(string, *len, I32_CAST len);
+    if (r > UV_MAX) {
+        *flags |= PERL_SCAN_GREATER_THAN_UV_MAX;
+        if (result) *result = r;
+        return UV_MAX;
+    }
+    return (UV)r;
+}
+
+#   define grok_oct(string, len, flags, result)     \
+        _grok_oct(pTHX_ (string), (len), (flags), (result))
+#endif
+
+#if !defined(grok_bin) && defined(scan_bin)
+static UV _grok_bin (pTHX_ char *string, STRLEN *len, I32 *flags, NV *result) {
+    NV r = scan_bin(string, *len, I32_CAST len);
+    if (r > UV_MAX) {
+        *flags |= PERL_SCAN_GREATER_THAN_UV_MAX;
+        if (result) *result = r;
+        return UV_MAX;
+    }
+    return (UV)r;
+}
+
+#   define grok_bin(string, len, flags, result)     \
+        _grok_bin(pTHX_ (string), (len), (flags), (result))
+#endif
+
+#ifndef IN_LOCALE
+#   define IN_LOCALE \
+	(PL_curcop == &PL_compiling ? IN_LOCALE_COMPILETIME : IN_LOCALE_RUNTIME)
+#endif
+
+#ifndef IN_LOCALE_RUNTIME
+#   define IN_LOCALE_RUNTIME   (PL_curcop->op_private & HINT_LOCALE)
+#endif
+
+#ifndef IN_LOCALE_COMPILETIME
+#   define IN_LOCALE_COMPILETIME   (PL_hints & HINT_LOCALE)
+#endif
+
+
+#ifndef IS_NUMBER_IN_UV
+#   define IS_NUMBER_IN_UV		            0x01   
+#   define IS_NUMBER_GREATER_THAN_UV_MAX    0x02
+#   define IS_NUMBER_NOT_INT	            0x04
+#   define IS_NUMBER_NEG		            0x08
+#   define IS_NUMBER_INFINITY	            0x10 
+#   define IS_NUMBER_NAN                    0x20  
+#endif
+   
+#ifndef grok_numeric_radix
+#   define GROK_NUMERIC_RADIX(sp, send) grok_numeric_radix(aTHX_ sp, send)
+
+#define grok_numeric_radix Perl_grok_numeric_radix
+    
+static
+bool
+Perl_grok_numeric_radix(pTHX_ const char **sp, const char *send)
+{
+#ifdef USE_LOCALE_NUMERIC
+#if (PERL_VERSION > 6) || ((PERL_VERSION == 6) && (PERL_SUBVERSION >= 1))
+    if (PL_numeric_radix_sv && IN_LOCALE) { 
+        STRLEN len;
+        char* radix = SvPV(PL_numeric_radix_sv, len);
+        if (*sp + len <= send && memEQ(*sp, radix, len)) {
+            *sp += len;
+            return TRUE; 
+        }
+    }
+#else
+    /* pre5.6.0 perls don't have PL_numeric_radix_sv so the radix
+     * must manually be requested from locale.h */
+#include <locale.h>
+    struct lconv *lc = localeconv();
+    char *radix = lc->decimal_point;
+    if (radix && IN_LOCALE) { 
+        STRLEN len = strlen(radix);
+        if (*sp + len <= send && memEQ(*sp, radix, len)) {
+            *sp += len;
+            return TRUE; 
+        }
+    }
+#endif /* PERL_VERSION */
+#endif /* USE_LOCALE_NUMERIC */
+    /* always try "." if numeric radix didn't match because
+     * we may have data from different locales mixed */
+    if (*sp < send && **sp == '.') {
+        ++*sp;
+        return TRUE;
+    }
+    return FALSE;
+}
+#endif /* grok_numeric_radix */
+
+#ifndef grok_number
+
+#define grok_number Perl_grok_number
+
+static
+int
+Perl_grok_number(pTHX_ const char *pv, STRLEN len, UV *valuep)
+{
+  const char *s = pv;
+  const char *send = pv + len;
+  const UV max_div_10 = UV_MAX / 10;
+  const char max_mod_10 = UV_MAX % 10;
+  int numtype = 0;
+  int sawinf = 0;
+  int sawnan = 0;
+
+  while (s < send && isSPACE(*s))
+    s++;
+  if (s == send) {
+    return 0;
+  } else if (*s == '-') {
+    s++;
+    numtype = IS_NUMBER_NEG;
+  }
+  else if (*s == '+')
+  s++;
+
+  if (s == send)
+    return 0;
+
+  /* next must be digit or the radix separator or beginning of infinity */
+  if (isDIGIT(*s)) {
+    /* UVs are at least 32 bits, so the first 9 decimal digits cannot
+       overflow.  */
+    UV value = *s - '0';
+    /* This construction seems to be more optimiser friendly.
+       (without it gcc does the isDIGIT test and the *s - '0' separately)
+       With it gcc on arm is managing 6 instructions (6 cycles) per digit.
+       In theory the optimiser could deduce how far to unroll the loop
+       before checking for overflow.  */
+    if (++s < send) {
+      int digit = *s - '0';
+      if (digit >= 0 && digit <= 9) {
+        value = value * 10 + digit;
+        if (++s < send) {
+          digit = *s - '0';
+          if (digit >= 0 && digit <= 9) {
+            value = value * 10 + digit;
+            if (++s < send) {
+              digit = *s - '0';
+              if (digit >= 0 && digit <= 9) {
+                value = value * 10 + digit;
+		        if (++s < send) {
+                  digit = *s - '0';
+                  if (digit >= 0 && digit <= 9) {
+                    value = value * 10 + digit;
+                    if (++s < send) {
+                      digit = *s - '0';
+                      if (digit >= 0 && digit <= 9) {
+                        value = value * 10 + digit;
+                        if (++s < send) {
+                          digit = *s - '0';
+                          if (digit >= 0 && digit <= 9) {
+                            value = value * 10 + digit;
+                            if (++s < send) {
+                              digit = *s - '0';
+                              if (digit >= 0 && digit <= 9) {
+                                value = value * 10 + digit;
+                                if (++s < send) {
+                                  digit = *s - '0';
+                                  if (digit >= 0 && digit <= 9) {
+                                    value = value * 10 + digit;
+                                    if (++s < send) {
+                                      /* Now got 9 digits, so need to check
+                                         each time for overflow.  */
+                                      digit = *s - '0';
+                                      while (digit >= 0 && digit <= 9
+                                             && (value < max_div_10
+                                                 || (value == max_div_10
+                                                     && digit <= max_mod_10))) {
+                                        value = value * 10 + digit;
+                                        if (++s < send)
+                                          digit = *s - '0';
+                                        else
+                                          break;
+                                      }
+                                      if (digit >= 0 && digit <= 9
+                                          && (s < send)) {
+                                        /* value overflowed.
+                                           skip the remaining digits, don't
+                                           worry about setting *valuep.  */
+                                        do {
+                                          s++;
+                                        } while (s < send && isDIGIT(*s));
+                                        numtype |=
+                                          IS_NUMBER_GREATER_THAN_UV_MAX;
+                                        goto skip_value;
+                                      }
+                                    }
+                                  }
+				                }
+                              }
+                            }
+                          }
+                        }
+                      }
+                    }
+                  }
+                }
+              }
+            }
+          }
+	    }
+      }
+    }
+    numtype |= IS_NUMBER_IN_UV;
+    if (valuep)
+      *valuep = value;
+
+  skip_value:
+    if (GROK_NUMERIC_RADIX(&s, send)) {
+      numtype |= IS_NUMBER_NOT_INT;
+      while (s < send && isDIGIT(*s))  /* optional digits after the radix */
+        s++;
+    }
+  }
+  else if (GROK_NUMERIC_RADIX(&s, send)) {
+    numtype |= IS_NUMBER_NOT_INT | IS_NUMBER_IN_UV; /* valuep assigned below */
+    /* no digits before the radix means we need digits after it */
+    if (s < send && isDIGIT(*s)) {
+      do {
+        s++;
+      } while (s < send && isDIGIT(*s));
+      if (valuep) {
+        /* integer approximation is valid - it's 0.  */
+        *valuep = 0;
+      }
+    }
+    else
+      return 0;
+  } else if (*s == 'I' || *s == 'i') {
+    s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
+    s++; if (s == send || (*s != 'F' && *s != 'f')) return 0;
+    s++; if (s < send && (*s == 'I' || *s == 'i')) {
+      s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
+      s++; if (s == send || (*s != 'I' && *s != 'i')) return 0;
+      s++; if (s == send || (*s != 'T' && *s != 't')) return 0;
+      s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0;
+      s++;
+    }
+    sawinf = 1;
+  } else if (*s == 'N' || *s == 'n') {
+    /* XXX TODO: There are signaling NaNs and quiet NaNs. */
+    s++; if (s == send || (*s != 'A' && *s != 'a')) return 0;
+    s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
+    s++;
+    sawnan = 1;
+  } else
+    return 0;
+
+  if (sawinf) {
+    numtype &= IS_NUMBER_NEG; /* Keep track of sign  */
+    numtype |= IS_NUMBER_INFINITY | IS_NUMBER_NOT_INT;
+  } else if (sawnan) {
+    numtype &= IS_NUMBER_NEG; /* Keep track of sign  */
+    numtype |= IS_NUMBER_NAN | IS_NUMBER_NOT_INT;
+  } else if (s < send) {
+    /* we can have an optional exponent part */
+    if (*s == 'e' || *s == 'E') {
+      /* The only flag we keep is sign.  Blow away any "it's UV"  */
+      numtype &= IS_NUMBER_NEG;
+      numtype |= IS_NUMBER_NOT_INT;
+      s++;
+      if (s < send && (*s == '-' || *s == '+'))
+        s++;
+      if (s < send && isDIGIT(*s)) {
+        do {
+          s++;
+        } while (s < send && isDIGIT(*s));
+      }
+      else
+      return 0;
+    }
+  }
+  while (s < send && isSPACE(*s))
+    s++;
+  if (s >= send)
+    return numtype;
+  if (len == 10 && memEQ(pv, "0 but true", 10)) {
+    if (valuep)
+      *valuep = 0;
+    return IS_NUMBER_IN_UV;
+  }
+  return 0;
+}
+#endif /* grok_number */
+
+#ifndef PERL_MAGIC_sv
+#   define PERL_MAGIC_sv             '\0'
+#endif
+
+#ifndef PERL_MAGIC_overload
+#   define PERL_MAGIC_overload       'A'
+#endif
+
+#ifndef PERL_MAGIC_overload_elem
+#   define PERL_MAGIC_overload_elem  'a'
+#endif
+
+#ifndef PERL_MAGIC_overload_table
+#   define PERL_MAGIC_overload_table 'c'
+#endif
+
+#ifndef PERL_MAGIC_bm
+#   define PERL_MAGIC_bm             'B'
+#endif
+
+#ifndef PERL_MAGIC_regdata
+#   define PERL_MAGIC_regdata        'D'
+#endif
+
+#ifndef PERL_MAGIC_regdatum
+#   define PERL_MAGIC_regdatum       'd'
+#endif
+
+#ifndef PERL_MAGIC_env
+#   define PERL_MAGIC_env            'E'
+#endif
+
+#ifndef PERL_MAGIC_envelem
+#   define PERL_MAGIC_envelem        'e'
+#endif
+
+#ifndef PERL_MAGIC_fm
+#   define PERL_MAGIC_fm             'f'
+#endif
+
+#ifndef PERL_MAGIC_regex_global
+#   define PERL_MAGIC_regex_global   'g'
+#endif
+
+#ifndef PERL_MAGIC_isa
+#   define PERL_MAGIC_isa            'I'
+#endif
+
+#ifndef PERL_MAGIC_isaelem
+#   define PERL_MAGIC_isaelem        'i'
+#endif
+
+#ifndef PERL_MAGIC_nkeys
+#   define PERL_MAGIC_nkeys          'k'
+#endif
+
+#ifndef PERL_MAGIC_dbfile
+#   define PERL_MAGIC_dbfile         'L'
+#endif
+
+#ifndef PERL_MAGIC_dbline
+#   define PERL_MAGIC_dbline         'l'
+#endif
+
+#ifndef PERL_MAGIC_mutex
+#   define PERL_MAGIC_mutex          'm'
+#endif
+
+#ifndef PERL_MAGIC_shared
+#   define PERL_MAGIC_shared         'N'
+#endif
+
+#ifndef PERL_MAGIC_shared_scalar
+#   define PERL_MAGIC_shared_scalar  'n'
+#endif
+
+#ifndef PERL_MAGIC_collxfrm
+#   define PERL_MAGIC_collxfrm       'o'
+#endif
+
+#ifndef PERL_MAGIC_tied
+#   define PERL_MAGIC_tied           'P'
+#endif
+
+#ifndef PERL_MAGIC_tiedelem
+#   define PERL_MAGIC_tiedelem       'p'
+#endif
+
+#ifndef PERL_MAGIC_tiedscalar
+#   define PERL_MAGIC_tiedscalar     'q'
+#endif
+
+#ifndef PERL_MAGIC_qr
+#   define PERL_MAGIC_qr             'r'
+#endif
+
+#ifndef PERL_MAGIC_sig
+#   define PERL_MAGIC_sig            'S'
+#endif
+
+#ifndef PERL_MAGIC_sigelem
+#   define PERL_MAGIC_sigelem        's'
+#endif
+
+#ifndef PERL_MAGIC_taint
+#   define PERL_MAGIC_taint          't'
+#endif
+
+#ifndef PERL_MAGIC_uvar
+#   define PERL_MAGIC_uvar           'U'
+#endif
+
+#ifndef PERL_MAGIC_uvar_elem
+#   define PERL_MAGIC_uvar_elem      'u'
+#endif
+
+#ifndef PERL_MAGIC_vstring
+#   define PERL_MAGIC_vstring        'V'
+#endif
+
+#ifndef PERL_MAGIC_vec
+#   define PERL_MAGIC_vec            'v'
+#endif
+
+#ifndef PERL_MAGIC_utf8
+#   define PERL_MAGIC_utf8           'w'
+#endif
+
+#ifndef PERL_MAGIC_substr
+#   define PERL_MAGIC_substr         'x'
+#endif
+
+#ifndef PERL_MAGIC_defelem
+#   define PERL_MAGIC_defelem        'y'
+#endif
+
+#ifndef PERL_MAGIC_glob
+#   define PERL_MAGIC_glob           '*'
+#endif
+
+#ifndef PERL_MAGIC_arylen
+#   define PERL_MAGIC_arylen         '#'
+#endif
+
+#ifndef PERL_MAGIC_pos
+#   define PERL_MAGIC_pos            '.'
+#endif
+
+#ifndef PERL_MAGIC_backref
+#   define PERL_MAGIC_backref        '<'
+#endif
+
+#ifndef PERL_MAGIC_ext
+#   define PERL_MAGIC_ext            '~'
+#endif
+
+#endif /* _P_P_PORTABILITY_H_ */
+
+/* End of File ppport.h */

Added: trunk/orca/packages/version-0.39/t/01base.t
==============================================================================
--- (empty file)
+++ trunk/orca/packages/version-0.39/t/01base.t	Sat Jun  5 23:02:34 2004
@@ -0,0 +1,264 @@
+#! /usr/local/perl -w
+# Before `make install' is performed this script should be runnable with
+# `make test'. After `make install' it should work as `perl test.pl'
+
+#########################
+
+use Test::More tests => 168;
+
+diag "Tests with base class" unless $ENV{PERL_CORE};
+
+use_ok("version"); # If we made it this far, we are ok.
+BaseTests("version");
+
+diag "Tests with empty derived class" unless $ENV{PERL_CORE};
+
+package version::Empty;
+use vars qw($VERSION @ISA);
+use Exporter;
+use version 0.30;
+ at ISA = qw(Exporter version);
+$VERSION = 0.01;
+
+package main;
+my $testobj = new version::Empty 1.002_003;
+isa_ok( $testobj, "version::Empty" );
+ok( $testobj->numify == 1.002003, "Numified correctly" );
+ok( $testobj->stringify eq "1.2.3", "Stringified correctly" );
+
+my $verobj = new version "1.2.4";
+ok( $verobj > $testobj, "Comparison vs parent class" );
+ok( $verobj gt $testobj, "Comparison vs parent class" );
+BaseTests("version::Empty");
+
+sub BaseTests {
+
+	my $CLASS = shift;
+	
+	# Insert your test code below, the Test module is use()ed here so read
+	# its man page ( perldoc Test ) for help writing this test script.
+	
+	# Test bare number processing
+	diag "tests with bare numbers" unless $ENV{PERL_CORE};
+	$version = $CLASS->new(5.005_03);
+	is ( "$version" , "5.5.30" , '5.005_03 eq 5.5.30' );
+	$version = $CLASS->new(1.23);
+	is ( "$version" , "1.230" , '1.23 eq "1.230"' );
+	
+	# 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"' );
+	$version = $CLASS->new("v1.23");
+	is ( "$version" , "1.23.0" , '"v1.23" eq "1.23.0"' );
+	
+	# Test stringify operator
+	diag "tests with stringify" unless $ENV{PERL_CORE};
+	$version = $CLASS->new("5.005");
+	is ( "$version" , "5.005" , '5.005 eq "5.005"' );
+	$version = $CLASS->new("5.006.001");
+	is ( "$version" , "5.6.1" , '5.006.001 eq 5.6.1' );
+	$version = $CLASS->new("1.2.3_4");
+	is ( "$version" , "1.2.3_4" , 'alpha version 1.2.3_4 eq 1.2.3_4' );
+	
+	# test illegal formats
+	diag "test illegal formats" unless $ENV{PERL_CORE};
+	eval {my $version = $CLASS->new("1.2_3_4")};
+	like($@, qr/multiple underscores/,
+	    "Invalid version format (multiple underscores)");
+	
+	eval {my $version = $CLASS->new("1.2_3.4")};
+	like($@, qr/underscores before decimal/,
+	    "Invalid version format (underscores before decimal)");
+	
+	$version = $CLASS->new("99 and 44/100 pure");
+	ok ("$version" eq "99.000", '$version eq "99.000"');
+	ok ($version->numify == 99.0, '$version->numify == 99.0');
+	
+	$version = $CLASS->new("something");
+	ok (defined $version, 'defined $version');
+	
+	# reset the test object to something reasonable
+	$version = $CLASS->new("1.2.3");
+	
+	# Test boolean operator
+	ok ($version, 'boolean');
+	
+	# Test class membership
+	isa_ok ( $version, "version" );
+	
+	# Test comparison operators with self
+	diag "tests with self" unless $ENV{PERL_CORE};
+	ok ( $version eq $version, '$version eq $version' );
+	is ( $version cmp $version, 0, '$version cmp $version == 0' );
+	ok ( $version == $version, '$version == $version' );
+	
+	# test first with non-object
+	$version = $CLASS->new("5.006.001");
+	$new_version = "5.8.0";
+	diag "tests with non-objects" unless $ENV{PERL_CORE};
+	ok ( $version ne $new_version, '$version ne $new_version' );
+	ok ( $version lt $new_version, '$version lt $new_version' );
+	ok ( $new_version gt $version, '$new_version gt $version' );
+	ok ( ref(\$new_version) eq 'SCALAR', 'no auto-upgrade');
+	$new_version = "$version";
+	ok ( $version eq $new_version, '$version eq $new_version' );
+	ok ( $new_version eq $version, '$new_version eq $version' );
+	
+	# now test with existing object
+	$new_version = $CLASS->new("5.8.0");
+	diag "tests with objects" unless $ENV{PERL_CORE};
+	ok ( $version ne $new_version, '$version ne $new_version' );
+	ok ( $version lt $new_version, '$version lt $new_version' );
+	ok ( $new_version gt $version, '$new_version gt $version' );
+	$new_version = $CLASS->new("$version");
+	ok ( $version eq $new_version, '$version eq $new_version' );
+	
+	# Test Numeric Comparison operators
+	# test first with non-object
+	$new_version = "5.8.0";
+	diag "numeric tests with non-objects" unless $ENV{PERL_CORE};
+	ok ( $version == $version, '$version == $version' );
+	ok ( $version < $new_version, '$version < $new_version' );
+	ok ( $new_version > $version, '$new_version > $version' );
+	ok ( $version != $new_version, '$version != $new_version' );
+	
+	# now test with existing object
+	$new_version = $CLASS->new($new_version);
+	diag "numeric tests with objects" unless $ENV{PERL_CORE};
+	ok ( $version < $new_version, '$version < $new_version' );
+	ok ( $new_version > $version, '$new_version > $version' );
+	ok ( $version != $new_version, '$version != $new_version' );
+	
+	# now test with actual numbers
+	diag "numeric tests with numbers" unless $ENV{PERL_CORE};
+	ok ( $version->numify() == 5.006001, '$version->numify() == 5.006001' );
+	ok ( $version->numify() <= 5.006001, '$version->numify() <= 5.006001' );
+	ok ( $version->numify() < 5.008, '$version->numify() < 5.008' );
+	#ok ( $version->numify() > v5.005_02, '$version->numify() > 5.005_02' );
+	
+	# test with long decimals
+	diag "Tests with extended decimal versions" unless $ENV{PERL_CORE};
+	$version = $CLASS->new(1.002003);
+	ok ( $version eq "1.2.3", '$version eq "1.2.3"');
+	ok ( $version->numify == 1.002003, '$version->numify == 1.002003');
+	$version = $CLASS->new("2002.09.30.1");
+	ok ( $version eq "2002.9.30.1",'$version eq 2002.9.30.1');
+	ok ( $version->numify == 2002.009030001,
+	    '$version->numify == 2002.009030001');
+	
+	# now test with alpha version form with string
+	$version = $CLASS->new("1.2.3");
+	$new_version = "1.2.3_4";
+	diag "tests with alpha-style non-objects" unless $ENV{PERL_CORE};
+	ok ( $version lt $new_version, '$version lt $new_version' );
+	ok ( $new_version gt $version, '$new_version gt $version' );
+	ok ( $version ne $new_version, '$version ne $new_version' );
+	
+	$version = $CLASS->new("1.2.4");
+	diag "numeric tests with alpha-style non-objects" unless $ENV{PERL_CORE};
+	ok ( $version > $new_version, '$version > $new_version' );
+	ok ( $new_version < $version, '$new_version < $version' );
+	ok ( $version != $new_version, '$version != $new_version' );
+	
+	# now test with alpha version form with object
+	$version = $CLASS->new("1.2.3");
+	$new_version = $CLASS->new("1.2.3_4");
+	diag "tests with alpha-style objects" unless $ENV{PERL_CORE};
+	ok ( $version < $new_version, '$version < $new_version' );
+	ok ( $new_version > $version, '$new_version > $version' );
+	ok ( $version != $new_version, '$version != $new_version' );
+	ok ( !$version->is_alpha, '!$version->is_alpha');
+	ok ( $new_version->is_alpha, '$new_version->is_alpha');
+	
+	$version = $CLASS->new("1.2.4");
+	diag "tests with alpha-style objects" unless $ENV{PERL_CORE};
+	ok ( $version > $new_version, '$version > $new_version' );
+	ok ( $new_version < $version, '$new_version < $version' );
+	ok ( $version != $new_version, '$version != $new_version' );
+	
+	$version = $CLASS->new("1.2.3.4");
+	$new_version = $CLASS->new("1.2.3_4");
+	diag "tests with alpha-style objects with same subversion" unless $ENV{PERL_CORE};
+	ok ( $version > $new_version, '$version > $new_version' );
+	ok ( $new_version < $version, '$new_version < $version' );
+	ok ( $version != $new_version, '$version != $new_version' );
+	
+	diag "test implicit [in]equality" unless $ENV{PERL_CORE};
+	$version = $CLASS->new("v1.2.3");
+	$new_version = $CLASS->new("1.2.3.0");
+	ok ( $version == $new_version, '$version == $new_version' );
+	$new_version = $CLASS->new("1.2.3_0");
+	ok ( $version == $new_version, '$version == $new_version' );
+	$new_version = $CLASS->new("1.2.3.1");
+	ok ( $version < $new_version, '$version < $new_version' );
+	$new_version = $CLASS->new("1.2.3_1");
+	ok ( $version < $new_version, '$version < $new_version' );
+	$new_version = $CLASS->new("1.1.999");
+	ok ( $version > $new_version, '$version > $new_version' );
+	
+	# that which is not expressly permitted is forbidden
+	diag "forbidden operations" unless $ENV{PERL_CORE};
+	ok ( !eval { ++$version }, "noop ++" );
+	ok ( !eval { --$version }, "noop --" );
+	ok ( !eval { $version/1 }, "noop /" );
+	ok ( !eval { $version*3 }, "noop *" );
+	ok ( !eval { abs($version) }, "noop abs" );
+
+	# test the qv() sub
+	diag "testing qv" unless $ENV{PERL_CORE};
+	$version = qv("1.2");
+	ok ( $version eq "1.2.0", 'qv("1.2") eq "1.2.0"' );
+	$version = qv(1.2);
+	ok ( $version eq "1.2.0", 'qv(1.2) eq "1.2.0"' );
+
+	# test creation from existing version object
+	diag "create new from existing version" unless $ENV{PERL_CORE};
+	ok (eval {$new_version = version->new($version)},
+		"new from existing object");
+	ok ($new_version == $version, "duped object identical");
+
+	# test the CVS revision mode
+	diag "testing CVS Revision" unless $ENV{PERL_CORE};
+	$version = new version qw$Revision: 1.2$;
+	ok ( $version eq "1.2.0", 'qw$Revision: 1.2$ eq 1.2.0' );
+	
+	# test reformed UNIVERSAL::VERSION
+	diag "Replacement UNIVERSAL::VERSION tests" unless $ENV{PERL_CORE};
+	
+	# we know this file is here since we require it ourselves
+	$version = $Test::More::VERSION;
+	eval "use Test::More $version";
+	unlike($@, qr/Test::More version $version/,
+		'Replacement eval works with exact version');
+	
+	$version = $Test::More::VERSION+0.01; # this should fail even with old UNIVERSAL::VERSION
+	eval "use Test::More $version";
+	like($@, qr/Test::More version $version/,
+		'Replacement eval works with incremented version');
+	
+	$version =~ s/\.0$//; #convert to string and remove trailing '.0'
+	chop($version);	# shorten by 1 digit, should still succeed
+	eval "use Test::More $version";
+	unlike($@, qr/Test::More version $version/,
+		'Replacement eval works with single digit');
+	
+	$version += 0.1; # this would fail with old UNIVERSAL::VERSION
+	eval "use Test::More $version";
+	like($@, qr/Test::More version $version/,
+		'Replacement eval works with incremented digit');
+	
+SKIP: 	{
+	    skip 'Cannot test v-strings with Perl < 5.8.1', 4
+		    if $] < 5.008_001; 
+	    diag "Tests with v-strings" unless $ENV{PERL_CORE};
+	    $version = $CLASS->new(1.2.3);
+	    ok("$version" eq "1.2.3", '"$version" eq 1.2.3');
+	    $version = $CLASS->new(1.0.0);
+	    $new_version = $CLASS->new(1);
+	    ok($version == $new_version, '$version == $new_version');
+	    ok($version eq $new_version, '$version eq $new_version');
+	    $version = qv(1.2.3);
+	    ok("$version" eq "1.2.3", 'v-string initialized qv()');
+	}
+}

Added: trunk/orca/packages/version-0.39/typemap
==============================================================================
--- (empty file)
+++ trunk/orca/packages/version-0.39/typemap	Sat Jun  5 23:02:34 2004
@@ -0,0 +1,29 @@
+###############################################################################
+##                                                                           ##
+##    Typemap for module "Universal::Version"                                ##
+##                                                                           ##
+##    Copyright (c) 2001 by John Peacock.                                    ##
+##    All rights reserved.                                                   ##
+##                                                                           ##
+##    This package is free software; you can redistribute it                 ##
+##    and/or modify it under the same terms as Perl itself.                  ##
+##                                                                           ##
+###############################################################################
+
+TYPEMAP
+
+N_int	T_IV
+N_long	T_IV
+Z_int	T_IV
+Z_long	T_IV
+boolean	T_IV
+version T_PTROBJ_SPECIAL
+
+INPUT
+
+T_PTROBJ_SPECIAL
+        if (sv_derived_from($arg, \"${(my $ntt=$ntype)=~s/_/::/g;\$ntt}\")) {
+	    $var = $arg;
+        }
+        else
+            Perl_croak(aTHX_ \"$var is not of type ${(my $ntt=$ntype)=~s/_/::/g;\$ntt}\")

Added: trunk/orca/packages/version-0.39/util.c
==============================================================================
--- (empty file)
+++ trunk/orca/packages/version-0.39/util.c	Sat Jun  5 23:02:34 2004
@@ -0,0 +1,396 @@
+#include "util.h"
+
+/*
+=for apidoc scan_version
+
+Returns a pointer to the next character after the parsed
+version string, as well as upgrading the passed in SV to
+an RV.
+
+Function must be called with an already existing SV like
+
+    sv = newSV(0);
+    s = scan_version(s,SV *sv, bool qv);
+
+Performs some preprocessing to the string to ensure that
+it has the correct characteristics of a version.  Flags the
+object if it contains an underscore (which denotes this
+is a alpha version).  The boolean qv denotes that the version
+should be interpreted as if it had multiple decimals, even if
+it doesn't.
+
+=cut
+*/
+
+char *
+Perl_scan_version(pTHX_ char *s, SV *rv, bool qv)
+{
+    const char *start = s;
+    char *pos = s;
+    I32 saw_period = 0;
+    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 */
+
+    /* pre-scan the imput string to check for decimals */
+    while ( *pos == '.' || *pos == '_' || isDIGIT(*pos) )
+    {
+	if ( *pos == '.' )
+	{
+	    if ( saw_under )
+		Perl_croak(aTHX_ "Invalid version format (underscores before decimal)");
+	    saw_period++ ;
+	}
+	else if ( *pos == '_' )
+	{
+	    if ( saw_under )
+		Perl_croak(aTHX_ "Invalid version format (multiple underscores)");
+	    saw_under = 1;
+	}
+	pos++;
+    }
+    pos = s;
+
+    if (*pos == 'v') {
+	pos++;  /* get past 'v' */
+	qv = 1; /* force quoted version processing */
+    }
+    while (isDIGIT(*pos))
+	pos++;
+    if (!isALPHA(*pos)) {
+	I32 rev;
+
+	if (*s == 'v') s++;  /* get past 'v' */
+
+	for (;;) {
+	    rev = 0;
+	    {
+  		/* this is atoi() that delimits on underscores */
+  		char *end = pos;
+  		I32 mult = 1;
+ 		I32 orev;
+  		if ( s < pos && s > start && *(s-1) == '_' ) {
+ 			mult *= -1;	/* alpha version */
+  		}
+		/* the following if() will only be true after the decimal
+		 * point of a version originally created with a bare
+		 * floating point number, i.e. not quoted in any way
+		 */
+ 		if ( !qv && s > start+1 && saw_period == 1 ) {
+		    mult *= 100;
+ 		    while ( s < end ) {
+ 			orev = rev;
+ 			rev += (*s - '0') * mult;
+ 			mult /= 10;
+ 			if ( PERL_ABS(orev) > PERL_ABS(rev) )
+ 			    Perl_croak(aTHX_ "Integer overflow in version");
+ 			s++;
+ 		    }
+  		}
+ 		else {
+ 		    while (--end >= s) {
+ 			orev = rev;
+ 			rev += (*end - '0') * mult;
+ 			mult *= 10;
+ 			if ( PERL_ABS(orev) > PERL_ABS(rev) )
+ 			    Perl_croak(aTHX_ "Integer overflow in version");
+ 		    }
+ 		} 
+  	    }
+  
+  	    /* Append revision */
+	    av_push((AV *)sv, newSViv(rev));
+	    if ( (*pos == '.' || *pos == '_') && isDIGIT(pos[1]))
+		s = ++pos;
+	    else if ( isDIGIT(*pos) )
+		s = pos;
+	    else {
+		s = pos;
+		break;
+	    }
+	    while ( isDIGIT(*pos) ) {
+		if ( saw_period == 1 && pos-s == 3 )
+		    break;
+		pos++;
+	    }
+	}
+    }
+    if ( qv ) { /* quoted versions always become full version objects */
+	I32 len = av_len((AV *)sv);
+	for ( len = 2 - len; len != 0; len-- )
+	    av_push((AV *)sv, newSViv(0));
+    }
+    return s;
+}
+
+/*
+=for apidoc new_version
+
+Returns a new version object based on the passed in SV:
+
+    SV *sv = new_version(SV *ver);
+
+Does not alter the passed in ver SV.  See "upg_version" if you
+want to upgrade the SV.
+
+=cut
+*/
+
+SV *
+Perl_new_version(pTHX_ SV *ver)
+{
+    SV *rv = newSV(0);
+    if ( sv_derived_from(ver,"version") ) /* can just copy directly */
+    {
+	I32 key;
+	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 */
+	for ( key = 0; key <= av_len(av); key++ )
+	{
+	    I32 rev = SvIV(*av_fetch(av, key, FALSE));
+	    av_push((AV *)sv, newSViv(rev));
+	}
+	return rv;
+    }
+#ifdef SvVOK
+    if ( SvVOK(ver) ) { /* already a v-string */
+	char *version;
+	MAGIC* mg = mg_find(ver,PERL_MAGIC_vstring);
+	version = savepvn( (const char*)mg->mg_ptr,mg->mg_len );
+	sv_setpv(rv,version);
+	Safefree(version);
+    }
+    else {
+#endif
+    sv_setsv(rv,ver); /* make a duplicate */
+#ifdef SvVOK
+    }
+#endif
+    upg_version(rv);
+    return rv;
+}
+
+/*
+=for apidoc upg_version
+
+In-place upgrade of the supplied SV to a version object.
+
+    SV *sv = upg_version(SV *sv);
+
+Returns a pointer to the upgraded SV.
+
+=cut
+*/
+
+SV *
+Perl_upg_version(pTHX_ SV *ver)
+{
+    char *version;
+    bool qv = 0;
+
+    if ( SvNOK(ver) ) /* may get too much accuracy */ 
+    {
+	char tbuf[64];
+	sprintf(tbuf,"%.9"NVgf, SvNVX(ver));
+	version = savepv(tbuf);
+    }
+#ifdef SvVOK
+    else if ( SvVOK(ver) ) { /* already a v-string */
+	MAGIC* mg = mg_find(ver,PERL_MAGIC_vstring);
+	version = savepvn( (const char*)mg->mg_ptr,mg->mg_len );
+	qv = 1;
+    }
+#endif
+    else /* must be a string or something like a string */
+    {
+	STRLEN n_a;
+	version = savepv(SvPV(ver,n_a));
+    }
+    (void)scan_version(version, ver, qv);
+    Safefree(version);
+    return ver;
+}
+
+
+/*
+=for apidoc vnumify
+
+Accepts a version object and returns the normalized floating
+point representation.  Call like:
+
+    sv = vnumify(rv);
+
+NOTE: you can pass either the object directly or the SV
+contained within the RV.
+
+=cut
+*/
+
+SV *
+Perl_vnumify(pTHX_ SV *vs)
+{
+    I32 i, len, digit;
+    SV *sv = newSV(0);
+    if ( SvROK(vs) )
+	vs = SvRV(vs);
+    len = av_len((AV *)vs);
+    if ( len == -1 )
+    {
+	Perl_sv_catpv(aTHX_ sv,"0");
+	return sv;
+    }
+    digit = SvIVX(*av_fetch((AV *)vs, 0, 0));
+    Perl_sv_setpvf(aTHX_ sv,"%d.", (int)PERL_ABS(digit));
+    for ( i = 1 ; i < len ; i++ )
+    {
+	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 )
+	{
+	    /* Don't display additional trailing zeros */
+	    Perl_sv_catpvf(aTHX_ sv,"%03d", (int)PERL_ABS(digit));
+	}
+    }
+    else /* len == 0 */
+    {
+	 Perl_sv_catpv(aTHX_ sv,"000");
+    }
+    return sv;
+}
+
+/*
+=for apidoc vnormal
+
+Accepts a version object and returns the normalized string
+representation.  Call like:
+
+    sv = vnormal(rv);
+
+NOTE: you can pass either the object directly or the SV
+contained within the RV.
+
+=cut
+*/
+
+SV *
+Perl_vnormal(pTHX_ SV *vs)
+{
+    I32 i, len, digit;
+    SV *sv = newSV(0);
+    if ( SvROK(vs) )
+	vs = SvRV(vs);
+    len = av_len((AV *)vs);
+    if ( len == -1 )
+    {
+	Perl_sv_catpv(aTHX_ sv,"");
+	return sv;
+    }
+    digit = SvIVX(*av_fetch((AV *)vs, 0, 0));
+    Perl_sv_setpvf(aTHX_ sv,"%"IVdf,(IV)digit);
+    for ( i = 1 ; i <= len ; i++ )
+    {
+	digit = SvIVX(*av_fetch((AV *)vs, i, 0));
+	if ( digit < 0 )
+	    Perl_sv_catpvf(aTHX_ sv,"_%"IVdf,(IV)-digit);
+	else
+	    Perl_sv_catpvf(aTHX_ sv,".%"IVdf,(IV)digit);
+    }
+    
+    if ( len <= 2 ) { /* short version, must be at least three */
+	for ( len = 2 - len; len != 0; len-- )
+	    Perl_sv_catpv(aTHX_ sv,".0");
+    }
+
+    return sv;
+} 
+
+/*
+=for apidoc vstringify
+
+In order to maintain maximum compatibility with earlier versions
+of Perl, this function will return either the floating point
+notation or the multiple dotted notation, depending on whether
+the original version contained 1 or more dots, respectively
+
+=cut
+*/
+
+SV *
+Perl_vstringify(pTHX_ SV *vs)
+{
+    I32 i, len, digit;
+    if ( SvROK(vs) )
+	vs = SvRV(vs);
+    len = av_len((AV *)vs);
+    
+    if ( len < 2 )
+	return vnumify(vs);
+    else
+	return vnormal(vs);
+}
+
+/*
+=for apidoc vcmp
+
+Version object aware cmp.  Both operands must already have been 
+converted into version objects.
+
+=cut
+*/
+
+int
+Perl_vcmp(pTHX_ SV *lsv, SV *rsv)
+{
+    I32 i,l,m,r,retval;
+    if ( SvROK(lsv) )
+	lsv = SvRV(lsv);
+    if ( SvROK(rsv) )
+	rsv = SvRV(rsv);
+    l = av_len((AV *)lsv);
+    r = av_len((AV *)rsv);
+    m = l < r ? l : r;
+    retval = 0;
+    i = 0;
+    while ( i <= m && retval == 0 )
+    {
+	I32 left  = SvIV(*av_fetch((AV *)lsv,i,0));
+	I32 right = SvIV(*av_fetch((AV *)rsv,i,0));
+	bool lalpha = left  < 0 ? 1 : 0;
+	bool ralpha = right < 0 ? 1 : 0;
+	left  = abs(left);
+	right = abs(right);
+	if ( left < right || (left == right && lalpha && !ralpha) )
+	    retval = -1;
+	if ( left > right || (left == right && ralpha && !lalpha) )
+	    retval = +1;
+	i++;
+    }
+
+    if ( l != r && retval == 0 ) /* possible match except for trailing 0's */
+    {
+	if ( l < r )
+	{
+	    while ( i <= r && retval == 0 )
+	    {
+		if ( SvIV(*av_fetch((AV *)rsv,i,0)) != 0 )
+		    retval = -1; /* not a match after all */
+		i++;
+	    }
+	}
+	else
+	{
+	    while ( i <= l && retval == 0 )
+	    {
+		if ( SvIV(*av_fetch((AV *)lsv,i,0)) != 0 )
+		    retval = +1; /* not a match after all */
+		i++;
+	    }
+	}
+    }
+    return retval;
+}

Added: trunk/orca/packages/version-0.39/util.h
==============================================================================
--- (empty file)
+++ trunk/orca/packages/version-0.39/util.h	Sat Jun  5 23:02:34 2004
@@ -0,0 +1,28 @@
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+#include "ppport.h"
+
+#ifndef PERL_ABS
+#define PERL_ABS(x) ((x) < 0 ? -(x) : (x))
+#endif
+
+#ifndef SVf
+#define SVf "_"
+#endif
+
+char * Perl_scan_version(pTHX_ char *s, SV *rv, bool qv);
+SV * Perl_new_version(pTHX_ SV *ver);
+SV * Perl_upg_version(pTHX_ SV *sv);
+SV * Perl_vnumify(pTHX_ SV *vs);
+SV * Perl_vnormal(pTHX_ SV *vs);
+SV * Perl_vstringify(pTHX_ SV *vs);
+int Perl_vcmp(pTHX_ SV *lsv, SV *rsv);
+
+#define vnumify(a)		Perl_vnumify(aTHX_ a)
+#define vnormal(a)		Perl_vnormal(aTHX_ a)
+#define vstringify(a)		Perl_vstringify(aTHX_ a)
+#define vcmp(a,b)		Perl_vcmp(aTHX_ a,b)
+#define scan_version(a,b,c)	Perl_scan_version(aTHX_ a,b,c)
+#define new_version(a)		Perl_new_version(aTHX_ a)
+#define upg_version(a)		Perl_upg_version(aTHX_ a)

Added: trunk/orca/packages/version-0.39/version.xs
==============================================================================
--- (empty file)
+++ trunk/orca/packages/version-0.39/version.xs	Sat Jun  5 23:02:34 2004
@@ -0,0 +1,237 @@
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+#include "util.h"
+
+/* --------------------------------------------------
+ * $Revision: 2.5 $
+ * --------------------------------------------------*/
+
+typedef     SV *version;
+
+MODULE = version	PACKAGE = version
+
+PROTOTYPES: DISABLE
+VERSIONCHECK: DISABLE
+
+BOOT:
+	/* register the overloading (type 'A') magic */
+	PL_amagic_generation++;
+	newXS("version::()", XS_version_noop, file);
+	newXS("version::(\"\"", XS_version_stringify, file);
+	newXS("version::(0+", XS_version_numify, file);
+	newXS("version::(cmp", XS_version_vcmp, file);
+	newXS("version::(<=>", XS_version_vcmp, file);
+	newXS("version::(bool", XS_version_boolean, file);
+	newXS("version::(nomethod", XS_version_noop, file);
+	newXS("UNIVERSAL::VERSION", XS_version_VERSION, file);
+
+version
+new(class,...)
+    char *class
+PPCODE:
+{
+    SV *vs = ST(1);
+    SV *rv;
+    if (items == 3 )
+    {
+	STRLEN n_a;
+	vs = sv_newmortal();
+	sv_setpvf(vs,"v%s",SvPV(ST(2),n_a));
+    }
+
+    rv = new_version(vs);
+    if ( strcmp(class,"version") != 0 ) /* inherited new() */
+	sv_bless(rv, gv_stashpv(class,TRUE));
+
+    PUSHs(sv_2mortal(rv));
+}
+
+void
+stringify (lobj,...)
+    version		lobj
+PPCODE:
+{
+    PUSHs(sv_2mortal(vstringify(lobj)));
+}
+
+void
+numify (lobj,...)
+    version		lobj
+PPCODE:
+{
+    PUSHs(sv_2mortal(vnumify(lobj)));
+}
+
+void
+vcmp (lobj,...)
+    version		lobj
+PPCODE:
+{
+    SV	*rs;
+    SV	*rvs;
+    SV * robj = ST(1);
+    IV	 swap = (IV)SvIV(ST(2));
+
+    if ( ! sv_derived_from(robj, "version") )
+    {
+	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		lobj
+PPCODE:
+{
+    SV	*rs;
+    rs = newSViv( vcmp(lobj,new_version(newSVpvn("0",1))) );
+    PUSHs(sv_2mortal(rs));
+}
+
+void
+noop(lobj,...)
+    version		lobj
+CODE:
+{
+    Perl_croak(aTHX_ "operation not supported with version object");
+}
+
+void
+is_alpha(lobj)
+    version		lobj	
+PPCODE:
+{
+    AV * av = (AV *)SvRV(lobj);
+    I32 len = av_len(av);
+    I32 digit = SvIVX(*av_fetch(av, len, 0));
+    if ( digit < 0 )
+	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"))
+	    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")) {
+	    /* 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 ( sv_derived_from(sv, "version") )
+	PUSHs(vnumify(sv));
+    else
+	PUSHs(sv);
+
+    XSRETURN(1);
+}



More information about the Orca-checkins mailing list