Hello community, here is the log from the commit of package perl-YAML-Syck for openSUSE:Factory checked in at Mon Sep 6 17:34:15 CEST 2010. -------- --- perl-YAML-Syck/perl-YAML-Syck.changes 2010-08-17 21:55:22.000000000 +0200 +++ perl-YAML-Syck/perl-YAML-Syck.changes 2010-08-31 00:51:26.000000000 +0200 @@ -1,0 +2,13 @@ +Mon Aug 30 22:51:10 UTC 2010 - chris@computersalat.de + +- recreated by cpanspec 1.78 + o obviously destructed + +------------------------------------------------------------------- +Fri Aug 27 00:25:55 UTC 2010 - pascal.bleser@opensuse.org + +- update to 1.14: + * RT RT60771 - quoted negative integer and quoted zeroes; + this was breaking JSON since "0" is true in javascript + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- YAML-Syck-1.12.tar.bz2 New: ---- YAML-Syck-1.14.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-YAML-Syck.spec ++++++ --- /var/tmp/diff_new_pack.DuLGiK/_old 2010-09-06 17:33:30.000000000 +0200 +++ /var/tmp/diff_new_pack.DuLGiK/_new 2010-09-06 17:33:30.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package perl-YAML-Syck (Version 1.12) +# spec file for package perl-YAML-Syck (Version 1.14) # # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -22,7 +22,7 @@ Name: perl-YAML-Syck %define cpan_name YAML-Syck Summary: Fast, lightweight YAML loader and dumper -Version: 1.12 +Version: 1.14 Release: 1 License: MIT Group: Development/Libraries/Perl @@ -46,6 +46,10 @@ This module provides a Perl interface to the libsyck data serialization library. It exports the Dump and Load functions for converting Perl data structures to YAML strings, and the other way around. +NOTE: If you are working with other language's YAML/Syck bindings (such as +Ruby), please set $YAML::Syck::ImplicitTyping to 1 before calling the +Load/Dump functions. The default setting is for preserving +backward-compatibility with YAML.pm. Authors: -------- @@ -53,17 +57,24 @@ %prep %setup -q -n %{cpan_name}-%{version} +%{__sed} -i '/^auto_install/d' Makefile.PL %build %{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="$RPM_OPT_FLAGS" %{__make} %{?_smp_mflags} %check +%if %{with opt} +AUTOMATED_TESTING=1 %{__make} test +%else %{__make} test +%endif %install %perl_make_install %perl_process_packlist +# remove zero sized *.bs files +find $RPM_BUILD_ROOT -type f -name '*.bs' -a -size 0 -exec rm -f {} \; %perl_gen_filelist %clean ++++++ YAML-Syck-1.12.tar.bz2 -> YAML-Syck-1.14.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-Syck-1.12/Changes new/YAML-Syck-1.14/Changes --- old/YAML-Syck-1.12/Changes 2010-08-04 19:21:44.000000000 +0200 +++ new/YAML-Syck-1.14/Changes 2010-08-26 22:34:29.000000000 +0200 @@ -1,6 +1,15 @@ +[Changes for 1.14 (YAML::Syck 0.37 ) - 2010-08-03] +* RT RT60771 - Further refactor for JSON. if a number is a valid + perl string, quote it. "1" + "1" = "11" in javascript. +* add YAML tests to make sure HEX and octal preserve their information + +[Changes for 1.13 (YAML::Syck 0.36 ) - 2010-08-03] +* RT RT60771 - quoted negative integer and quoted zeroes. + This was breaking JSON since "0" is true in javascript. + [Changes for 1.12 (YAML::Syck 0.35 ) - 2010-08-03] * The tie test proved to be very unstable for 5.8 and it's not - relevant for tie actually. I'm converting it to a TODO for now. + relevant for tie actually. I'm converting it to a TODO for [Changes for 1.11 (YAML::Syck 0.35 ) - 2010-08-03] * Tests are now stable. releasing 1.11 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-Syck-1.12/META.yml new/YAML-Syck-1.14/META.yml --- old/YAML-Syck-1.12/META.yml 2010-08-04 19:22:38.000000000 +0200 +++ new/YAML-Syck-1.14/META.yml 2010-08-26 22:38:30.000000000 +0200 @@ -25,4 +25,4 @@ homepage: http://search.cpan.org/dist/YAML-Syck license: http://opensource.org/licenses/mit-license.php repository: http://github.com/avar/YAML-Syck -version: 1.12 +version: 1.14 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-Syck-1.12/lib/JSON/Syck.pm new/YAML-Syck-1.14/lib/JSON/Syck.pm --- old/YAML-Syck-1.12/lib/JSON/Syck.pm 2010-07-29 23:25:44.000000000 +0200 +++ new/YAML-Syck-1.14/lib/JSON/Syck.pm 2010-08-26 22:34:39.000000000 +0200 @@ -5,7 +5,7 @@ use YAML::Syck (); BEGIN { - $VERSION = '0.35'; + $VERSION = '0.37'; @EXPORT_OK = qw( Load Dump LoadFile DumpFile ); @ISA = 'Exporter'; *Load = \&YAML::Syck::LoadJSON; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-Syck-1.12/lib/YAML/Syck.pm new/YAML-Syck-1.14/lib/YAML/Syck.pm --- old/YAML-Syck-1.12/lib/YAML/Syck.pm 2010-08-04 19:19:53.000000000 +0200 +++ new/YAML-Syck-1.14/lib/YAML/Syck.pm 2010-08-26 22:34:49.000000000 +0200 @@ -13,7 +13,7 @@ use Exporter; BEGIN { - $VERSION = '1.12'; + $VERSION = '1.14'; @EXPORT = qw( Dump Load DumpFile LoadFile ); @ISA = qw( Exporter ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-Syck-1.12/perl_syck.h new/YAML-Syck-1.14/perl_syck.h --- old/YAML-Syck-1.12/perl_syck.h 2010-07-29 23:23:53.000000000 +0200 +++ new/YAML-Syck-1.14/perl_syck.h 2010-08-26 21:44:58.000000000 +0200 @@ -982,6 +982,8 @@ /* emit a string */ STRLEN len = sv_len(sv); +/* JSON should preserve quotes even on simple integers ("0" is true in javascript) */ +#ifndef YAML_IS_JSON if (looks_like_number(sv)) { if(syck_str_is_unquotable_integer(SvPV_nolen(sv), sv_len(sv))) { /* emit an unquoted number only if it's a very basic integer. /^-?[1-9][0-9]*$/ */ @@ -992,7 +994,9 @@ syck_emit_scalar(e, OBJOF("str"), SCALAR_QUOTED, 0, 0, 0, SvPV_nolen(sv), len); } } - else if (len == 0) { + else +#endif + if (len == 0) { syck_emit_scalar(e, OBJOF("str"), SCALAR_QUOTED, 0, 0, 0, "", 0); } else if (IS_UTF8(sv)) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-Syck-1.12/syck_.c new/YAML-Syck-1.14/syck_.c --- old/YAML-Syck-1.12/syck_.c 2010-07-29 19:09:42.000000000 +0200 +++ new/YAML-Syck-1.14/syck_.c 2010-08-26 20:08:19.000000000 +0200 @@ -503,19 +503,20 @@ } int syck_str_is_unquotable_integer(char* str, long len) { - int idx; + int idx; - if(!str) return 0; /* Don't parse null strings */ - if(len < 1) return 0; /* empty strings can't be numbers */ - if(len > 9) return 0; /* Ints larger than 9 digits (32bit) might not portable. Force a string. */ + if(!str) return 0; /* Don't parse null strings */ + if(len < 1) return 0; /* empty strings can't be numbers */ + if(len > 9) return 0; /* Ints larger than 9 digits (32bit) might not portable. Force a string. */ - if(str[0] == '-' && (len < 2 || str[1] > '9' || str[1] < '1')) return 0; - if(str[0] > '9' || str[0] < '1') return 0; + if(str[0] == '0' && len == 1) return 1; /* 0 is unquoted. */ + if(str[0] == '-') {str++; len --;} /* supress the leading '-' sign if detected for testing purposes only. */ + if(str[0] == '0') return 0; /* Octals need to be quoted or you lose data converting them to an integer. This also accidentally blocks -0 which probably needs to be quoted. */ - /* Look for illegal characters */ - for ( idx = 1; idx < len; idx++ ) { - if(!isdigit(str[idx])) return 0; - } + /* Look for illegal characters */ + for ( idx = 1; idx < len; idx++ ) { + if(!isdigit(str[idx])) return 0; + } - return 1; + return 1; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-Syck-1.12/t/2-scalars.t new/YAML-Syck-1.14/t/2-scalars.t --- old/YAML-Syck-1.12/t/2-scalars.t 2010-07-29 23:23:53.000000000 +0200 +++ new/YAML-Syck-1.14/t/2-scalars.t 2010-08-26 22:37:10.000000000 +0200 @@ -1,4 +1,4 @@ -use t::TestYAML tests => 121; +use t::TestYAML tests => 134; ok(YAML::Syck->VERSION); @@ -228,6 +228,19 @@ roundtrip($_); } +# Simple integers dump without quotes +foreach (1, 2, 3, 0, -1, -2, -3) { + is(Dump($_), "--- $_\n", "Dumped version of file is unquoted"); +} + +is(Dump('0x10'), "--- 0x10\n", "hex Dump preserves as string"); +is(Load("--- '0x10'\n"), "0x10", "hex Load preserves as string"); + +is(Dump('080'), "--- '080'\n", "oct Dump preserves by quoting"); +is(Load("--- '080'\n"), "080", "oct Load preserves by quoting"); + +is(Dump('00'), "--- '00'\n", "00 Dump preserves by quoting"); +is(Load("--- '00'\n"), "00", "00 Load preserves by quoting"); # RT 54780 - double quoted loading style diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/YAML-Syck-1.12/t/json-numbers.t new/YAML-Syck-1.14/t/json-numbers.t --- old/YAML-Syck-1.12/t/json-numbers.t 2010-07-19 19:09:16.000000000 +0200 +++ new/YAML-Syck-1.14/t/json-numbers.t 2010-08-26 22:20:49.000000000 +0200 @@ -1,14 +1,14 @@ -use Test::More tests => 10; +use Test::More tests => 53; use JSON::Syck qw(Dump); my @arr1 = sort {$a cmp $b} qw/1 2 54 howdy/; -is(Dump(\@arr1), '[1,2,54,"howdy"]', "cmp sort doesn't coerce numbers into strings"); +is(Dump(\@arr1), '["1","2","54","howdy"]', "cmp sort causes numbers to coerce into strings and thus be quoted."); { no warnings "numeric"; my @arr2 = sort {$a <=> $b} qw/1 2 54 howdy/; - is(Dump(\@arr2), '["howdy",1,2,54]', "Numeric sort doesn't coerce non-numeric strings into numbers"); + is(Dump(\@arr2), '["howdy","1","2","54"]', "Numeric sort doesn't coerce non-numeric strings into numbers because they still contain their valid string"); } my @arr54 = ("howdy",1,2,54); @@ -21,5 +21,12 @@ is(Dump('1,000,000'), '"1,000,000"', "numbers with commas get quoted."); is(Dump('1e+6'), '"1e+6"', "Scientific notation gets quoted."); is(Dump('10e+6'), '"10e+6"', "Scientific notation gets quoted."); +is(Dump('0123'), '"0123"', "Scientific notation gets quoted."); - +# for simple integers, we need to preserve their string state as perl knows it if possible. +# JSON overloaded + for string concatenation. This means you get all sorts of wierdness if we try to strip quotes on strings not IVs +# "0" is true 0 is false. 1 + 1 = 2 but "1" + "1" = "11" +for(-10..10) { + is(Dump($_), $_, '"0" != 0 in JSON. 0 is false "0" is true.'); + is(Dump("$_"), "\"$_\"", 'Strigified integer is stringified in JSON'); +} ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org