Browse Source

Dpkg::Deps: Emit a warning when using the obsolete check_package() function

Guillem Jover 12 years ago
parent
commit
dc8ea230f2
2 changed files with 7 additions and 0 deletions
  1. 1 0
      debian/changelog
  2. 6 0
      scripts/Dpkg/Deps.pm

+ 1 - 0
debian/changelog

@@ -27,6 +27,7 @@ dpkg (1.17.14) UNRELEASED; urgency=low
   * Fix the build system to parse the system curses.h header instead of
     dselect-curses.h, to not just default on the builtin and override keys
     for dselect key bindings support. Regression introduced in dpkg 1.15.1.
+  * Emit a warning when using the obsolete Dpkg::Deps check_package() function.
 
   [ Raphaël Hertzog ]
   * Explain better in deb-triggers(5) why interest/activate-noawait should be

+ 6 - 0
scripts/Dpkg/Deps.pm

@@ -1317,6 +1317,8 @@ Creates a new object.
 use strict;
 use warnings;
 
+use Carp;
+
 use Dpkg::Version;
 
 sub new {
@@ -1386,6 +1388,10 @@ methods where appropriate, but it should not be directly queried.
 
 sub check_package {
     my ($self, $pkg) = @_;
+
+    carp 'obsolete function, pass Dpkg::Deps::KnownFacts to Dpkg::Deps ' .
+         'methods instead';
+
     if (exists $self->{pkg}{$pkg}) {
 	return (1, $self->{pkg}{$pkg}[0]{version});
     }