Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/etc In most case patterns, change foo*) to foo[0-9]*). Ther...



details:   https://anonhg.NetBSD.org/src/rev/6925f81b8b86
branches:  trunk
changeset: 769307:6925f81b8b86
user:      apb <apb%NetBSD.org@localhost>
date:      Tue Sep 06 10:54:03 2011 +0000

description:
In most case patterns, change foo*) to foo[0-9]*).  There are also
a few where foo*) changes to foo|foo[0-9]*) or some other slightly
more complex pattern.

This should prevent "MAKEDEV foobar0" from accidentally matching
the foo* pattern when it should really give an error, and it
should make the order of the patterns less critical.

diffstat:

 etc/MAKEDEV.tmpl |  266 ++++++++++++++++++++++++++----------------------------
 1 files changed, 129 insertions(+), 137 deletions(-)

diffs (truncated from 930 to 300 lines):

diff -r d7e841a8b9a2 -r 6925f81b8b86 etc/MAKEDEV.tmpl
--- a/etc/MAKEDEV.tmpl  Tue Sep 06 10:48:28 2011 +0000
+++ b/etc/MAKEDEV.tmpl  Tue Sep 06 10:54:03 2011 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#      $NetBSD: MAKEDEV.tmpl,v 1.140 2011/08/06 12:29:39 jmcneill Exp $
+#      $NetBSD: MAKEDEV.tmpl,v 1.141 2011/09/06 10:54:03 apb Exp $
 #
 # Copyright (c) 2003,2007,2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -858,39 +858,39 @@
        mkdev usb c %usb_chr% 255 444
        ;;
 
