MT#61074 Unify UUID generation to libuuid-perl new API

Instead of using two different modules to generate UUIDs and GUIDs, use
a single implementation, which we use uniformly in all of our codebase,
so that we can drop this from our dependency tree.

Switch to use the new API, which simplifies the code.

(cherry picked from commit 24a0a76c1e)
(cherry picked from commit 3109dacda1)

Change-Id: I5647ce08438f747dec78c05c52fcea002cb0397c
mr12.5.1
Guillem Jover 2 years ago committed by Rene Krenn
parent 10e2a9dc52
commit 3b1d0aecec

@ -34,7 +34,6 @@ my $builder = Module::Build->new(
'DBI' => '1.608',
'Data::Dump' => 0,
'Data::Rmap' => 0,
'Data::UUID' => 0,
'Data::Validate::IP' => 0,
'Date::Calc' => 0,
'Date::Manip' => 0,

2
debian/control vendored

@ -5,7 +5,6 @@ Maintainer: Sipwise Development Team <support@sipwise.com>
Rules-Requires-Root: binary-targets
Build-Depends:
debhelper-compat (= 13),
libdata-uuid-perl <!nocheck>,
libdata-validate-ip-perl <!nocheck>,
libdate-calc-perl <!nocheck>,
libdate-manip-perl <!nocheck>,
@ -23,7 +22,6 @@ Depends:
libconfig-any-perl,
libdata-dump-perl,
libdata-rmap-perl,
libdata-uuid-perl,
libdata-validate-ip-perl,
libdate-calc-perl,
libdate-manip-perl,

@ -11,7 +11,6 @@ setlocale(LC_NUMERIC, 'C');
use List::Util qw(max min);
use Data::UUID qw();
use UUID qw();
use Data::Validate::IP qw(is_ipv4 is_ipv6);
@ -404,18 +403,11 @@ sub wrap_text {
}
sub create_guid {
my $ug = Data::UUID->new();
my $uuid = $ug->create();
return $ug->to_string( $uuid );
return uc UUID::uuid();
}
sub create_uuid {
my ($bin, $str);
UUID::generate($bin);
UUID::unparse($bin, $str);
return $str;
return UUID::uuid();
}
sub urlencode {

Loading…
Cancel
Save