Fix bogus file names in error messages
This commit is contained in:
parent
bcdcbab19c
commit
853b29dd43
1 changed files with 7 additions and 5 deletions
|
@ -40,6 +40,8 @@
|
||||||
# --- Global variables ---
|
# --- Global variables ---
|
||||||
# @Subjects Existing subjects
|
# @Subjects Existing subjects
|
||||||
# $filename The name of the current info file
|
# $filename The name of the current info file
|
||||||
|
# $filename{TOPIC}
|
||||||
|
# TOPIC's info file name
|
||||||
# $chapter{TOPIC} TOPIC's chapter (first arg to .TH)
|
# $chapter{TOPIC} TOPIC's chapter (first arg to .TH)
|
||||||
# $see_also{TOPIC}
|
# $see_also{TOPIC}
|
||||||
# TOPIC's SEE ALSO items (.SA argument)
|
# TOPIC's SEE ALSO items (.SA argument)
|
||||||
|
@ -62,13 +64,11 @@ use warnings;
|
||||||
|
|
||||||
use Errno qw(ENOENT);
|
use Errno qw(ENOENT);
|
||||||
|
|
||||||
our (%chapter, %see_also, %sanr);
|
our (%filename, %chapter, %see_also, %sanr);
|
||||||
our ($filename, %subjfil);
|
our ($filename, %subjfil);
|
||||||
|
|
||||||
# Get known subjects
|
# Get known subjects
|
||||||
our @Subjects = split(' ', read_make_var("subjects", "subjects.mk", ""));
|
our @Subjects = split(' ', read_make_var("subjects", "subjects.mk", ""));
|
||||||
# Get source directory
|
|
||||||
my $srcdir = read_make_var("srcdir", "GNUmakefile");
|
|
||||||
|
|
||||||
# Parse the .t files
|
# Parse the .t files
|
||||||
for my $f (@ARGV) {
|
for my $f (@ARGV) {
|
||||||
|
@ -100,6 +100,7 @@ for my $t (keys %subjfil) {
|
||||||
# Update subjects.mk
|
# Update subjects.mk
|
||||||
open(F, ">subjects.mk")
|
open(F, ">subjects.mk")
|
||||||
or die "Can't open subjects.mk for writing: $!";
|
or die "Can't open subjects.mk for writing: $!";
|
||||||
|
print F "# DO NOT EDIT THIS FILE. It was automatically generated by findsubj.pl\n";
|
||||||
print F "subjects := " . join(' ', @Subjects) . "\n";
|
print F "subjects := " . join(' ', @Subjects) . "\n";
|
||||||
for my $t (@Subjects) {
|
for my $t (@Subjects) {
|
||||||
print F "info/$t.t:$subjfil{$t}\n";
|
print F "info/$t.t:$subjfil{$t}\n";
|
||||||
|
@ -136,7 +137,8 @@ sub parse_file {
|
||||||
|
|
||||||
$topic = $filename;
|
$topic = $filename;
|
||||||
$topic =~ s,.*/([^/]*)\.t$,$1,;
|
$topic =~ s,.*/([^/]*)\.t$,$1,;
|
||||||
|
$filename{$topic} = $filename;
|
||||||
|
|
||||||
open(F, "<$filename")
|
open(F, "<$filename")
|
||||||
or die "Can't open $filename: $!";
|
or die "Can't open $filename: $!";
|
||||||
|
|
||||||
|
@ -177,7 +179,7 @@ sub parse_see_also {
|
||||||
my $found; # found a subject?
|
my $found; # found a subject?
|
||||||
|
|
||||||
$wanted = undef if $wanted eq 'Concept' or $wanted eq 'Command';
|
$wanted = undef if $wanted eq 'Concept' or $wanted eq 'Command';
|
||||||
$filename = "$srcdir/$topic";
|
$filename = $filename{$topic};
|
||||||
|
|
||||||
for (@see_also) {
|
for (@see_also) {
|
||||||
if (!exists $see_also{$_}) { # is this entry a subject?
|
if (!exists $see_also{$_}) { # is this entry a subject?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue