Source-Changes-HG archive

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

[src/trunk]: src/etc Add warn() to display message to stderr prefixed by the ...



details:   https://anonhg.NetBSD.org/src/rev/79a7d2d5ace6
branches:  trunk
changeset: 556643:79a7d2d5ace6
user:      lukem <lukem%NetBSD.org@localhost>
date:      Mon Dec 22 22:26:32 2003 +0000

description:
Add warn() to display message to stderr prefixed by the script name,
and use appropriately.

diffstat:

 etc/MAKEDEV.tmpl           |  28 +++++++++++++++++-----------
 etc/etc.amiga/MAKEDEV.conf |   4 ++--
 etc/etc.hp300/MAKEDEV.conf |  14 +++++++-------
 etc/etc.pmax/MAKEDEV.conf  |   6 +++---
 etc/etc.vax/MAKEDEV.conf   |  39 ++++++++++++++++++++++-----------------
 5 files changed, 51 insertions(+), 40 deletions(-)

diffs (truncated from 342 to 300 lines):

diff -r a80be49f80be -r 79a7d2d5ace6 etc/MAKEDEV.tmpl
--- a/etc/MAKEDEV.tmpl  Mon Dec 22 21:38:23 2003 +0000
+++ b/etc/MAKEDEV.tmpl  Mon Dec 22 22:26:32 2003 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#      $NetBSD: MAKEDEV.tmpl,v 1.15 2003/12/21 17:37:26 lukem Exp $
+#      $NetBSD: MAKEDEV.tmpl,v 1.16 2003/12/22 22:26:32 lukem Exp $
 #
 # Copyright (c) 2003 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -274,6 +274,9 @@
 #      wsmux*  wscons event multiplexor
 
 
+PATH=/sbin:/usr/sbin:/bin:/usr/bin:/rescue
+
+
 usage()
 {
        cat 1>&2 << _USAGE_
@@ -306,8 +309,6 @@
        MKNOD="${MKNOD} -r"
 fi
 
-PATH=/sbin:/usr/sbin:/bin:/usr/bin:/rescue
-
 u_root="%uid_root%"
 u_uucp="%uid_uucp%"
 g_kmem="%gid_kmem%"
@@ -382,6 +383,11 @@
        fi
 }
 
+warn()
+{
+       echo 1>&2 "$0: $*"
+}
+
 
 
 # makedev special [...]
@@ -742,13 +748,13 @@
        class=${i#pty}
        set -- p q r s t u v w x y z P Q R S T
        if [ "$class" -ge $# ]; then
-               echo "$MAKEDEV: $i: pty unit must be between 0 and 15"
+               warn "$i: pty unit must be between 0 and 15"
                continue
        fi
        shift $class
        name=$1
        if [ "$name" = v ]; then
-               echo "$MAKEDEV: $i: pty unit conflicts with console ttyv0 device."
+               warn "$i: pty unit conflicts with console ttyv0 device"
                continue
        fi
        jn=0
@@ -1118,7 +1124,7 @@
                mkdev par$unit c %par_chr% $unit
                ;;
        *)
-               echo bad unit for par in: $i
+               warn "bad unit for par in: $i"
                ;;
        esac
        ;;
@@ -1187,7 +1193,7 @@
                fi
                ;;
        *)
-               echo bad unit for mouse in: $i
+               warn "bad unit for mouse in: $i"
                ;;
        esac
        ;;
@@ -1321,7 +1327,7 @@
 magma*)
        unit=${i#magma}
        if [ 0$unit -gt 3 ]; then
-               echo "bad unit for $i: $unit"
+               warn "bad unit for $i: $unit"
                break
        fi
        for j in 0 1 2 3 4 5 6 7 8 9 a b c d e f
@@ -1344,7 +1350,7 @@
 clcd*)
        unit=${i#clcd}
        if [ 0$unit -gt 7 ]; then
-               echo "bad unit for $i: $unit"
+               warn "bad unit for $i: $unit"
                break
        fi
        for j in 0 1 2 3 4 5 6 7
@@ -1386,7 +1392,7 @@
                fi
                ;;
        *)
-               echo bad unit for pow in: $i
+               warn "bad unit for pow in: $i"
                ;;
        esac
        ;;
@@ -1408,7 +1414,7 @@
        ;;
 
 *)
-       echo $i: unknown device
+       warn "$i: unknown device"
        ;;
 
 esac
diff -r a80be49f80be -r 79a7d2d5ace6 etc/etc.amiga/MAKEDEV.conf
--- a/etc/etc.amiga/MAKEDEV.conf        Mon Dec 22 21:38:23 2003 +0000
+++ b/etc/etc.amiga/MAKEDEV.conf        Mon Dec 22 22:26:32 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: MAKEDEV.conf,v 1.6 2003/12/21 17:37:26 lukem Exp $
+# $NetBSD: MAKEDEV.conf,v 1.7 2003/12/22 22:26:32 lukem Exp $
 
 all_md)
        makedev wscons std_amiga fd0 fd1 fd2 fd3 kbd mouse0 mouse1 par0
@@ -47,7 +47,7 @@
                mkdev grf$unit  c $chr $unit 666
                ;;
        *)
-               echo bad unit for grf in: $i
+               warn "bad unit for grf in: $i"
                ;;
        esac
 # for those that need it, also make overlay and image devices:
