Forráskód Böngészése

Dpkg::Control::Hash: Fix set_options to take a hash instead of two scalars

This fixes the function to behave as documented, and expected from the
name itself.
Guillem Jover 13 éve
szülő
commit
7e85606048
2 módosított fájl, 4 hozzáadás és 2 törlés
  1. 2 0
      debian/changelog
  2. 2 2
      scripts/Dpkg/Control/Hash.pm

+ 2 - 0
debian/changelog

@@ -82,6 +82,8 @@ dpkg (1.17.0) UNRELEASED; urgency=low
   * Only ignore older packages if the existing version is informative. This
   * Only ignore older packages if the existing version is informative. This
     allows any program using libdpkg to parse the available file to see again
     allows any program using libdpkg to parse the available file to see again
     packages with versions lesser than 0-0 (like 0~0-0). Closes: #676664
     packages with versions lesser than 0-0 (like 0~0-0). Closes: #676664
+  * Fix Dpkg::Control::Hash set_options() to take a hash as argument instead
+    of two scalars.
 
 
   [ Updated manpages translations ]
   [ Updated manpages translations ]
   * Fix incorrect translation of "fortify" in French manpage for dpkg-buildflags
   * Fix incorrect translation of "fortify" in French manpage for dpkg-buildflags

+ 2 - 2
scripts/Dpkg/Control/Hash.pm

@@ -136,8 +136,8 @@ Changes the value of one or more options.
 =cut
 =cut
 
 
 sub set_options {
 sub set_options {
-    my ($self, $k, $v) = @_;
-    $$self->{$k} = $v;
+    my ($self, %opts) = @_;
+    $$self->{$_} = $opts{$_} foreach keys %opts;
 }
 }
 
 
 =item my $value = $c->get_option($option)
 =item my $value = $c->get_option($option)