mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-29 19:43:41 +00:00
Add -c option to preserve comments from GENERIC in the output.
This commit is contained in:
parent
bed2969d74
commit
4d7bee151a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=134494
@ -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}) {
|
||||
|
Loading…
Reference in New Issue
Block a user