Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | Description: Support dash-less args to from_string. |
| 2 | Author: Tim Retout <diocles@debian.org> |
| 3 | Bug-Debian: http://bugs.debian.org/635607 |
| 4 | |
| 5 | The module Data::GUID depends on Data::UUID supporting this behaviour. |
| 6 | |
| 7 | ---- |
| 8 | Upstream-Status: Inappropriate [not author] |
| 9 | |
| 10 | This patch is from debian ossp-uuid 1.6.2 integration. |
| 11 | |
| 12 | Signed-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); |