From d3cb133cd8399efa737f86067c490a3bf520f3e9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 27 May 2010 21:16:26 -0400 Subject: In v8 mode, dh expects the sequence to run is always its first parameter. This avoids ambiguities when parsing options to be passed on to debhelper commands. (See #570039) In the end, the idea of putting the debhelper command options after -- seemed to need too much knowledge about whether an option like --buildsystem is a dh option or a command option. I did consider making no change.. The ambiguities this eliminates are small. But it seemed worth simplifying dh's option parser, and only about 1/6th of calls to dh in the archive don't put the sequence first already. (Docs have shown that as the right thing to do for some time.) --- debhelper.pod | 5 +++++ debian/changelog | 5 ++++- dh | 29 +++++++++++++++++++++-------- doc/TODO | 8 ++------ 4 files changed, 32 insertions(+), 15 deletions(-) diff --git a/debhelper.pod b/debhelper.pod index 2f44e4d0..91915103 100644 --- a/debhelper.pod +++ b/debhelper.pod @@ -526,6 +526,11 @@ Also, libraries in unusual locations that dpkg-gensymbols would not have processed before will be passed to it, a behavior change that can cause some packages to fail to build. +=item - + +dh requires the sequence to run be specified as the first parameter, and +any switches come after it. + =back =back diff --git a/debian/changelog b/debian/changelog index 6e2aced9..4cbb1df1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -debhelper (7.4.21) UNRELEASED; urgency=low +debhelper (7.9.1) UNRELEASED; urgency=low * dh_installman: Support .so links relative to the current section. * dh_installman: Avoid converting .so links to symlinks if the link @@ -18,6 +18,9 @@ debhelper (7.4.21) UNRELEASED; urgency=low (genesis) still uses them. * dh_fixperms: Tighten globs used to find library .so files, avoiding incorrectly matching things like "foo.sources". Closes: #583328 + * In v8 mode, dh expects the sequence to run is always its first parameter. + This avoids ambiguities when parsing options to be passed on to debhelper + commands. (See #570039) -- Joey Hess Mon, 17 May 2010 20:01:19 -0400 diff --git a/dh b/dh index a19a94a3..8327b64a 100755 --- a/dh +++ b/dh @@ -468,17 +468,31 @@ foreach my $addon (@{$dh{WITH}}) { } } -# Get the sequence of commands to run. -if (! @ARGV) { +my $sequence; +if (! compat(7)) { + # From v8, the sequence is the very first parameter. + $sequence=shift @ARGV_orig; + if ($sequence=~/^-/) { + error "Unknown sequence $sequence (options should not come before the sequence)"; + } +} +else { + # Before v8, the sequence could be at any position in the parameters, + # so was what was left after parsing. + $sequence=shift; + if (defined $sequence) { + @ARGV_orig=grep { $_ ne $sequence } @ARGV_orig; + } +} +if (! defined $sequence) { error "specify a sequence to run"; } -my $sequence=shift; if ($sequence eq 'debian/rules' || $sequence =~ /^override_dh_/) { - # make -B causes the rules file to be run as a target - # and support completly empty override targets - exit 0 -} + # make -B causes the rules file to be run as a target. + # Also support completly empty override targets. + exit 0; +} elsif (! exists $sequences{$sequence}) { error "Unknown sequence $sequence (choose from: ". join(" ", sort keys %sequences).")"; @@ -506,7 +520,6 @@ elsif ($sequence eq 'binary-indep') { } while (@ARGV_orig) { my $opt=shift @ARGV_orig; - next if $opt eq $sequence; if ($opt =~ /^--?(after|until|before|with|without)$/) { shift @ARGV_orig; next; diff --git a/doc/TODO b/doc/TODO index 44547538..1f500806 100644 --- a/doc/TODO +++ b/doc/TODO @@ -1,15 +1,11 @@ v8: -* clean up dh's handling of options passed onto commands it calls, - by implementing one of the changes discussed in #570039 - (either change #3, change #4, or change #5; change #0 was done, but - was an incomplete workaround) - My preference ATM is #3, require dh options come before --, - and after, options to be passed on to commands. * better package arch filtering for -N , -p (#576990) * Support DEB_BUILD_OPTIONS=debug ; maybe also support passing -g -O2 by default. See patch (and discussion of why this breaks compatability) in #544844. +* Reorder build systems list. perl_build before perl_makemaker. + Any other changes? #578805 v9: -- cgit v1.2.3