-$ret=GetOptions(
- "v" => \$verbose,
- "verbose" => \$verbose,
-
- "i" => \&AddPackage,
- "indep" => \&AddPackage,
-
- "a" => \&AddPackage,
- "arch" => \&AddPackage,
-
- "p=s" => \&AddPackage,
- "package=s" => \&AddPackage,
-
- "n" => \$noscripts,
- "noscripts" => \$noscripts,
-
- "x" => \$include, # is -x for some unknown historical reason..
- "include-conffiles" => \$include,
-
- "X=s" => \&AddExclude,
- "exclude=s" => \&AddExclude,
-
- "d" => \$d_flag,
- "remove-d" => \$d_flag,
-
- "r" => \$r_flag,
- "no-restart-on-upgrade" => \$r_flag,
-
- "k" => \$k_flag,
- "keep" => \$k_flag,
-
- "P=s" => \$tmpdir,
- "tmpdir=s" => \$tmpdir,
-
- "u=s", => \$u_params,
- "update-rcd-params=s", => \$u_params,
- "dpkg-shlibdeps-params=s", => \$u_params,
-
- "m=s", => \$major,
- "major=s" => \$major,
-
- "V:s", => \$version_info,
- "version-info:s" => \$version_info,
-
- "A" => \$all,
- "all" => \$all,
-
- "no-act" => \$no_act,
-
- "init-script=s" => \$init_script,
-);
-
-if (!$ret) {
- $parse_error="exiting with unknown option.";
+my %options=Dh_Getopt::parseopts();
+
+# Change a few lists in %options into strings,
+# generate some options that only need to be visible to the
+# shell scripts so Dh_Getopt doesn't bother generating.
+$options{DOPACKAGES}=join " ",@{$options{DOPACKAGES}};
+if ($#{$options{EXCLUDE}} > -1) {
+ $options{EXCLUDE_GREP}=join '|', @{$options{EXCLUDE}};