blob: bc5e111ee547d02a5dd7e90f1940e21fc515edcc [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001Description: Support dash-less args to from_string.
2Author: Tim Retout <diocles@debian.org>
3Bug-Debian: http://bugs.debian.org/635607
4
5The module Data::GUID depends on Data::UUID supporting this behaviour.
6
7----
8Upstream-Status: Inappropriate [not author]
9
10This patch is from debian ossp-uuid 1.6.2 integration.
11
12Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
13
14--- a/perl/uuid_compat.pm
15+++ b/perl/uuid_compat.pm
16@@ -93,7 +93,9 @@
17 $uuid->import('str',
18 $str =~ /^0x/
19 ? join '-', unpack('x2 a8 a4 a4 a4 a12', $str)
20- : $str
21+ : $str =~ /-/
22+ ? $str
23+ : join '-', unpack('A8 A4 A4 A4 A12', $str)
24 );
25 return $uuid->export('bin');
26 }
27--- a/perl/uuid_compat.ts
28+++ b/perl/uuid_compat.ts
29@@ -28,7 +28,7 @@
30 ## uuid_compat.ts: Data::UUID Backward Compatibility Perl API (Perl test suite part)
31 ##
32
33-use Test::More tests => 14;
34+use Test::More tests => 16;
35
36 BEGIN {
37 use_ok('Data::UUID');
38@@ -53,3 +53,5 @@
39 ok($uuid8 = $ug->from_string("6ba7b811-9dad-11d1-80b4-00c04fd430c8"));
40 ok($ug->compare($uuid7, $uuid8) == 0);
41
42+ok($uuid9 = $ug->from_string("6ba7b8119dad11d180b400c04fd430c8"));
43+ok($ug->compare($uuid7, $uuid9) == 0);