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

dpkg-source: don't use -i/-I by default for "1.0" source packages

* Dpkg/Source/Package.pm (new): Call init_options() only if
initialize() has been called as it's supposed to be called
only after the object has been upgraded to its target type.
(init_options): add a comment that explains that this function is
not called by Dpkg::Source::Package::V1::init_options() and
render the function more robust.
Raphael Hertzog лет назад: 18
Родитель
Сommit
21d69014f4
3 измененных файлов с 21 добавлено и 5 удалено
  1. 9 0
      ChangeLog
  2. 2 0
      debian/changelog
  3. 10 5
      scripts/Dpkg/Source/Package.pm

+ 9 - 0
ChangeLog

@@ -1,3 +1,12 @@
+2008-08-15  Raphael Hertzog  <hertzog@debian.org>
+
+	* Dpkg/Source/Package.pm (new): Call init_options() only if
+	initialize() has been called as it's supposed to be called
+	only after the object has been upgraded to its target type.
+	(init_options): add a comment that explains that this function is
+	not called by Dpkg::Source::Package::V1::init_options() and
+	render the function more robust.
+
 2008-08-15  Ian Jackson  <ian@davenant.greenend.org.uk>
 
 	* src/packages.c (process_queue): When onerr_abort is bigger than 0

+ 2 - 0
debian/changelog

@@ -13,6 +13,8 @@ dpkg (1.14.21) UNRELEASED; urgency=low
   * Modified Dpkg::BuildOptions to recognize and use spaces as separator
     in DEB_BUILD_OPTIONS (in order to conform with the Debian policy
     ruling established in #430649).
+  * Fix dpkg-source to not use -i and -I by default with "1.0" source
+    packages. Closes: #495138
 
   [ Guillem Jover ]
   * When loading the status file fix up any inconsistent package in state

+ 10 - 5
scripts/Dpkg/Source/Package.pm

@@ -100,22 +100,27 @@ sub new {
         'options' => {},
     };
     bless $self, $class;
+    if (exists $args{'options'}) {
+        $self->{'options'} = $args{'options'};
+    }
     if (exists $args{"filename"}) {
         $self->initialize($args{"filename"});
+        $self->init_options();
     }
-    if (exists $args{"options"}) {
-        $self->{'options'} = $args{'options'};
-    }
-    $self->init_options();
     return $self;
 }
 
 sub init_options {
     my ($self) = @_;
     # Use full ignore list by default
+    # note: this function is not called by V1 packages
     $self->{'options'}{'diff_ignore_regexp'} ||= $diff_ignore_default_regexp;
-    $self->{'options'}{'tar_ignore'} = [ @tar_ignore_default_pattern ]
+    if (defined $self->{'options'}{'tar_ignore'}) {
+        $self->{'options'}{'tar_ignore'} = [ @tar_ignore_default_pattern ]
             unless @{$self->{'options'}{'tar_ignore'}};
+    } else {
+        $self->{'options'}{'tar_ignore'} = [ @tar_ignore_default_pattern ];
+    }
 }
 
 sub initialize {