You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by rs...@apache.org on 2020/03/02 08:28:01 UTC
[avro] branch master updated: AVRO-1461: Distribute Perl API on
CPAN (#824)
This is an automated email from the ASF dual-hosted git repository.
rskraba pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git
The following commit(s) were added to refs/heads/master by this push:
new 9741c08 AVRO-1461: Distribute Perl API on CPAN (#824)
9741c08 is described below
commit 9741c08ae2ffe06adbf3559b5c5702d9bf8cae3c
Author: Kengo Seki <se...@apache.org>
AuthorDate: Mon Mar 2 17:27:54 2020 +0900
AVRO-1461: Distribute Perl API on CPAN (#824)
Thanks so much!
---
lang/perl/MANIFEST | 1 +
lang/perl/Makefile.PL | 8 +++++++-
lang/perl/build.sh | 8 +-------
lang/perl/lib/Avro/BinaryDecoder.pm | 2 ++
lang/perl/lib/Avro/BinaryEncoder.pm | 2 ++
lang/perl/lib/Avro/DataFile.pm | 2 ++
lang/perl/lib/Avro/DataFileReader.pm | 2 ++
lang/perl/lib/Avro/DataFileWriter.pm | 2 ++
lang/perl/lib/Avro/Protocol.pm | 2 ++
lang/perl/lib/Avro/Protocol/Message.pm | 2 ++
lang/perl/lib/Avro/Schema.pm | 2 ++
11 files changed, 25 insertions(+), 8 deletions(-)
diff --git a/lang/perl/MANIFEST b/lang/perl/MANIFEST
index d308e85..bc8f934 100644
--- a/lang/perl/MANIFEST
+++ b/lang/perl/MANIFEST
@@ -41,6 +41,7 @@ META.yml
LICENSE
NOTICE
README
+VERSION.txt
t/00_compile.t
t/01_names.t
t/01_schema.t
diff --git a/lang/perl/Makefile.PL b/lang/perl/Makefile.PL
index 8eb7380..751fc33 100644
--- a/lang/perl/Makefile.PL
+++ b/lang/perl/Makefile.PL
@@ -18,7 +18,13 @@
use Config;
use inc::Module::Install;
-my $version = `cat ../../share/VERSION.txt`;
+my $version;
+for ('VERSION.txt', '../../share/VERSION.txt') {
+ if (-f) {
+ $version = `cat $_`;
+ last;
+ }
+}
chomp $version;
license 'apache';
diff --git a/lang/perl/build.sh b/lang/perl/build.sh
index 107c16f..2b68927 100755
--- a/lang/perl/build.sh
+++ b/lang/perl/build.sh
@@ -27,13 +27,6 @@ then
usage
fi
-if [ -f VERSION.txt ]
-then
- VERSION=`cat VERSION.txt`
-else
- VERSION=`cat ../../share/VERSION.txt`
-fi
-
for target in "$@"
do
@@ -65,6 +58,7 @@ case "$target" in
;;
dist)
+ cp ../../share/VERSION.txt .
perl ./Makefile.PL && make dist
;;
diff --git a/lang/perl/lib/Avro/BinaryDecoder.pm b/lang/perl/lib/Avro/BinaryDecoder.pm
index 5dc02b5..c5308f2 100644
--- a/lang/perl/lib/Avro/BinaryDecoder.pm
+++ b/lang/perl/lib/Avro/BinaryDecoder.pm
@@ -24,6 +24,8 @@ use Encode();
use Error::Simple;
use Avro::Schema;
+our $VERSION = '++MODULE_VERSION++';
+
our $complement = ~0x7F;
unless ($Config{use64bitint}) {
require Math::BigInt;
diff --git a/lang/perl/lib/Avro/BinaryEncoder.pm b/lang/perl/lib/Avro/BinaryEncoder.pm
index c1340a1..f47abd1 100644
--- a/lang/perl/lib/Avro/BinaryEncoder.pm
+++ b/lang/perl/lib/Avro/BinaryEncoder.pm
@@ -24,6 +24,8 @@ use Encode();
use Error::Simple;
use Regexp::Common qw(number);
+our $VERSION = '++MODULE_VERSION++';
+
our $max64;
our $complement = ~0x7F;
if ($Config{use64bitint}) {
diff --git a/lang/perl/lib/Avro/DataFile.pm b/lang/perl/lib/Avro/DataFile.pm
index df91ea2..ac3e6da 100644
--- a/lang/perl/lib/Avro/DataFile.pm
+++ b/lang/perl/lib/Avro/DataFile.pm
@@ -23,6 +23,8 @@ use constant AVRO_MAGIC => "Obj\x01";
use Avro::Schema;
+our $VERSION = '++MODULE_VERSION++';
+
our $HEADER_SCHEMA = Avro::Schema->parse(<<EOH);
{"type": "record", "name": "org.apache.avro.file.Header",
"fields" : [
diff --git a/lang/perl/lib/Avro/DataFileReader.pm b/lang/perl/lib/Avro/DataFileReader.pm
index fde5dc8..a51b159 100644
--- a/lang/perl/lib/Avro/DataFileReader.pm
+++ b/lang/perl/lib/Avro/DataFileReader.pm
@@ -39,6 +39,8 @@ use Compress::Zstd;
use IO::Uncompress::RawInflate ;
use Fcntl();
+our $VERSION = '++MODULE_VERSION++';
+
sub new {
my $class = shift;
my $datafile = $class->SUPER::new(@_);
diff --git a/lang/perl/lib/Avro/DataFileWriter.pm b/lang/perl/lib/Avro/DataFileWriter.pm
index 4ab9f8d..74c5388 100644
--- a/lang/perl/lib/Avro/DataFileWriter.pm
+++ b/lang/perl/lib/Avro/DataFileWriter.pm
@@ -39,6 +39,8 @@ use Compress::Zstd;
use Error::Simple;
use IO::Compress::RawDeflate qw(rawdeflate $RawDeflateError);
+our $VERSION = '++MODULE_VERSION++';
+
sub new {
my $class = shift;
my $datafile = $class->SUPER::new(@_);
diff --git a/lang/perl/lib/Avro/Protocol.pm b/lang/perl/lib/Avro/Protocol.pm
index a4797d8..ca892bc 100644
--- a/lang/perl/lib/Avro/Protocol.pm
+++ b/lang/perl/lib/Avro/Protocol.pm
@@ -33,6 +33,8 @@ use Object::Tiny qw{
messages
};
+our $VERSION = '++MODULE_VERSION++';
+
my $json = JSON::XS->new->allow_nonref;
sub parse {
diff --git a/lang/perl/lib/Avro/Protocol/Message.pm b/lang/perl/lib/Avro/Protocol/Message.pm
index 81315df..23da807 100644
--- a/lang/perl/lib/Avro/Protocol/Message.pm
+++ b/lang/perl/lib/Avro/Protocol/Message.pm
@@ -31,6 +31,8 @@ use Object::Tiny qw{
errors
};
+our $VERSION = '++MODULE_VERSION++';
+
sub new {
my $class = shift;
my $struct = shift;
diff --git a/lang/perl/lib/Avro/Schema.pm b/lang/perl/lib/Avro/Schema.pm
index 1ecf5ee..356c5ba 100644
--- a/lang/perl/lib/Avro/Schema.pm
+++ b/lang/perl/lib/Avro/Schema.pm
@@ -23,6 +23,8 @@ use Carp;
use JSON::XS();
use Try::Tiny;
+our $VERSION = '++MODULE_VERSION++';
+
my $json = JSON::XS->new->allow_nonref;
sub parse {