From 53d790e962438849e04d9c9e0169d03253fc8bef Mon Sep 17 00:00:00 2001 From: Hilko Bengen Date: Wed, 30 Mar 2011 21:48:20 +0200 Subject: [PATCH] Newer versions of Dpkg::Version export version_compare instead of vercmp. --- bin/wanna-build | 8 +++++++- lib/WB/QD.pm | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/bin/wanna-build b/bin/wanna-build index fa13874..8787c71 100755 --- a/bin/wanna-build +++ b/bin/wanna-build @@ -52,7 +52,13 @@ use Hash::Merge qw ( merge ); use String::Format; use Date::Parse; use List::Util qw[max]; -use Dpkg::Version qw(vercmp); # TODO: change this for running with squeeze dpkg +use Dpkg::Version (); # import nothing +if ( defined $Dpkg::Version::VERSION ) { + *vercmp = \&Dpkg::Version::version_compare; +} else { + *vercmp = \&Dpkg::Version::vercmp; +} + use Dpkg::Deps; # TODO: same our ($verbose, $mail_logs, $list_order, $list_state, diff --git a/lib/WB/QD.pm b/lib/WB/QD.pm index 4c2806f..48ae979 100644 --- a/lib/WB/QD.pm +++ b/lib/WB/QD.pm @@ -2,7 +2,12 @@ package WB::QD; use strict; use IO::Uncompress::AnyInflate qw(anyinflate); -use Dpkg::Version qw(vercmp); +use Dpkg::Version (); # import nothing +if ( defined $Dpkg::Version::VERSION ) { + *vercmp = \&Dpkg::Version::version_compare; +} else { + *vercmp = \&Dpkg::Version::vercmp; +} use Dpkg::Arch qw(debarch_is); use Data::Dumper; -- 2.39.2