diff options
| author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2004-08-29 19:45:50 +0000 |
|---|---|---|
| committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2004-08-29 19:45:50 +0000 |
| commit | 4d7bee151a03776a57db1fe0047de4214fb1b95d (patch) | |
| tree | fe37d6ef4e2defaf4d3fd39e5c3f81f616fe7f0f /tools | |
| parent | bed2969d748e6f4bc058d2f7abea9c9dd9f7b0ce (diff) | |
Notes
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/tools/genericize/genericize.pl | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tools/tools/genericize/genericize.pl b/tools/tools/genericize/genericize.pl index 3cef7b1f6cd81..9a1454318b8e3 100755 --- a/tools/tools/genericize/genericize.pl +++ b/tools/tools/genericize/genericize.pl @@ -30,8 +30,12 @@ # use strict; +use Getopt::Std; MAIN:{ + my %opts; + getopts('c', \%opts); + my %config; my $machine; my $ident; @@ -62,6 +66,14 @@ MAIN:{ while (<GENERIC>) { my $line = $_; chomp(); + if ($opts{'c'} && m/^\#/) { + if ($blank) { + print "\n"; + $blank = 0; + } + print $line; + next; + } ++$blank unless $_; s/\s*(\#.*)?$//; next unless $_; @@ -69,10 +81,6 @@ MAIN:{ if ($keyword eq 'machine') { die("$generic is for $value, not $machine\n") unless ($value eq $machine); - if ($blank) { - print "\n"; - $blank = 0; - } } elsif ($keyword eq 'ident') { $line =~ s/$value/$ident/; } elsif ($config{$keyword}->{$value}) { |
