Le mardi 20 mars 2018 à 10:33:03+0000, Debian Bug Tracking System a écrit :
> Thank you for the additional information you have supplied regarding
> this Bug report.
> 
> This is an automatically generated reply to let you know your message
> has been received.
> 
> Your message is being forwarded to the package maintainers and other
> interested parties for their attention; they will reply in due course.
> 
> Your message has been sent to the package maintainer(s):
>  Debian buildd-tools Developers <buildd-tools-de...@lists.alioth.debian.org>
> 
> If you wish to submit further information on this problem, please
> send it to 884...@bugs.debian.org.
> 
> Please do not send mail to ow...@bugs.debian.org unless you wish
> to report a problem with the Bug-tracking system.

A patch with better indentation regarding the conventions that seem to be in
place.

A modeline would be great, btw. :D

-- 
Pierre-Elliott Bécue
GPG: 9AE0 4D98 6400 E3B6 7528  F493 0D44 2664 1949 74E2
It's far easier to fight for one's principles than to live up to them.
diff --git a/lib/Sbuild/Build.pm b/lib/Sbuild/Build.pm
index 05ce6857..619f80c3 100644
--- a/lib/Sbuild/Build.pm
+++ b/lib/Sbuild/Build.pm
@@ -2253,7 +2253,6 @@ sub build {
 			  [$self->get_conf('BUILD_ARCH_ALL')]
 			  [$self->get_conf('BUILD_ARCH_ANY')];
     push (@{$buildcmd}, $binopt) if $binopt;
-    push (@{$buildcmd}, "-sa") if ($self->get_conf('BUILD_SOURCE') && $self->get_conf('FORCE_ORIG_SOURCE'));
     push (@{$buildcmd}, "-r" . $self->get_conf('FAKEROOT'));
 
     if (defined($self->get_conf('DPKG_BUILDPACKAGE_USER_OPTIONS')) &&
@@ -2563,6 +2562,10 @@ sub build {
 		    push (@{$genchangescmd}, $self->get_conf('SIGNING_OPTIONS'));
 		}
 	    }
+	    my $changes_opts = $self->get_changes_opts();
+	    if ($changes_opts) {
+		    push (@{$genchangescmd}, @{$changes_opts});
+	    }
 	    my $cfile = $session->read_command(
 		{ COMMAND => $genchangescmd,
 		    USER => $self->get_conf('BUILD_USER'),
@@ -3354,4 +3357,28 @@ sub log_symlink {
     symlink $log, $dest;
 }
 
+sub get_changes_opts {
+    my $self = shift;
+    my @changes_opts = ();
+	foreach (@{$self->get_conf('DPKG_BUILDPACKAGE_USER_OPTIONS')}) {
+	    if (/^--changes-option=(.*)$/) {
+		    push @changes_opts, $1;
+	    } elsif (/^-s[iad]$/) {
+		    push @changes_opts, $_;
+	    } elsif (/^--build=.*$/) {
+		    push @changes_opts, $_;
+	    } elsif (/^-m.*$/) {
+		    push @changes_opts, $_;
+	    } elsif (/^-e.*$/) {
+		    push @changes_opts, $_;
+	    } elsif (/^-v.*$/) {
+		    push @changes_opts, $_;
+	    } elsif (/^-C.*$/) {
+		    push @changes_opts, $_;
+	    }
+	}
+
+    return \@changes_opts;
+}
+
 1;
diff --git a/lib/Sbuild/Options.pm b/lib/Sbuild/Options.pm
index 849acfd5..e44af567 100644
--- a/lib/Sbuild/Options.pm
+++ b/lib/Sbuild/Options.pm
@@ -595,4 +595,15 @@ sub set_options {
 	);
 }
 
+=pod
+This function allows to extrapolate from the parsed and set options some
+expected behaviours.
+=cut
+sub extrapolate_options {
+    my $self = shift;
+
+    # This allows to pass -sa to all commands instead of passing it just to dpkg-buildpackage
+    push (@{$self->get_conf('DPKG_BUILDPACKAGE_USER_OPTIONS')}, "-sa") if ($self->get_conf('BUILD_SOURCE') && $self->get_conf('FORCE_ORIG_SOURCE'));
+}
+
 1;
diff --git a/lib/Sbuild/OptionsBase.pm b/lib/Sbuild/OptionsBase.pm
index 752ae7de..d9b801b2 100644
--- a/lib/Sbuild/OptionsBase.pm
+++ b/lib/Sbuild/OptionsBase.pm
@@ -68,6 +68,7 @@ sub new {
 	usage_error($program, "Error parsing command-line options");
 	return undef;
     }
+    $self->extrapolate_options();
     return $self;
 }
 
@@ -88,6 +89,10 @@ sub set_options () {
     my $self = shift;
 }
 
+sub extrapolate_options () {
+    my $self = shift;
+}
+
 sub parse_options {
     my $self = shift;
 

Attachment: signature.asc
Description: PGP signature

Reply via email to