"X=s" => \&AddExclude,
"exclude=s" => \&AddExclude,
- "ignore=s" => \&AddIgnore,
-
- "d" => \$options{D_FLAG},
- "remove-d" => \$options{D_FLAG},
- "dirs-only" => \$options{D_FLAG},
-
- "r" => \$options{R_FLAG},
- "no-restart-on-upgrade" => \$options{R_FLAG},
- "no-start" => \$options{NO_START},
- "R|restart-after-upgrade" => \$options{RESTART_AFTER_UPGRADE},
+ "d" => \$dh{D_FLAG},
- "k" => \$options{K_FLAG},
- "keep" => \$options{K_FLAG},
- "keep-debug" => \$options{K_FLAG},
-
- "P=s" => \$options{TMPDIR},
- "tmpdir=s" => \$options{TMPDIR},
-
- "u=s", => \$options{U_PARAMS},
- "update-rcd-params=s", => \$options{U_PARAMS},
- "dpkg-shlibdeps-params=s", => \$options{U_PARAMS},
- "dpkg-gencontrol-params=s", => \$options{U_PARAMS},
-
- "l=s", => \$options{L_PARAMS},
+ "k" => \$dh{K_FLAG},
+ "keep" => \$dh{K_FLAG},
- "m=s", => \$options{M_PARAMS},
- "major=s" => \$options{M_PARAMS},
+ "P=s" => \$dh{TMPDIR},
+ "tmpdir=s" => \$dh{TMPDIR},
- "V:s", => \$options{V_FLAG},
- "version-info:s" => \$options{V_FLAG},
+ "u=s", => \$dh{U_PARAMS},
- "A" => \$options{PARAMS_ALL},
- "all" => \$options{PARAMS_ALL},
+ "V:s", => \$dh{V_FLAG},
- "no-act" => \$options{NO_ACT},
+ "A" => \$dh{PARAMS_ALL},
+ "all" => \$dh{PARAMS_ALL},
- "init-script=s" => \$options{INIT_SCRIPT},
+ "sourcedir=s" => \$dh{SOURCEDIR},
- "sourcedir=s" => \$options{SOURCEDIR},
+ "destdir=s" => \$dh{DESTDIR},
- "destdir=s" => \$options{DESTDIR},
-
- "filename=s" => \$options{FILENAME},
-
- "priority=s" => \$options{PRIORITY},
+ "priority=s" => \$dh{PRIORITY},
- "flavor=s" => \$options{FLAVOR},
-
- "autodest" => \$options{AUTODEST},
-
"h|help" => \&showhelp,
- "mainpackage=s" => \$options{MAINPACKAGE},
+ "mainpackage=s" => \$dh{MAINPACKAGE},
- "list-missing" => \$options{LIST_MISSING},
+ "name=s" => \$dh{NAME},
- "fail-missing" => \$options{FAIL_MISSING},
-
- "L|libpackage=s" => \$options{LIBPACKAGE},
-
- "name=s" => \$options{NAME},
+ "error-handler=s" => \$dh{ERROR_HANDLER},
- "error-handler=s" => \$options{ERROR_HANDLER},
-
- "add-udeb=s" => \$options{SHLIBS_UDEB},
-
- "language=s" => \$options{LANGUAGE},
+ "ignore=s" => \&AddIgnore,
- "until=s" => \$options{UNTIL},
- "after=s" => \$options{AFTER},
- "before=s" => \$options{BEFORE},
- "remaining" => \$options{REMAINING},
- "with=s" => \&AddWith,
+ %options,
"<>" => \&NonOption,
- );
+ )
+}
+
+# Parse options and set %dh values.
+sub parseopts {
+ my $options=shift;
+ # DH_OPTIONS can contain additional options
+ # to be parsed like @ARGV, but with unknown options
+ # skipped.
+ my @ARGV_extra;
+ if (defined $ENV{DH_OPTIONS}) {
+ $ENV{DH_OPTIONS}=~s/^\s+//;
+ $ENV{DH_OPTIONS}=~s/\s+$//;
+ @ARGV_extra=split(/\s+/,$ENV{DH_OPTIONS});
+ my $ret=getoptions(\@ARGV_extra, $options);
+ if (!$ret) {
+ warning("warning: ignored unknown options in DH_OPTIONS");
+ }
+ }
+
+ # DH_INTERNAL_OPTIONS is used to pass additional options from
+ # dh through an override target to a command.
+ if (defined $ENV{DH_INTERNAL_OPTIONS}) {
+ $ENV{DH_INTERNAL_OPTIONS}=~s/^\s+//;
+ $ENV{DH_INTERNAL_OPTIONS}=~s/\s+$//;
+ unshift @ARGV, split(/\s+/,$ENV{DH_INTERNAL_OPTIONS});
+ }
+
+ my $ret=getoptions(\@ARGV, $options);
if (!$ret) {
- error("unknown option; aborting");
+ warning("warning: unknown options will be a fatal error in a future debhelper release");
+ #error("unknown option; aborting");
}
-
+
# Check to see if -V was specified. If so, but no parameters were
# passed, the variable will be defined but empty.
- if (defined($options{V_FLAG})) {
- $options{V_FLAG_SET}=1;
+ if (defined($dh{V_FLAG})) {
+ $dh{V_FLAG_SET}=1;
}
# If we have not been given any packages to act on, assume they
- * dh: debian/rules override targets can change what is run
- for a specific debhelper command in a sequence.
- (Thanks Modestas Vainius for the improved makefile parser.)
- * dh: Redid all the examples to use override targets, since these
- eliminate all annoying boilerplate and are much easier to understand
- than the old method.
- * Remove rules.simple example, there's little need to use explcit targets
- with dh anymore.
+debhelper (7.2.0) UNRELEASED; urgency=low
+
- * dh: Support debian/rules calling make with -B,
- which is useful to avoid issues with phony implicit
- rules (see bug #509756).
+ * dh: Fix typo. Closes: #509754
+ * debhelper.pod: Fix typo. Closes: #510180
+ * dh_gconf: Support mandatory settings. Closes: #513923
-
+ * Improve error messages when child commands fail.
+ * Depend on dpkg-dev 1.14.19, the first to support Package-Type
+ fields in dpkg-gencontrol.
+ * dh_gencontrol: No longer need to generate the udeb filename
+ when calling dpkg-gencontrol.
+ * dh_gencontrol: Do not need to tell dpkg-gencontol not to
+ include the Homepage field in udebs (fixed in dpkg-dev 1.14.17).
+
+ -- Joey Hess <joeyh@debian.org> Thu, 26 Feb 2009 18:33:44 -0500
+
+debhelper (7.1.1) experimental; urgency=low
+
+ * dh_install(1): Order options alphabetically. Closes:# 503896
+ * Fix some docs that refered to --srcdir rather than --sourcedir.
+ Closes: #504742
+ * Add Vcs-Browser field. Closes: #507804
+ * Ignore unknown options in DH_OPTIONS. Debhelper will always ignore
+ such options, even when unknown command-line options are converted back
+ to an error. This allows (ab)using DH_OPTIONS to pass command-specific
+ options.
+ (Note that getopt will warn about such unknown options. Eliminating this
+ warning without reimplementing much of Getopt::Long wasn't practical.)
+
+ -- Joey Hess <joeyh@debian.org> Sun, 14 Dec 2008 23:19:27 -0500
+
+debhelper (7.1.0) experimental; urgency=low
+
+ * dh_installchangelogs: Fall back to looking for changelog files ending
+ with ".txt". Closes: #498460
+ * dh_gencontrol: Ensure misc:Depends is set in substvars to avoid dpkg
+ complaining about it when it's empty. Closes: #498666
+ * dh: Fix typo in example. Closes: #500836
+ * Allow individual debhelper programs to define their own special options
+ by passing a hash to init(), which is later passed on the Getopt::Long.
+ Closes: #370823
+ * Move many command-specific options to only be accepted by the command
+ that uses them. Affected options are:
+ -x, -r, -R, -l, -L, -m,
+ --include-conffiles, --no-restart-on-upgrade, --no-start,
+ --restart-after-upgrade, --init-script, --filename, --flavor, --autodest,
+ --libpackage, --add-udeb, --dpkg-shlibdeps-params,
+ --dpkg-gencontrol-params, --update-rcd-params, --major, --remove-d,
+ --dirs-only, --keep-debug, --version-info, --list-missing, --fail-missing,
+ --language, --until, --after, --before, --remaining, --with
+ * If any third-party debhelper commands use any of the above options,
+ they will be broken, and need to be changed to pass options to init().
+ * To avoid breaking rules files that pass options to commands that do not
+ use them, debhelper will now only warn if it encounters an unknown
+ option. This will be converted back to an error later.
+
+ -- Joey Hess <joeyh@debian.org> Wed, 10 Sep 2008 13:58:00 -0400
+
+ debhelper (7.0.50) unstable; urgency=low
+
+ * This release is designed to be easily backportable to stable,
+ to support the new style of rules file that I expect many packages will
+ use.
+ * dh: debian/rules override targets can change what is run
+ for a specific debhelper command in a sequence.
+ (Thanks Modestas Vainius for the improved makefile parser.)
+ * dh: Redid all the examples to use override targets, since these
+ eliminate all annoying boilerplate and are much easier to understand
+ than the old method.
+ * Remove rules.simple example, there's little need to use explicit targets
+ with dh anymore.
+ * dh: Support debian/rules calling make with -B,
+ which is useful to avoid issues with phony implicit
+ rules (see bug #509756).
++
+ -- Joey Hess <joeyh@debian.org> Fri, 27 Feb 2009 15:25:52 -0500
+
debhelper (7.0.17) unstable; urgency=low
[ Per Olofsson ]