From c46d792d58f42c900f17228c5526df3ec75eff44 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Sat, 17 Jun 2000 20:10:55 +0000 Subject: [PATCH] Deal with quoted arguments. This hack parser uses whitespace to delimit fields, not lex/yacc grammar so it is not an exact match but should be close enough for most cases. Deal with 'port?', 'irq?' style specifications. These are parsed as seperate values in lex/yacc in config(8) but tripped up this helper tool. --- sys/alpha/conf/gethints.pl | 5 +++++ sys/i386/conf/gethints.pl | 5 +++++ sys/pc98/conf/gethints.pl | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/sys/alpha/conf/gethints.pl b/sys/alpha/conf/gethints.pl index 80586e381bf..74963990b87 100644 --- a/sys/alpha/conf/gethints.pl +++ b/sys/alpha/conf/gethints.pl @@ -12,6 +12,7 @@ while (<>) { chop; s/#.*//; next unless /^device/; + s/"//g; ($dev, $nameunit, $at, $where, @rest) = split; next unless $at eq "at" && $where ne ""; $name = $nameunit; @@ -78,6 +79,10 @@ while (<>) { } next; } + if ($key eq "port?" || $key eq "drq?" || $key eq "irq?" || + $key eq "iomem?" || $key eq "iosiz?") { + next; + } if ($key eq "irq" || $key eq "drq" || $key eq "drive" || $key eq "iomem" || $key eq "iosiz" || $key eq "flags"|| $key eq "bus" || $key eq "target" || $key eq "unit") { diff --git a/sys/i386/conf/gethints.pl b/sys/i386/conf/gethints.pl index 80586e381bf..74963990b87 100644 --- a/sys/i386/conf/gethints.pl +++ b/sys/i386/conf/gethints.pl @@ -12,6 +12,7 @@ while (<>) { chop; s/#.*//; next unless /^device/; + s/"//g; ($dev, $nameunit, $at, $where, @rest) = split; next unless $at eq "at" && $where ne ""; $name = $nameunit; @@ -78,6 +79,10 @@ while (<>) { } next; } + if ($key eq "port?" || $key eq "drq?" || $key eq "irq?" || + $key eq "iomem?" || $key eq "iosiz?") { + next; + } if ($key eq "irq" || $key eq "drq" || $key eq "drive" || $key eq "iomem" || $key eq "iosiz" || $key eq "flags"|| $key eq "bus" || $key eq "target" || $key eq "unit") { diff --git a/sys/pc98/conf/gethints.pl b/sys/pc98/conf/gethints.pl index 1a90029ff4a..b385ed03e0e 100644 --- a/sys/pc98/conf/gethints.pl +++ b/sys/pc98/conf/gethints.pl @@ -12,6 +12,7 @@ while (<>) { chop; s/#.*//; next unless /^device/; + s/"//g; ($dev, $nameunit, $at, $where, @rest) = split; next unless $at eq "at" && $where ne ""; $name = $nameunit; @@ -71,6 +72,10 @@ while (<>) { } next; } + if ($key eq "port?" || $key eq "drq?" || $key eq "irq?" || + $key eq "iomem?" || $key eq "iosiz?") { + next; + } if ($key eq "irq" || $key eq "drq" || $key eq "drive" || $key eq "iomem" || $key eq "iosiz" || $key eq "flags"|| $key eq "bus" || $key eq "target" || $key eq "unit") {