]> git.donarmstrong.com Git - debhelper.git/blobdiff - Debian/Debhelper/Dh_Lib.pm
bring back ignore_unknown_options
[debhelper.git] / Debian / Debhelper / Dh_Lib.pm
index 8af365ffa7509956c1c30a93526cb4dde96162ad..f37ff5188699c09f938a8d365b4ea7f4ce5d87fa 100644 (file)
@@ -33,7 +33,7 @@ sub init {
            grep /^-/, @ARGV) {
                eval "use Debian::Debhelper::Dh_Getopt";
                error($@) if $@;
-               Debian::Debhelper::Dh_Getopt::parseopts($params{options});
+               Debian::Debhelper::Dh_Getopt::parseopts(%params);
        }
 
        # Another way to set excludes.
@@ -251,12 +251,11 @@ sub verbose_print {
        }
 }
 
-# Output an error message and exit.
+# Output an error message and die (can be caught).
 sub error {
        my $message=shift;
 
-       warning($message);
-       exit 1;
+       die basename($0).": $message\n";
 }
 
 # Output a warning.
@@ -313,7 +312,7 @@ sub dirname {
                        }
                }
 
-               if ($c < 4 && ! $warned_compat) {
+               if ($c <= 4 && ! $warned_compat) {
                        warning("Compatibility levels before 5 are deprecated.");
                        $warned_compat=1;
                }
@@ -577,7 +576,7 @@ sub filedoublearray {
                # as if we were in the specified directory, so the
                # filenames that come out are relative to it.
                if (defined $globdir && ! compat(2)) {
-                       for (map { glob "$globdir/$_" } split) {
+                       foreach (map { glob "$globdir/$_" } split) {
                                s#^$globdir/##;
                                push @line, $_;
                        }