summaryrefslogtreecommitdiff
path: root/ghc/utils
diff options
context:
space:
mode:
authorsof <unknown>1998-10-02 09:20:04 +0000
committersof <unknown>1998-10-02 09:20:04 +0000
commit9fc2098d965eb40b290d67a0a83696abe5e9d97d (patch)
tree9cd29761a705840dbb4e0b246cfba361afe5b901 /ghc/utils
parent05bfa2a63450597c0973171281a4268f16133283 (diff)
downloadhaskell-9fc2098d965eb40b290d67a0a83696abe5e9d97d.tar.gz
[project @ 1998-10-02 09:20:04 by sof]
Generalise --exlude-module=M handling slightly, it now will ignore any appearances of M along the user import path too.
Diffstat (limited to 'ghc/utils')
-rw-r--r--ghc/utils/mkdependHS/mkdependHS.prl19
1 files changed, 16 insertions, 3 deletions
diff --git a/ghc/utils/mkdependHS/mkdependHS.prl b/ghc/utils/mkdependHS/mkdependHS.prl
index e821971d00..92500a3a1a 100644
--- a/ghc/utils/mkdependHS/mkdependHS.prl
+++ b/ghc/utils/mkdependHS/mkdependHS.prl
@@ -192,6 +192,7 @@ foreach $sf (@Src_files) {
}
&slurp_file_for_imports($file_to_read, $sf);
+ # Delete the temporary.
if ( $sf =~ /\.l(hs|y)$/ ) {
unlink "$Tmp_prefix.hs";
}
@@ -273,7 +274,7 @@ sub mangle_command_line_args {
} elsif ( /^-(x|-exclude-module=)(.*)/ ) {
local($thing) = &grab_arg_arg($1,$2);
- $IgnoreMe{$thing} = 'y';
+ $IgnoreMe{$thing} = 'Y';
} elsif ( /^-(X|-exclude-directory=)(.*)/ ) {
foreach $d ( split(/:/,&grab_arg_arg($1, $2)) ) {
push(@Ignore_dirs,"$d");
@@ -356,7 +357,7 @@ sub preprocess_import_dirs {
next unless /(.*)\.(hi|l?hs|l?y)$/;
#don't tag it twice or overwrite it with a diff. value
next if $IgnoreMe{$1};
- print STDERR "Module $d/$1.$2 will be ignored\n" if $Verbose;
+ print STDERR "Module $d will be ignored\n" if $Verbose;
$IgnoreMe{$1} = 'y';
}
@@ -373,6 +374,14 @@ sub slurp_file_for_imports {
$last_seen_dir =~ s/\/[^\/]+$//; # strip to dir name
$last_seen_dir = '.' if ($last_seen_dir eq $orig_src_file);
+ local($mod_name) = $orig_src_file;
+
+ $mod_name =~ s/.*\/([^\/]+)$/$1/g;
+ $mod_name =~ s/^([^.]+)\.(.*)$/$1/;
+
+ print STDERR "Warning: processing module $mod_name, which I was supposed to ignore.\n"
+ if ( $IgnoreMe{$mod_name} eq 'Y' && $Warnings );
+
&process_dependency('import',0,'Prelude') if ($Include_prelude);
# we mangle #include's so they will also leave something
@@ -422,7 +431,11 @@ sub process_dependency {
local($todo,$source,$modname) = @_;
if ($todo eq 'import') {
- if ( $ModuleIn{$modname} ) {
+ if ( $IgnoreMe{$modname} eq 'Y' ) {
+ # user specifically asked for this module
+ # to be ignored.
+ $follow_file = '__ignore__';
+ } elsif ( $ModuleIn{$modname} ) {
$follow_file = "$ModuleIn{$modname}/$modname.hi";
} else { # hard way
$follow_file =