Просмотр исходного кода

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
Родитель
Сommit
7e85606048
2 измененных файлов с 4 добавлено и 2 удалено
  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
     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
+  * Fix Dpkg::Control::Hash set_options() to take a hash as argument instead
+    of two scalars.
 
   [ Updated manpages translations ]
   * 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
 
 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)