forked from pool/perl-SQL-Translator
- updated to 0.11016
* Allow passing an arrayref to SQLT->filename (lost in Mooification) * Fix stupid missing version number in SQL::Translator::Schema::Object * Relicense under Perl 5 terms * Remove SQL::Translator::Schema::Graph as announced in 0.11011 * Remove a number of no longer needed deps * Fix missing dep (List::MoreUtils) * Convert SQL::Translator, ::Schema and ::Schema::* to Moo * Fix leaks by weakening circular references between schema objects * Make MySQL producer add NULL after every nullable field, conforming to SQL standard, and avoiding MySQL bugs - remove sqlite.patch which was declined upstream OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-SQL-Translator?expand=0&rev=11
This commit is contained in:
committed by
Git OBS Bridge
parent
2a832aad19
commit
15f4918d59
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e5b39a88ef2c5e3bb0669d6e581247f0784a6a6e5db326163daf687e5ae5f109
|
||||
size 415743
|
3
SQL-Translator-0.11016.tar.gz
Normal file
3
SQL-Translator-0.11016.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:be7e63537ec13c2e5f6b82701878ae5bb03b33209e0cd8208b0a1b93f3cb9493
|
||||
size 421466
|
@@ -1,3 +1,19 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Jul 30 05:02:28 UTC 2013 - coolo@suse.com
|
||||
|
||||
- updated to 0.11016
|
||||
* Allow passing an arrayref to SQLT->filename (lost in Mooification)
|
||||
* Fix stupid missing version number in SQL::Translator::Schema::Object
|
||||
* Relicense under Perl 5 terms
|
||||
* Remove SQL::Translator::Schema::Graph as announced in 0.11011
|
||||
* Remove a number of no longer needed deps
|
||||
* Fix missing dep (List::MoreUtils)
|
||||
* Convert SQL::Translator, ::Schema and ::Schema::* to Moo
|
||||
* Fix leaks by weakening circular references between schema objects
|
||||
* Make MySQL producer add NULL after every nullable field, conforming to SQL
|
||||
standard, and avoiding MySQL bugs
|
||||
- remove sqlite.patch which was declined upstream
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jan 11 13:12:42 UTC 2012 - cfarrell@suse.com
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package perl-SQL-Translator
|
||||
#
|
||||
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -15,64 +15,74 @@
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
Name: perl-SQL-Translator
|
||||
Version: 0.11016
|
||||
Release: 0
|
||||
%define cpan_name SQL-Translator
|
||||
Summary: Manipulate structured data definitions (SQL and more)
|
||||
License: GPL-2.0
|
||||
License: Artistic-1.0 or GPL-1.0+
|
||||
Group: Development/Libraries/Perl
|
||||
Version: 0.11010
|
||||
Release: 0
|
||||
Patch1: sqlite.patch
|
||||
%{perl_requires}
|
||||
Url: http://search.cpan.org/dist/SQL-Translator/
|
||||
Source: http://www.cpan.org/authors/id/J/JR/JROBINSON/%{cpan_name}-%{version}.tar.gz
|
||||
Source: http://www.cpan.org/authors/id/F/FR/FREW/%{cpan_name}-%{version}.tar.gz
|
||||
BuildArch: noarch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildRequires: perl
|
||||
BuildRequires: perl-macros
|
||||
BuildRequires: perl(Carp::Clan)
|
||||
BuildRequires: perl(Class::Accessor::Fast)
|
||||
BuildRequires: perl(Class::Base)
|
||||
BuildRequires: perl(Class::Data::Inheritable) >= 0.02
|
||||
BuildRequires: perl(Class::MakeMethods)
|
||||
BuildRequires: perl(DBI)
|
||||
BuildRequires: perl(Digest::SHA1) >= 2
|
||||
BuildRequires: perl(File::ShareDir) >= 1
|
||||
BuildRequires: perl(IO::Scalar) >= 2.11
|
||||
BuildRequires: perl(Moo) >= 0.009007
|
||||
BuildRequires: perl(Parse::RecDescent) >= 1.962002
|
||||
BuildRequires: perl(Digest::SHA)
|
||||
BuildRequires: perl(File::ShareDir) >= 1.0
|
||||
BuildRequires: perl(List::MoreUtils) >= 0.09
|
||||
BuildRequires: perl(Moo) >= 1.000003
|
||||
BuildRequires: perl(Package::Variant) >= 1.001001
|
||||
BuildRequires: perl(Parse::RecDescent) >= 1.967009
|
||||
BuildRequires: perl(Sub::Quote)
|
||||
BuildRequires: perl(Test::Differences)
|
||||
BuildRequires: perl(Test::Exception)
|
||||
BuildRequires: perl(XML::Writer) >= 0.5
|
||||
BuildRequires: perl(Test::Exception) >= 0.31
|
||||
BuildRequires: perl(Test::More) >= 0.88
|
||||
BuildRequires: perl(Try::Tiny) >= 0.04
|
||||
BuildRequires: perl(XML::Writer) >= 0.500
|
||||
BuildRequires: perl(YAML) >= 0.66
|
||||
Requires: perl(Carp::Clan)
|
||||
Requires: perl(Class::Accessor::Fast)
|
||||
Requires: perl(Class::Base)
|
||||
Requires: perl(Class::Data::Inheritable) >= 0.02
|
||||
Requires: perl(Class::MakeMethods)
|
||||
Requires: perl(DBI)
|
||||
Requires: perl(Digest::SHA1) >= 2
|
||||
Requires: perl(File::ShareDir) >= 1
|
||||
Requires: perl(IO::Scalar) >= 2.11
|
||||
Requires: perl(Moo) >= 0.009007
|
||||
Requires: perl(Parse::RecDescent) >= 1.962002
|
||||
Requires: perl(XML::Writer) >= 0.5
|
||||
Requires: perl(Digest::SHA)
|
||||
Requires: perl(File::ShareDir) >= 1.0
|
||||
Requires: perl(List::MoreUtils) >= 0.09
|
||||
Requires: perl(Moo) >= 1.000003
|
||||
Requires: perl(Package::Variant) >= 1.001001
|
||||
Requires: perl(Parse::RecDescent) >= 1.967009
|
||||
Requires: perl(Sub::Quote)
|
||||
Requires: perl(Try::Tiny) >= 0.04
|
||||
Recommends: perl(GD)
|
||||
Recommends: perl(Graph::Directed)
|
||||
Recommends: perl(GraphViz)
|
||||
Recommends: perl(Spreadsheet::ParseExcel) >= 0.41
|
||||
Recommends: perl(Template) >= 2.2
|
||||
Recommends: perl(Template) >= 2.20
|
||||
Recommends: perl(Text::RecordParser) >= 0.02
|
||||
Recommends: perl(XML::LibXML) >= 1.69
|
||||
%{perl_requires}
|
||||
|
||||
%description
|
||||
This documentation covers the API for SQL::Translator. For a more general
|
||||
discussion of how to use the modules and scripts, please see
|
||||
SQL::Translator::Manual.
|
||||
discussion of how to use the modules and scripts, please see the
|
||||
SQL::Translator::Manual manpage.
|
||||
|
||||
SQL::Translator is a group of Perl modules that converts vendor-specific
|
||||
SQL table definitions into other formats, such as other vendor-specific
|
||||
SQL, ER diagrams, documentation (POD and HTML), XML, and Class::DBI
|
||||
classes. The main focus of SQL::Translator is SQL, but parsers exist for
|
||||
other structured data formats, including Excel spreadsheets and arbitrarily
|
||||
delimited text files. Through the separation of the code into parsers and
|
||||
producers with an object model in between, it's possible to combine any
|
||||
parser with any producer, to plug in custom parsers or producers, or to
|
||||
manipulate the parsed data via the built-in object model. Presently only
|
||||
the definition parts of SQL are handled (CREATE, ALTER), not the
|
||||
manipulation of data (INSERT, UPDATE, DELETE).
|
||||
|
||||
%prep
|
||||
%setup -q -n %{cpan_name}-%{version}
|
||||
%patch1 -p1
|
||||
find . -type f -print0 | xargs -0 chmod 644
|
||||
|
||||
%build
|
||||
%{__perl} Makefile.PL INSTALLDIRS=vendor
|
||||
@@ -83,22 +93,11 @@ SQL::Translator::Manual.
|
||||
|
||||
%install
|
||||
%perl_make_install
|
||||
# do not perl_process_packlist (noarch)
|
||||
# remove .packlist file
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%perl_vendorarch
|
||||
# remove perllocal.pod file
|
||||
%{__rm} -rf $RPM_BUILD_ROOT%perl_archlib
|
||||
%perl_process_packlist
|
||||
%perl_gen_filelist
|
||||
## fix for checking filelist
|
||||
# auto directory is included in the perl package
|
||||
EXP=$(echo %perl_vendorlib/auto | %{__sed} -e "s@/@\\\/@g")
|
||||
%{__sed} -i -e "/%dir\ $EXP$/d" %{name}.files
|
||||
|
||||
%clean
|
||||
%{__rm} -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files -f %{name}.files
|
||||
%defattr(-,root,root,-)
|
||||
%doc AUTHORS BUGS Changes LICENSE README
|
||||
%defattr(-,root,root,755)
|
||||
%doc Changes README
|
||||
|
||||
%changelog
|
||||
|
117
sqlite.patch
117
sqlite.patch
@@ -1,117 +0,0 @@
|
||||
Index: SQL-Translator-0.11010/lib/SQL/Translator/Parser/SQLite.pm
|
||||
===================================================================
|
||||
--- SQL-Translator-0.11010.orig/lib/SQL/Translator/Parser/SQLite.pm 2011-05-04 18:06:57.000000000 +0200
|
||||
+++ SQL-Translator-0.11010/lib/SQL/Translator/Parser/SQLite.pm 2012-01-11 11:15:24.015300217 +0100
|
||||
@@ -190,6 +190,7 @@ eofile : /^\Z/
|
||||
statement : begin_transaction
|
||||
| commit
|
||||
| drop
|
||||
+ | insert
|
||||
| comment
|
||||
| create
|
||||
| <error>
|
||||
@@ -198,9 +199,14 @@ begin_transaction : /begin/i TRANSACTION
|
||||
|
||||
commit : /commit/i SEMICOLON
|
||||
|
||||
+##
|
||||
+## FIXME: I'd like to skip over INSERT statements.
|
||||
+## This does not appear to work.
|
||||
+insert : /^insert\s+into.*/i SEMICOLON
|
||||
+
|
||||
drop : /drop/i (tbl_drop | view_drop | trg_drop) SEMICOLON
|
||||
|
||||
-tbl_drop: TABLE <commit> table_name
|
||||
+tbl_drop: TABLE if_exists(?) <commit> table_name
|
||||
|
||||
view_drop: VIEW if_exists(?) view_name
|
||||
|
||||
@@ -250,16 +256,17 @@ create : CREATE TEMPORARY(?) UNIQUE(?) I
|
||||
#
|
||||
# Create Table
|
||||
#
|
||||
-create : CREATE TEMPORARY(?) TABLE table_name '(' definition(s /,/) ')' SEMICOLON
|
||||
+create : CREATE TEMPORARY(?) TABLE if_not_exists(?) table_name '(' definition(s /,(\s*\-\-.*?\n)?/) comment(?) ')' SEMICOLON
|
||||
{
|
||||
- my $db_name = $item[4]->{'db_name'} || '';
|
||||
- my $table_name = $item[4]->{'name'};
|
||||
+ my $db_name = $item[5]->{'db_name'} || '';
|
||||
+ my $table_name = $item[5]->{'name'};
|
||||
|
||||
$tables{ $table_name }{'name'} = $table_name;
|
||||
$tables{ $table_name }{'is_temporary'} = $item[2][0] ? 1 : 0;
|
||||
$tables{ $table_name }{'order'} = ++$table_order;
|
||||
|
||||
- for my $def ( @{ $item[6] } ) {
|
||||
+ for my $def ( @{ $item[7] } ) {
|
||||
+ next unless ref $def; # a comment
|
||||
if ( $def->{'supertype'} eq 'column' ) {
|
||||
push @{ $tables{ $table_name }{'fields'} }, $def;
|
||||
}
|
||||
@@ -460,7 +467,7 @@ field_name : NAME
|
||||
|
||||
constraint_name : NAME
|
||||
|
||||
-conflict_clause : /on conflict/i conflict_algorigthm
|
||||
+conflict_clause : /on\s+conflict/i conflict_algorigthm
|
||||
|
||||
conflict_algorigthm : /(rollback|abort|fail|ignore|replace)/i
|
||||
|
||||
@@ -509,7 +516,7 @@ create : CREATE TEMPORARY(?) TRIGGER NAM
|
||||
|
||||
database_event : /(delete|insert|update)/i
|
||||
|
||||
-database_event : /update of/i column_list
|
||||
+database_event : /update\s+of/i column_list
|
||||
|
||||
trigger_action : for_each(?) when(?) BEGIN_C trigger_step(s) END_C
|
||||
{
|
||||
@@ -520,7 +527,7 @@ trigger_action : for_each(?) when(?) BEG
|
||||
}
|
||||
}
|
||||
|
||||
-for_each : /FOR EACH ROW/i
|
||||
+for_each : /FOR\s+EACH\s+ROW/i
|
||||
|
||||
when : WHEN expr { $item[2] }
|
||||
|
||||
@@ -538,9 +545,11 @@ trigger_step : /(select|delete|insert|up
|
||||
|
||||
before_or_after : /(before|after)/i { $return = lc $1 }
|
||||
|
||||
-instead_of : /instead of/i
|
||||
+instead_of : /instead\s+of/i
|
||||
+
|
||||
+if_exists : /if\s+exists/i
|
||||
|
||||
-if_exists : /if exists/i
|
||||
+if_not_exists : /if\s+not\s+exists/i
|
||||
|
||||
view_name : qualified_name
|
||||
|
||||
@@ -580,9 +589,9 @@ TABLE : /table/i
|
||||
|
||||
INDEX : /index/i
|
||||
|
||||
-NOT_NULL : /not null/i
|
||||
+NOT_NULL : /not\s+null/i
|
||||
|
||||
-PRIMARY_KEY : /primary key/i
|
||||
+PRIMARY_KEY : /primary\s+key/i
|
||||
|
||||
FOREIGN_KEY : /foreign key/i
|
||||
|
||||
Index: SQL-Translator-0.11010/t/60roundtrip.t
|
||||
===================================================================
|
||||
--- SQL-Translator-0.11010.orig/t/60roundtrip.t 2011-05-04 18:06:57.000000000 +0200
|
||||
+++ SQL-Translator-0.11010/t/60roundtrip.t 2012-01-11 11:15:24.016300169 +0100
|
||||
@@ -209,6 +209,9 @@ sub check_roundtrip {
|
||||
return;
|
||||
};
|
||||
|
||||
+ # FIXME: the comment stripping in SQLite.pm does not agree with the test suite here.
|
||||
+ $base_out =~ s/^\s*\-\- Hello emptytagdef\s*\n//m if $args->{name} eq 'SQLite';
|
||||
+
|
||||
# the two sql strings should be identical
|
||||
my $msg = "$args->{name} SQL roundtrip successful - SQL statements match";
|
||||
$ENV{SQLTTEST_RT_DEBUG} #stringify below because IO::Scalar does not behave nice
|
Reference in New Issue
Block a user