diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2019-09-05 14:48:19 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2019-09-05 14:48:19 +0100 |
commit | 4d113afe3aee58adf0d76f3d48610b6f7d1c6739 (patch) | |
tree | c640fc4389d71f11d360b3af0dd831ddf0b1659b | |
parent | 8dc465a4eb4bf7045c6cffa9cd50e217f3337589 (diff) |
dgit: Warn when we see what look like our options passed too late
Closes: #934807
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rwxr-xr-x | dgit | 29 |
1 files changed, 29 insertions, 0 deletions
@@ -6679,6 +6679,31 @@ sub build_prep ($) { } } +sub maybe_warn_opt_confusion ($$$) { + my ($subcommand, $willrun, $optsref) = @_; + foreach (@$optsref) { + if (m/^(?: --dry-run $ + | --damp-run $ + | --clean= | -w[gcnd] + | --(?:include|ignore)-dirty$ + | --quilt= | --gbp$ | --dpm$ | --baredebian + | --split-view= + | --build-products-dir= + )/x) { + print STDERR f_ <<END, $&, $subcommand or die $!; +warning: dgit option %s must be passed before %s on dgit command line +END + } elsif (m/^(?: -C + | --no-sign $ + | -k + )/x) { + print STDERR f_ <<END, $&, $subcommand, $willrun or die $!; +warning: option %s should probably be passed to dgit before %s sub-command on the dgit command line, so that it is seen by dgit and not simply passed to %s +END + } + } +} + sub changesopts_initial () { my @opts =@changesopts[1..$#changesopts]; } @@ -6852,6 +6877,7 @@ sub postbuild_mergechanges_vanilla ($) { sub cmd_build { build_prep_early(); + maybe_warn_opt_confusion 'build', 'dpkg-buildpackage', \@ARGV; $buildproductsdir eq '..' or print STDERR +(f_ <<END, $us, $us); %s: warning: build-products-dir set, but not supported by dpkg-buildpackage %s: warning: build-products-dir will be ignored; files will go to .. @@ -6879,6 +6905,7 @@ sub pre_gbp_build { sub cmd_gbp_build { build_prep_early(); + maybe_warn_opt_confusion 'gbp-build', 'gbp buildpackage', \@ARGV; # gbp can make .origs out of thin air. In my tests it does this # even for a 1.0 format package, with no origs present. So I @@ -7086,6 +7113,7 @@ sub binary_builder { sub cmd_sbuild { build_prep_early(); + maybe_warn_opt_confusion 'sbuild', 'sbuild', \@ARGV; binary_builder(\@sbuild, (__ <<END), qw(-d), $isuite, @ARGV, $dscfn); perhaps you need to pass -A ? (sbuild's default is to build only arch-specific binaries; dgit 1.4 used to override that.) @@ -7095,6 +7123,7 @@ END sub pbuilder ($) { my ($pbuilder) = @_; build_prep_early(); + maybe_warn_opt_confusion 'pbuilder', 'pbuilder', \@ARGV; # @ARGV is allowed to contain only things that should be passed to # pbuilder under debbuildopts; just massage those my $wantsrc = massage_dbp_args \@ARGV; |