summaryrefslogtreecommitdiff
path: root/Debian
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-10-21 14:50:27 -0400
committerJoey Hess <joey@kodama.kitenet.net>2008-10-21 14:50:27 -0400
commitd6759d6a6c9c354abad02ddfbee6782357c8ed6b (patch)
tree81e135e6fa422e83df281f9e5a2a282378628a3f /Debian
parent3c458775d1180d034217c4b44e3871d8b87bf382 (diff)
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.
Diffstat (limited to 'Debian')
-rw-r--r--Debian/Debhelper/Dh_Getopt.pm66
1 files changed, 9 insertions, 57 deletions
diff --git a/Debian/Debhelper/Dh_Getopt.pm b/Debian/Debhelper/Dh_Getopt.pm
index a676eaa..3ed6f90 100644
--- a/Debian/Debhelper/Dh_Getopt.pm
+++ b/Debian/Debhelper/Dh_Getopt.pm
@@ -64,11 +64,6 @@ sub AddIgnore { my($option,$file)=@_;
$dh{IGNORE}->{$file}=1;
}
-# Add an item to the with list.
-sub AddWith { my($option,$value)=@_;
- push @{$dh{WITH}},$value;
-}
-
# This collects non-options values.
sub NonOption {
push @{$dh{ARGV}}, @_;
@@ -81,6 +76,8 @@ sub parseopts {
my $ret=GetOptions(
"v" => \$dh{VERBOSE},
"verbose" => \$dh{VERBOSE},
+
+ "no-act" => \$dh{NO_ACT},
"i" => \&AddPackage,
"indep" => \&AddPackage,
@@ -90,99 +87,53 @@ sub parseopts {
"p=s" => \&AddPackage,
"package=s" => \&AddPackage,
+
+ "N=s" => \&ExcludePackage,
+ "no-package=s" => \&ExcludePackage,
"dbg-package=s" => \&AddDebugPackage,
"s" => \&AddPackage,
"same-arch" => \&AddPackage,
- "N=s" => \&ExcludePackage,
- "no-package=s" => \&ExcludePackage,
-
"n" => \$dh{NOSCRIPTS},
"noscripts" => \$dh{NOSCRIPTS},
"o" => \$dh{ONLYSCRIPTS},
"onlyscripts" => \$dh{ONLYSCRIPTS},
- "x" => \$dh{INCLUDE_CONFFILES}, # is -x for some unknown historical reason..
- "include-conffiles" => \$dh{INCLUDE_CONFFILES},
-
"X=s" => \&AddExclude,
"exclude=s" => \&AddExclude,
- "ignore=s" => \&AddIgnore,
-
"d" => \$dh{D_FLAG},
- "remove-d" => \$dh{D_FLAG},
- "dirs-only" => \$dh{D_FLAG},
-
- "r" => \$dh{R_FLAG},
- "no-restart-on-upgrade" => \$dh{R_FLAG},
- "no-start" => \$dh{NO_START},
- "R|restart-after-upgrade" => \$dh{RESTART_AFTER_UPGRADE},
"k" => \$dh{K_FLAG},
"keep" => \$dh{K_FLAG},
- "keep-debug" => \$dh{K_FLAG},
"P=s" => \$dh{TMPDIR},
"tmpdir=s" => \$dh{TMPDIR},
"u=s", => \$dh{U_PARAMS},
- "update-rcd-params=s", => \$dh{U_PARAMS},
- "dpkg-shlibdeps-params=s", => \$dh{U_PARAMS},
- "dpkg-gencontrol-params=s", => \$dh{U_PARAMS},
-
- "l=s", => \$dh{L_PARAMS},
-
- "m=s", => \$dh{M_PARAMS},
- "major=s" => \$dh{M_PARAMS},
"V:s", => \$dh{V_FLAG},
- "version-info:s" => \$dh{V_FLAG},
"A" => \$dh{PARAMS_ALL},
"all" => \$dh{PARAMS_ALL},
-
- "no-act" => \$dh{NO_ACT},
- "init-script=s" => \$dh{INIT_SCRIPT},
-
"sourcedir=s" => \$dh{SOURCEDIR},
"destdir=s" => \$dh{DESTDIR},
-
- "filename=s" => \$dh{FILENAME},
"priority=s" => \$dh{PRIORITY},
- "flavor=s" => \$dh{FLAVOR},
-
- "autodest" => \$dh{AUTODEST},
-
"h|help" => \&showhelp,
"mainpackage=s" => \$dh{MAINPACKAGE},
- "list-missing" => \$dh{LIST_MISSING},
-
- "fail-missing" => \$dh{FAIL_MISSING},
-
- "L|libpackage=s" => \$dh{LIBPACKAGE},
-
"name=s" => \$dh{NAME},
-
+
"error-handler=s" => \$dh{ERROR_HANDLER},
- "add-udeb=s" => \$dh{SHLIBS_UDEB},
-
- "language=s" => \$dh{LANGUAGE},
-
- "until=s" => \$dh{UNTIL},
- "after=s" => \$dh{AFTER},
- "before=s" => \$dh{BEFORE},
- "remaining" => \$dh{REMAINING},
- "with=s" => \&AddWith,
+ "ignore=s" => \&AddIgnore,
%options,
@@ -190,7 +141,8 @@ sub parseopts {
);
if (!$ret) {
- error("unknown option; aborting");
+ warning("warning: this unknown option 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