diff -r a80be49f80be -r 79a7d2d5ace6 etc/etc.hp300/MAKEDEV.conf
--- a/etc/etc.hp300/MAKEDEV.conf        Mon Dec 22 21:38:23 2003 +0000
+++ b/etc/etc.hp300/MAKEDEV.conf        Mon Dec 22 22:26:32 2003 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: MAKEDEV.conf,v 1.8 2003/12/21 17:37:26 lukem Exp $
+#      $NetBSD: MAKEDEV.conf,v 1.9 2003/12/22 22:26:32 lukem Exp $
 
 all_md)
        makedev ct0 ct1 rd0 rd1 rd2
@@ -40,7 +40,7 @@
                lndev r${name}${twelve} nr${name}${eight}       ;: ditto
                ;;
        *)
-               echo bad unit for tape in: $1
+               warn "bad unit for tape in: $1"
                ;;
        esac
        ;;
@@ -70,7 +70,7 @@
                lndev hil1 keyboard
                lndev hil3 locator
        fi
-#      echo "hil: use $0.hpux to make HP-UX names for devices"
+#      warn "hil: use $0.hpux to make HP-UX names for devices"
        ;;
 
 rd*)
@@ -91,7 +91,7 @@
        *)      i=-1 ;;
        esac
        if [ $i = -1 ]; then
-               echo bad unit for ttyM in: $unit
+               warn "bad unit for ttyM in: $unit"
                break
        fi
        mkdev ttyM$unit c 15 $i "" "" $u_uucp
@@ -107,7 +107,7 @@
                lndev ttyC0 tty0
                ;;
        *)
-               echo bad unit for dca in: $i
+               warn "bad unit for dca in: $i"
                ;;
        esac
        ;;
@@ -132,7 +132,7 @@
                done
                ;;
        *)
-               echo bad unit for dcm in: $i
+               warn "bad unit for dcm in: $i"
                ;;
        esac
        ;;
@@ -148,7 +148,7 @@
                done
                ;;
        *)
-               echo bad unit for apci in: $i
+               warn "bad unit for apci in: $i"
                ;;
        esac
        ;;
diff -r a80be49f80be -r 79a7d2d5ace6 etc/etc.pmax/MAKEDEV.conf
--- a/etc/etc.pmax/MAKEDEV.conf Mon Dec 22 21:38:23 2003 +0000
+++ b/etc/etc.pmax/MAKEDEV.conf Mon Dec 22 22:26:32 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: MAKEDEV.conf,v 1.4 2003/12/21 17:37:26 lukem Exp $
+# $NetBSD: MAKEDEV.conf,v 1.5 2003/12/22 22:26:32 lukem Exp $
 
 all_md)
        makedev minimal
@@ -36,7 +36,7 @@
                mkdev ttyD3 c $chr 3
                ;;
        *)
-               echo bad unit for $name in: $i
+               warn "bad unit for $name in: $i"
                ;;
        esac
        ;;
@@ -57,7 +57,7 @@
                mkdev ttyd c $chr 3
                ;;
        *)
-               echo bad unit for $name in: $i
+               warn "bad unit for $name in: $i"
                ;;
        esac
        ;;
diff -r a80be49f80be -r 79a7d2d5ace6 etc/etc.vax/MAKEDEV.conf
--- a/etc/etc.vax/MAKEDEV.conf  Mon Dec 22 21:38:23 2003 +0000
+++ b/etc/etc.vax/MAKEDEV.conf  Mon Dec 22 22:26:32 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: MAKEDEV.conf,v 1.5 2003/12/21 17:37:26 lukem Exp $
+# $NetBSD: MAKEDEV.conf,v 1.6 2003/12/22 22:26:32 lukem Exp $
 
 all_md)
        makedev mt0 mt1 ts0 ts1 st0 st1 uk0 ss0 cd0 vt0
@@ -68,7 +68,7 @@
                fi
                ;;
        *)
-               echo bad unit for tape in: $1
+               warn "bad unit for tape in: $1"
                ;;
        esac
        ;;
@@ -96,7 +96,7 @@
                mkdev ${name}${unit}a   b $blk $(($unit * 2 + 1))
                ;;
        *)
-               echo bad unit for uu cassette in: $i
+               warn "bad unit for uu in: $i"
                ;;
        esac
        ;;
@@ -114,7 +114,7 @@
                done
                ;;
        *)
-               echo bad unit for dz in: $i
+               warn "bad unit for dz in: $i"
                ;;
        esac
        ;;
@@ -125,8 +125,9 @@
                unit=${i#vt}
                case $unit in
                0) ch=w ;;
-               *) echo bad unit for $name in: $i ;;
-               esac;;
+               *) warn "bad unit for $name in: $i" ;;
+               esac
+               ;;
        dmz*)   name=dmz; major=37; count=24
                unit=${i#dmz}
                case $unit in
@@ -135,8 +136,9 @@
                2) ch=c ;;
                3) ch=e ;;
                4) ch=f ;;
-               *) echo bad unit for $name in: $i ;;
-               esac;;
+               *) warn "bad unit for $name in: $i" ;;
+               esac
+               ;;
        dmf*)   name=dmf; major=22; count=8
                unit=${i#dmf}
                case $unit in
@@ -148,8 +150,9 @@
                5) ch=G ;;
                6) ch=H ;;
                7) ch=I ;;
-               *) echo bad unit for $name in: $i ;;
-               esac;;
+               *) warn "bad unit for $name in: $i" ;;
+               esac
+               ;;
        dhu*)   name=dhu; major=34; count=16
                unit=${i#dhu}
                case $unit in
@@ -161,8 +164,9 @@
                5) ch=X ;;
                6) ch=Y ;;
                7) ch=Z ;;
-               *) echo bad unit for $name in: $i ;;
-               esac;;
+               *) warn "bad unit for $name in: $i" ;;
+               esac
+               ;;



Home | Main Index | Thread Index | Old Index