-usb*)
+usb[0-9]*)
        unit=${i#usb}
        usb=usb$unit
        mkdev usb$unit c %usb_chr% $unit
        ;;
 
-uhid*)
+uhid[0-9]*)
        unit=${i#uhid}
        mkdev uhid$unit c %uhid_chr% $unit 666
        ;;
 
-ulpt*)
+ulpt[0-9]*)
        unit=${i#ulpt}
        mkdev ulpt$unit c %ulpt_chr% $unit
        mkdev ulpn$unit c %ulpt_chr% $(($unit + 64))
        ;;
 
-urio*)
+urio[0-9]*)
        unit=${i#urio}
        mkdev urio$unit c %urio_chr% $unit 666
        ;;
 
-uscanner*)
+uscanner[0-9]*)
        unit=${i#uscanner}
        mkdev uscanner$unit c %uscanner_chr% $unit
        ;;
 
-utoppy*)
+utoppy[0-9]*)
        unit=${i#utoppy}
        mkdev utoppy$unit c %utoppy_chr% $unit
        ;;
 
-ttyHS*)
+ttyHS[0-9]*)
        unit=${i#ttyHS}
        for j in 00 01 02 03 04 05 06 07 08 09 10
        do
@@ -901,21 +901,21 @@
        done
        ;;
 
-ttyY*)
+ttyY[0-9]*)
        unit=${i#ttyY}
        mkdev ttyY$unit c %ucycom_chr% $(($unit + $dialin  )) "" "" $u_uucp
        mkdev dtyY$unit c %ucycom_chr% $(($unit + $dialout )) "" "" $u_uucp
        mkdev ctyY$unit c %ucycom_chr% $(($unit + $callunit)) "" "" $u_uucp
        ;;
 
-ttyU*)
+ttyU[0-9]*)
        unit=${i#ttyU}
        mkdev ttyU$unit c %ucom_chr% $(($unit + $dialin  )) "" "" $u_uucp
        mkdev dtyU$unit c %ucom_chr% $(($unit + $dialout )) "" "" $u_uucp
        mkdev ctyU$unit c %ucom_chr% $(($unit + $callunit)) "" "" $u_uucp
        ;;
 
-ugen*)
+ugen[0-9]*)
        unit=${i#ugen}
        for j in 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
        do
@@ -941,7 +941,7 @@
        mkdev wskbd c %wsmux_chr% 1
        ;;
 
-wsmux*)
+wsmux[0-9]*)
        unit=${i#wsmux}
        mkdev wsmux$unit    c %wsmux_chr% $unit
        mkdev wsmuxctl$unit c %wsmux_chr% $(($unit + 128)) 200
@@ -967,17 +967,17 @@
        mkdev ttyEcfg c %wsdisplay_chr% 255
        ;;
 
-ttyE*)
+ttyE[0-9]*)
        unit=${i#ttyE}
        mkdev ttyE$unit c %wsdisplay_chr% $unit
        ;;
 
-wsmouse*)
+wsmouse[0-9]*)
        unit=${i#wsmouse}
        mkdev wsmouse$unit c %wsmouse_chr% $unit
        ;;
 
-wskbd*)
+wskbd[0-9]*)
        unit=${i#wskbd}
        mkdev wskbd$unit c %wskbd_chr% $unit
        ;;
@@ -994,10 +994,8 @@
        fi
        ;;
 
-wt*)
-       case $i in
-       wt*) name=wt;  unit=${i#wt};    chr=%wt_chr%;   blk=%wt_blk%;;
-       esac
+wt[0-9]*)
+       name=wt;  unit=${i#wt}; chr=%wt_chr%;   blk=%wt_blk%
        for sub in $unit $(($unit+8)) $(($unit+16))
        do
                mkdev $name$sub         b $blk $(($sub + 0)) 660 $g_operator
@@ -1007,28 +1005,24 @@
        done
        ;;
 
-md*)
+md[0-9]*)
        makedisk_minimal md ${i#md} %md_blk% %md_chr%
        ;;
 
-fss*)
-       case $i in
-       fss*) name=fss; unit=${i#fss};  blk=%fss_blk%;  chr=%fss_chr%
-       esac
+fss[0-9]*)
+       name=fss; unit=${i#fss};        blk=%fss_blk%;  chr=%fss_chr%
        mkdev $name$unit        b $blk $unit 660 $g_operator
        mkdev r$name$unit       c $chr $unit 660 $g_operator
        ;;
 
-ss*)
-       case $i in
-       ss*) name=ss;   unit=${i#ss};   chr=%ss_chr%;;
-       esac
+ss[0-9]*)
+       name=ss;        unit=${i#ss};   chr=%ss_chr%
        mkdev $name$unit        c $chr $(($unit * 16 + 0)) 640 $g_operator
        mkdev n$name$unit       c $chr $(($unit * 16 + 1)) 640 $g_operator
        mkdev en$name$unit      c $chr $(($unit * 16 + 3)) 640 $g_operator
        ;;
 
-ccd*|cgd*|raid*|vnd*)
+ccd[0-9]*|cgd[0-9]*|raid[0-9]*|vnd[0-9]*)
        case $i in
        ccd*)   name=ccd;       unit=${i#ccd};  blk=%ccd_blk%;  chr=%ccd_chr%;;
        cgd*)   name=cgd;       unit=${i#cgd};  blk=%cgd_blk%;  chr=%cgd_chr%;;
@@ -1038,44 +1032,44 @@
        %MKDISK% $name $unit $blk $chr
        ;;
 
-sd*)
+sd[0-9]*)
        name=sd; unit=${i#sd};  blk=%sd_blk%;   chr=%sd_chr%
        %MKDISK% $name $unit $blk $chr
        ;;
 
-ace*)
+ace[0-9]*)
        name=ace; unit=${i#ace};        blk=%ace_blk%;          chr=%ace_chr%
        %MKDISK% $name $unit $blk $chr
        ;;
 
-eflash*)
+eflash[0-9]*)
        name=eflash; unit=${i#eflash};  blk=%eflash_blk%;       chr=%eflash_chr%
        %MKDISK% $name $unit $blk $chr
        ;;
 
-wd*)
+wd[0-9]*)
        name=wd; unit=${i#wd}; blk=%wd_blk%; chr=%wd_chr%
        %MKDISK% $name $unit $blk $chr
        ;;
 
-fd*)
+fd[0-9]*)
        name=fd; unit=${i#fd}; blk=%fd_blk%; chr=%fd_chr%
        %MKDISK% $name $unit $blk $chr
        ;;
 
-ld*)
+ld[0-9]*)
        name=ld; unit=${i#ld}; blk=%ld_blk%; chr=%ld_chr%
        %MKDISK% $name $unit $blk $chr
        ;;
 
-flash*)
+flash[0-9]*)
        unit=${i#flash}
        flash=flash$unit
        mkdev flash$unit b %flash_blk% $unit
        mkdev rflash$unit c %flash_chr% $unit
        ;;
 
-altmem*)
+altmem[0-9]*)
        name=altmem; unit=${i#altmem}; blk=%altmem_blk%; chr=%altmem_chr%
        %MKDISK% $name $unit $blk $chr
        ;;
@@ -1084,22 +1078,22 @@
        mkdev bio c %bio_chr% 0
        ;;
 
-ed*)
+ed[0-9]*)
        name=ed; unit=${i#ed}; blk=%ed_blk%; chr=%ed_chr%
        %MKDISK% $name $unit $blk $chr
        ;;
 
-ofdisk*)
+ofdisk[0-9]*)
        name=ofdisk; unit=${i#ofdisk}; blk=%ofdisk_blk%; chr=%ofdisk_chr%
        %MKDISK% $name $unit $blk $chr
        ;;
 
-xbd*)
+xbd[0-9]*)
        name=xbd; unit=${i#xbd}; blk=%xbd_blk%; chr=%xbd_chr%
        %MKDISK% $name $unit $blk $chr
        ;;
 
-dk*)
+dk[0-9]*)
        name=dk; unit=${i#dk}; blk=%dk_blk%; chr=%dk_chr%
        minor=0
        while [ $minor -le ${i#dk} ]
@@ -1110,7 +1104,7 @@
        done
        ;;
 
-ttyCY*)
+ttyCY[0-9]*)
        name=tyCY; chr=%cy_chr%; off=32
        unit=${i#t${name}}
        minor=$(($unit * $off))
@@ -1125,7 +1119,7 @@
        done
        ;;
 
-ttyCZ*)
+ttyCZ[0-9]*)
        name=tyCZ; chr=%cz_chr%; off=64
        unit=${i#t${name}}
        minor=$(($unit * $off))
@@ -1160,26 +1154,26 @@
        mkdev dty$ounit c %com_chr% $(($unit + $dialout)) "" "" $u_uucp
        ;;
 
-ttyC*)
+ttyC[0-9]*)
                # some archs call com_chr ttyC traditionally
        unit=${i#ttyC}; name=ttyC; dname=dtyC; chr=%com_chr%
        mkdev  $name$unit c $chr $(($unit + $dialin )) "" "" $u_uucp
        mkdev $dname$unit c $chr $(($unit + $dialout)) "" "" $u_uucp
        ;;
 
-ttyh*)
+ttyh[0-9]*)
        unit=${i#ttyh}; name=ttyh; dname=dtyh; chr=%sabtty_chr%
        mkdev  $name$unit c $chr $(($unit + $dialin )) "" "" $u_uucp
        mkdev $dname$unit c $chr $(($unit + $dialout)) "" "" $u_uucp
        ;;
 
-ttyTX*)
+ttyTX[0-9]*)
        unit=${i#ttyTX}; name=ttyTX0; dname=dtyTX0; chr=%txcom_chr%
        mkdev  $name$unit c $chr $(($unit + $dialin )) "" "" $u_uucp
        mkdev $dname$unit c $chr $(($unit + $dialout)) "" "" $u_uucp
        ;;
 
-ttyZ*)
+ttyZ[0-9]*)
        unit=${i#ttyZ}; name=ttyZ; dname=dtyZ; chr=%zstty_chr%
        mkdev  $name$unit c $chr $(($unit + $dialin )) "" "" $u_uucp
        mkdev $dname$unit c $chr $(($unit + $dialout)) "" "" $u_uucp
@@ -1202,7 +1196,7 @@
        done
        ;;
 
-pty*)
+pty[0-9]*)
        class=${i#pty}
        d1="p q r s t u v w x y z P Q R S T"
        if [ "$class" -ge 64 ]
@@ -1251,15 +1245,13 @@
        done



Home | Main Index | Thread Index | Old Index