aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2004-08-29 19:45:50 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2004-08-29 19:45:50 +0000
commit4d7bee151a03776a57db1fe0047de4214fb1b95d (patch)
treefe37d6ef4e2defaf4d3fd39e5c3f81f616fe7f0f /tools
parentbed2969d748e6f4bc058d2f7abea9c9dd9f7b0ce (diff)
Notes
Diffstat (limited to 'tools')
-rwxr-xr-xtools/tools/genericize/genericize.pl16
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}) {