]>
Commit | Line | Data |
---|---|---|
f2071dda VZ |
1 | #!############################################################################# |
2 | #! File: filelist.t | |
3 | #! Purpose: tmake template file containig Perl code to parse the filelist.txt | |
4 | #! file - this is used by all other templates. | |
5 | #! Author: Vadim Zeitlin | |
6 | #! Created: 14.07.99 | |
7 | #! Version: $Id$ | |
8 | #!############################################################################# | |
9 | #${ | |
10 | open(FILELIST, "filelist.txt") or die "Can't open filelist file: $!\n"; | |
11 | ||
12 | my %wxfiles; | |
13 | ||
14 | line: while ( defined($_ = <FILELIST>) ) { | |
15 | chomp; | |
16 | ||
17 | #! comment or blank line, skip | |
18 | next line if ( $_ eq "" or /^#/ ); | |
19 | ||
20 | #! if ( $verbose ) { | |
21 | #! print STDERR "Processing line: '$_'\n"; | |
22 | #! } | |
23 | ||
24 | my @fields = split "\t"; | |
25 | if ( $#fields > 2 ) { | |
26 | warn "Ignoring malformed line $_ in the filelist file.\n"; | |
27 | next line; | |
28 | } elsif ( $#fields == 1 ) { | |
29 | #! add an empty flags string | |
30 | $fields[2] = ""; | |
31 | } | |
32 | ||
33 | if ( $verbose ) { | |
34 | print STDERR "File $fields[0]: type '$fields[1]', flags '$fields[2]'\n"; | |
35 | } | |
36 | ||
37 | #! first column is filename, second is type, third is flags | |
38 | if ( $fields[1] eq "C" ) { | |
39 | $wxCommon{$fields[0]} = $fields[2]; | |
40 | } elsif ( $fields[1] eq "G" ) { | |
41 | $wxGeneric{$fields[0]} = $fields[2]; | |
42 | } elsif ( $fields[1] eq "M" ) { | |
43 | $wxMSW{$fields[0]} = $fields[2]; | |
44 | } else { | |
45 | warn "Unknown file type $fields[1] for $fields[0], ignoring.\n"; | |
46 | next line; | |
47 | } | |
48 | } | |
49 | ||
50 | close(FILELIST); | |
51 | #$} | |
52 | #! vim:sw=4:ts=4:list:et |