Hello community,
here is the log from the commit of package perl-Mac-PropertyList for
openSUSE:Factory checked in at 2013-10-06 14:54:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Mac-PropertyList (Old)
and /work/SRC/openSUSE:Factory/.perl-Mac-PropertyList.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Mac-PropertyList"
Changes:
--------
---
/work/SRC/openSUSE:Factory/perl-Mac-PropertyList/perl-Mac-PropertyList.changes
2013-06-06 15:26:29.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.perl-Mac-PropertyList.new/perl-Mac-PropertyList.changes
2013-10-06 14:54:21.000000000 +0200
@@ -1,0 +2,9 @@
+Fri Oct 4 09:15:23 UTC 2013 - [email protected]
+
+- updated to 1.39
+ * Bump to full release
+ * Fix non-portable strftime format (RT #83460)
+ * Wim Lewis improved the binary reader / writer and made better
+ tests for it.
+
+-------------------------------------------------------------------
Old:
----
Mac-PropertyList-1.38.tar.gz
New:
----
Mac-PropertyList-1.39.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Mac-PropertyList.spec ++++++
--- /var/tmp/diff_new_pack.8MO5sB/_old 2013-10-06 14:54:22.000000000 +0200
+++ /var/tmp/diff_new_pack.8MO5sB/_new 2013-10-06 14:54:22.000000000 +0200
@@ -17,7 +17,7 @@
Name: perl-Mac-PropertyList
-Version: 1.38
+Version: 1.39
Release: 0
%define cpan_name Mac-PropertyList
Summary: Work with Mac plists at a low level
@@ -46,8 +46,8 @@
%description
This module is a low-level interface to the Mac OS X Property List (plist)
-format. You probably shouldn't use this in applications--build interfaces
-on top of this so you don't have to put all the heinous multi-level object
+format. You probably shouldn't use this in applications–build interfaces on
+top of this so you don't have to put all the heinous multi-level object
stuff where people have to look at it.
You can parse a plist file and get back a data structure. You can take that
++++++ Mac-PropertyList-1.38.tar.gz -> Mac-PropertyList-1.39.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mac-PropertyList-1.38/Changes
new/Mac-PropertyList-1.39/Changes
--- old/Mac-PropertyList-1.38/Changes 2012-10-23 22:45:08.000000000 +0200
+++ new/Mac-PropertyList-1.39/Changes 2013-09-27 22:28:46.000000000 +0200
@@ -2,6 +2,17 @@
* fix plist_as_perl to be the same as as_perl (and as
documented)
+1.39 - Fri Sep 27 16:28:21 2013
+ * Bump to full release
+ ��
+
+1.38_02 - Mon Sep 23 19:52:20 2013
+ * Fix non-portable strftime format (RT #83460)
+
+1.38_01 - Sun Feb 10 17:08:57 2013
+ * Wim Lewis improved the binary reader / writer and made better
+ tests for it.
+
1.38 - Tue Oct 23 15:44:26 2012
Wim Lewis <[email protected]> added WriteBinary. Great work!
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mac-PropertyList-1.38/MANIFEST
new/Mac-PropertyList-1.39/MANIFEST
--- old/Mac-PropertyList-1.38/MANIFEST 2012-10-23 22:45:09.000000000 +0200
+++ new/Mac-PropertyList-1.39/MANIFEST 2013-09-27 22:28:48.000000000 +0200
@@ -15,6 +15,7 @@
MYMETA.json
MYMETA.yml
plists/binary.plist
+plists/binary2.plist
plists/com.apple.iPhoto.plist
plists/com.apple.iTunes.plist
plists/com.apple.systempreferences.plist
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mac-PropertyList-1.38/META.json
new/Mac-PropertyList-1.39/META.json
--- old/Mac-PropertyList-1.38/META.json 2012-10-23 22:45:09.000000000 +0200
+++ new/Mac-PropertyList-1.39/META.json 2013-09-27 22:28:48.000000000 +0200
@@ -43,5 +43,5 @@
}
},
"release_status" : "stable",
- "version" : "1.38"
+ "version" : "1.39"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mac-PropertyList-1.38/META.yml
new/Mac-PropertyList-1.39/META.yml
--- old/Mac-PropertyList-1.38/META.yml 2012-10-23 22:45:09.000000000 +0200
+++ new/Mac-PropertyList-1.39/META.yml 2013-09-27 22:28:48.000000000 +0200
@@ -25,4 +25,4 @@
Time::Local: 0
XML::Entities: 0
parent: 0
-version: 1.38
+version: 1.39
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mac-PropertyList-1.38/MYMETA.json
new/Mac-PropertyList-1.39/MYMETA.json
--- old/Mac-PropertyList-1.38/MYMETA.json 2012-10-23 22:45:09.000000000
+0200
+++ new/Mac-PropertyList-1.39/MYMETA.json 2013-09-27 22:28:47.000000000
+0200
@@ -43,5 +43,5 @@
}
},
"release_status" : "stable",
- "version" : "1.38"
+ "version" : "1.39"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mac-PropertyList-1.38/MYMETA.yml
new/Mac-PropertyList-1.39/MYMETA.yml
--- old/Mac-PropertyList-1.38/MYMETA.yml 2012-10-23 22:45:09.000000000
+0200
+++ new/Mac-PropertyList-1.39/MYMETA.yml 2013-09-27 22:28:47.000000000
+0200
@@ -25,4 +25,4 @@
Time::Local: 0
XML::Entities: 0
parent: 0
-version: 1.38
+version: 1.39
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Mac-PropertyList-1.38/lib/Mac/PropertyList/ReadBinary.pm
new/Mac-PropertyList-1.39/lib/Mac/PropertyList/ReadBinary.pm
--- old/Mac-PropertyList-1.38/lib/Mac/PropertyList/ReadBinary.pm
2012-10-23 22:45:08.000000000 +0200
+++ new/Mac-PropertyList-1.39/lib/Mac/PropertyList/ReadBinary.pm
2013-09-27 22:28:46.000000000 +0200
@@ -13,7 +13,7 @@
use POSIX qw(SEEK_END SEEK_SET);
use XML::Entities ();
-$VERSION = '1.38';
+$VERSION = '1.39';
__PACKAGE__->_run( @ARGV ) unless caller;
@@ -180,19 +180,27 @@
# # # # # # # # # # # # # #
BEGIN {
+
+my %singletons = (
+ 0 => undef,
+ 8 => Mac::PropertyList::false->new(),
+ 9 => Mac::PropertyList::true->new(),
+
+ # 15 is also defined (as "fill") in the comments to Apple's
+ # implementation in CFBinaryPList.c but Apple's actual code has no
+ # support for it at all, either reading or writing, so it's
+ # probably not important to implement.
+
+);
+
my $type_readers = {
0 => sub { # the odd balls
my( $self, $length ) = @_;
- my %hash = (
- 0 => [ qw(null 0) ],
- 8 => [ qw(false 0) ],
- 9 => [ qw(true 1) ],
- 15 => [ qw(fill 15) ],
- );
-
- return $hash{ $length } || [];
+ return $singletons{ $length } if exists $singletons{ $length };
+
+ croak ( sprintf "Unknown type byte %02X\n", $length );
},
1 => sub { # integers
@@ -252,7 +260,7 @@
$self->{MLen} += 9;
my $adjusted_time = POSIX::strftime(
- "%FT%H:%M:%SZ",
+ "%Y-%m-%dT%H:%M:%SZ",
gmtime( 978307200 + $values[0])
);
@@ -274,11 +282,7 @@
my( $buffer, $value );
read $self->_fh, $buffer, $length;
- # pack to make it unicode
- $buffer = XML::Entities::decode(
- 'all',
- pack "U0C*", unpack "C*", $buffer
- );
+ $buffer = Encode::decode( 'ascii', $buffer );
return Mac::PropertyList::string->new( $buffer );
},
@@ -289,10 +293,7 @@
my( $buffer, $value );
read $self->_fh, $buffer, 2 * $length;
- $buffer = XML::Entities::decode(
- 'all',
- Encode::decode( "UTF-16BE", $buffer )
- );
+ $buffer = Encode::decode( "UTF-16BE", $buffer );
return Mac::PropertyList::ustring->new( $buffer );
},
@@ -391,7 +392,7 @@
=head1 COPYRIGHT AND LICENSE
-Copyright © 2004-2012 brian d foy. All rights reserved.
+Copyright © 2004-2013 brian d foy. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Mac-PropertyList-1.38/lib/Mac/PropertyList/WriteBinary.pm
new/Mac-PropertyList-1.39/lib/Mac/PropertyList/WriteBinary.pm
--- old/Mac-PropertyList-1.38/lib/Mac/PropertyList/WriteBinary.pm
2012-10-23 22:45:08.000000000 +0200
+++ new/Mac-PropertyList-1.39/lib/Mac/PropertyList/WriteBinary.pm
2013-09-27 22:28:46.000000000 +0200
@@ -101,7 +101,7 @@
havePack64 => ( eval { pack('Q>', 1153202979583557643) eq
"\x10\x01\0\0\0\0\0\x0B" } ? 1 : 0 ),
};
-$VERSION = '1.38';
+$VERSION = '1.39';
@EXPORT_OK = qw( as_string );
sub as_string {
@@ -187,7 +187,7 @@
# Serialize the object into $fragment if possible. Since we
# don't yet know how many bytes we will use to represent object
- # ids in the final file, don't serialize those yet--- keep them
+ # ids in the final file, don't serialize those yet–keep them
# as a list of integers for now.
my($fragment, @objrefs);
@@ -442,7 +442,7 @@
Wim Lewis, C<< <[email protected]> >>
-Copyright E<copy> 2012 Wim Lewis. All rights reserved.
+Copyright © 2012 Wim Lewis. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mac-PropertyList-1.38/lib/Mac/PropertyList.pm
new/Mac-PropertyList-1.39/lib/Mac/PropertyList.pm
--- old/Mac-PropertyList-1.38/lib/Mac/PropertyList.pm 2012-10-23
22:45:08.000000000 +0200
+++ new/Mac-PropertyList-1.39/lib/Mac/PropertyList.pm 2013-09-27
22:28:46.000000000 +0200
@@ -24,7 +24,7 @@
'all' => \@EXPORT_OK,
);
-$VERSION = '1.38';
+$VERSION = '1.39';
=encoding utf8
@@ -59,7 +59,7 @@
=head1 DESCRIPTION
This module is a low-level interface to the Mac OS X Property List
-(plist) format. You probably shouldn't use this in applications--build
+(plist) format. You probably shouldn't use this in applications–build
interfaces on top of this so you don't have to put all the heinous
multi-level object stuff where people have to look at it.
@@ -269,7 +269,7 @@
Create a plist dictionary from the hash reference.
-The values of the hash can only be simple scalars--not references.
+The values of the hash can only be simple scalars–not references.
Reference values are silently ignored.
Returns a string representing the hash in the plist format.
@@ -305,7 +305,7 @@
Create a plist array from the array reference.
-The values of the array can only be simple scalars--not references.
+The values of the array can only be simple scalars–not references.
Reference values are silently ignored.
Returns a string representing the array in the plist format.
@@ -840,7 +840,7 @@
=head1 COPYRIGHT AND LICENSE
-Copyright © 2004-2012 brian d foy. All rights reserved.
+Copyright © 2004-2013 brian d foy. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
Files old/Mac-PropertyList-1.38/plists/binary2.plist and
new/Mac-PropertyList-1.39/plists/binary2.plist differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mac-PropertyList-1.38/t/Makefile.PL
new/Mac-PropertyList-1.39/t/Makefile.PL
--- old/Mac-PropertyList-1.38/t/Makefile.PL 2012-10-23 22:45:08.000000000
+0200
+++ new/Mac-PropertyList-1.39/t/Makefile.PL 1970-01-01 01:00:00.000000000
+0100
@@ -1,29 +0,0 @@
-use ExtUtils::MakeMaker;
-
-require 5.008;
-
-eval "use Test::Manifest 1.21";
-
-WriteMakefile
- (
- 'NAME' => 'Mac::PropertyList',
- 'ABSTRACT' => 'work with Mac plists at a low level',
- 'VERSION_FROM' => 'lib/PropertyList.pm',
- 'LICENSE' => 'perl',
- 'AUTHOR' => 'brian d foy <[email protected]>',
-
- 'PREREQ_PM' => {
- 'Math::BigInt' => '0',
- 'MIME::Base64' => '0',
- 'Test::More' => '0',
- 'XML::Entities' => '0',
- },
-
- 'PM' => {
- 'lib/PropertyList.pm' => '$(INST_LIBDIR)/PropertyList.pm',
- 'lib/ReadBinary.pm' =>
'$(INST_LIBDIR)/PropertyList/ReadBinary.pm',
- },
-
- clean => { FILES => 'Mac-PropertyList-*' },
- );
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mac-PropertyList-1.38/t/plists.t
new/Mac-PropertyList-1.39/t/plists.t
--- old/Mac-PropertyList-1.38/t/plists.t 2012-10-23 22:45:08.000000000
+0200
+++ new/Mac-PropertyList-1.39/t/plists.t 2013-09-27 22:28:46.000000000
+0200
@@ -35,5 +35,6 @@
my $elapsed = Time::HiRes::tv_interval( $time1, $time2 );
diag( "$file [$b bytes] parsed in $elapsed seconds" );
- isa_ok( $plist, 'HASH' );
+ # All of the test plists have a dict at the top level, except for
binary2.
+ isa_ok( $plist, ( $file eq 'plists/binary2.plist' ) ? 'ARRAY' : 'HASH'
);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mac-PropertyList-1.38/t/read_binary.t
new/Mac-PropertyList-1.39/t/read_binary.t
--- old/Mac-PropertyList-1.38/t/read_binary.t 2012-10-23 22:45:08.000000000
+0200
+++ new/Mac-PropertyList-1.39/t/read_binary.t 2013-09-27 22:28:46.000000000
+0200
@@ -2,7 +2,7 @@
use warnings;
use utf8;
-use Test::More tests => 20;
+use Test::More tests => 41;
use File::Spec::Functions;
@@ -37,6 +37,29 @@
'Organization returns the right value'
);
+isa_ok( $plist->{'Creation'}, 'Mac::PropertyList::date' );
+is( $plist->{'Creation'}->value, '2007-11-14T02:19:03Z', 'Creation date has
the right value' );
+
+is_deeply(
+ $plist->{'Phone'}->as_perl,
+ {
+ 'identifiers' => [
+ 'DCBE4C18-EC2E-457F-A594-99A10257AB37',
+ 'CBE21CFF-0EF2-4975-98E6-84FCA75202BA'
+ ],
+ 'labels' => [
+ '_$!<Mobile>!$_',
+ '_$!<WorkFAX>!$_'
+ ],
+ 'primary' => 'DCBE4C18-EC2E-457F-A594-99A10257AB37',
+ 'values' => [
+ '(312) 492-4632',
+ '866 750-7099'
+ ]
+ },
+ 'nested arrays and dicts return the right value'
+ );
+
}
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
@@ -63,7 +86,7 @@
}
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-# Test with real and date
+# Test with real and data
{
use Mac::PropertyList qw(parse_plist_file);
my $test_file = catfile( qw( plists binary.plist ) );
@@ -90,4 +113,38 @@
$Δ < $ε,
'π returns the right value, within ε'
);
+
+isa_ok( $plist->{'Data'}, 'Mac::PropertyList::data' );
+is( $plist->value( 'Data' ), "\x01\x50\x01\x15", "Data returns the right
value" );
+
+}
+
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+# Test with various width integers, booleans, unusual strings
+{
+my $test_file_2 = catfile( qw( plists binary2.plist ) );
+my $plist = parse_plist_file( $test_file_2 );
+
+isa_ok( $plist, 'Mac::PropertyList::array' );
+my(@values) = $plist->value;
+is( scalar @values, 8, 'right number of elements in array' );
+
+my(@types) = qw( integer integer integer true false string ustring ustring );
+my(@expect) = ( 1280, 2752512, 2147483649, 1, 0,
+ 'Entities: & and &',
+ 'Unicode: π≠2 Entities: & and &',
+ "Unicode Supplementary: \x{1203C}, \x{1F06B}." );
+
+# The characters in the Supplementary string are CUNEIFORM SIGN ASH
+# OVER ASH OVER ASH and DOMINO TILE VERICAL 1 1. They were entered
+# in utf8 into an xml plist, then converted to bplist format by plutil
+# on MacOSX10.6.8.
+
+for my $index (0 .. 7) {
+ isa_ok( $values[$index], 'Mac::PropertyList::' . $types[$index] );
+ is( scalar $values[$index]->value, $expect[$index],
+ "$types[$index] at index $index has right value" )
+ unless ( $index == 3 || $index == 4 );
+}
+
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mac-PropertyList-1.38/t/write.t
new/Mac-PropertyList-1.39/t/write.t
--- old/Mac-PropertyList-1.38/t/write.t 2012-10-23 22:45:08.000000000 +0200
+++ new/Mac-PropertyList-1.39/t/write.t 2013-09-27 22:28:46.000000000 +0200
@@ -1,4 +1,4 @@
-use Test::More tests => 3;
+use Test::More tests => 8;
use Mac::PropertyList;
@@ -56,6 +56,20 @@
</plist>
HERE
+my $array_various =<<"HERE";
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<array>
+ <data>
+ RHJpbmsgeW91ciBvdmFsdGluZS4=
+ </data>
+ <data></data>
+ <date>2009-07-11T18:40:29Z</date>
+</array>
+</plist>
+HERE
+
foreach my $start ( ( $array, $dict ) )
{
my $plist = Mac::PropertyList::parse_plist( $start );
@@ -69,3 +83,23 @@
print STDERR "\n$string\n" if $ENV{DEBUG};
ok( ($string eq $nested_dict) || ($string eq $nested_dict_alt), "Nested dict"
);
+
+$plist = Mac::PropertyList::parse_plist( $array_various );
+is($plist->[0]->value, 'Drink your ovaltine.', 'data decode');
+is($plist->[1]->value, '', 'empty data');
+is($plist->[2]->value, '2009-07-11T18:40:29Z', 'date value');
+$string = Mac::PropertyList::plist_as_string( $plist );
+$string = &canonicalize_data_elts($string);
+is($string, &canonicalize_data_elts($array_various),
+ 'Original and rewritten string match');
+is_deeply($plist, Mac::PropertyList::parse_plist($string),
+ "canonicalization doesn't break test");
+
+
+sub canonicalize_data_elts {
+ my($string) = @_;
+
+ # Whitespace is ignored inside <data>
+ $string =~ s#(\<data\>)([a-zA-Z0-9_+=\s]+)(\</data\>)# my($b64) = $2; $b64
=~ y/a-zA-Z0-9_+=//cd; $1.$b64.$3; #gem;
+ $string;
+}
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]