[SM-Commit] GIT changes to master grimoire by Vlad Glagolev (5e7fbc6afe1b4619d2b884d569d44db19571f9e3)

Vlad Glagolev scm at sourcemage.org
Sun Aug 31 18:24:14 EDT 2008


GIT changes to master grimoire by Vlad Glagolev <stealth at sourcemage.org>:

 utils/kbd/BUILD                        |   10 --
 utils/kbd/CONFIGURE                    |    3 
 utils/kbd/CONFLICTS                    |    4 
 utils/kbd/DEPENDS                      |   16 +--
 utils/kbd/DETAILS                      |   15 +--
 utils/kbd/HISTORY                      |   19 +++-
 utils/kbd/INSTALL                      |    4 
 utils/kbd/PRE_BUILD                    |   11 --
 utils/kbd/configure.patch              |   11 ++
 utils/kbd/gcc4_fix.patch               |   46 ---------
 utils/kbd/init.d/keymap.sh             |   14 +--
 utils/kbd/init.d/log2cons              |   19 ----
 utils/kbd/kbd-1.12-kbd_repeat-v2.patch |   27 -----
 utils/kbd/keymaps.diff                 |   16 ---
 utils/kbd/logcolorise.pl               |  153 ---------------------------------
 utils/kbd/logcolorize.pl               |  152 ++++++++++++++++++++++++++++++++
 utils/kbd/tailfmessages                |    4 
 17 files changed, 214 insertions(+), 310 deletions(-)

New commits:
commit 5e7fbc6afe1b4619d2b884d569d44db19571f9e3
Author: Vlad Glagolev <stealth at sourcemage.org>
Commit: Vlad Glagolev <stealth at sourcemage.org>

    kbd: => 1.14.1 + lots of fixes

diff --git a/utils/kbd/BUILD b/utils/kbd/BUILD
index c41a564..de7418a 100755
--- a/utils/kbd/BUILD
+++ b/utils/kbd/BUILD
@@ -1,9 +1,3 @@
-./configure  --prefix=$TRACK_ROOT/usr               \
-            --datadir=$TRACK_ROOT/usr/share         \
-             --mandir=$TRACK_ROOT/usr/share/man     &&
+OPTS="$KBD_OPT $OPTS" &&
 
-if  echo  $OPTS  |  grep  -q  --  "--without-nls";  then
-  sedit  's:#define ENABLE_NLS::'  defines.h
-fi  &&
-
-make DESTDIR=$INSTALL_ROOT
+default_build
diff --git a/utils/kbd/CONFIGURE b/utils/kbd/CONFIGURE
new file mode 100755
index 0000000..3e7245f
--- /dev/null
+++ b/utils/kbd/CONFIGURE
@@ -0,0 +1,3 @@
+config_query_option KBD_OPT "Build and install optional programs?" n \
+                            "--enable-optional-progs" \
+                            "--disable-optional-progs"
diff --git a/utils/kbd/CONFLICTS b/utils/kbd/CONFLICTS
index 6f6d05f..1a05c9d 100755
--- a/utils/kbd/CONFLICTS
+++ b/utils/kbd/CONFLICTS
@@ -1,2 +1,2 @@
-conflicts  console-tools
-conflicts  console-data
+conflicts console-tools &&
+conflicts console-data
diff --git a/utils/kbd/DEPENDS b/utils/kbd/DEPENDS
index a8f3962..73f4aa3 100755
--- a/utils/kbd/DEPENDS
+++ b/utils/kbd/DEPENDS
@@ -1,11 +1,7 @@
-depends  gnupg     &&
-depends  smgl-fhs  &&
+depends gnupg &&
+depends smgl-fhs &&
 
-# to fix bug #12830, to be removed eventually (during stable-rc 0.7 
-# should be sufficient)
-depends  init.d  &&
-
-optional_depends  gettext                        \
-                  "--with-nls"                   \
-                  "--without-nls"                \
-                  "for Native Language Support"
+optional_depends gettext \
+                 "--enable-nls" \
+                 "--disable-nls" \
+                 "for Native Language Support"
diff --git a/utils/kbd/DETAILS b/utils/kbd/DETAILS
index 7630d90..6bcd5c1 100755
--- a/utils/kbd/DETAILS
+++ b/utils/kbd/DETAILS
@@ -1,16 +1,15 @@
            SPELL=kbd
-         VERSION=1.12
-          SOURCE=${SPELL}-${VERSION}.tar.gz
-SOURCE_DIRECTORY=${BUILD_DIRECTORY}/${SPELL}-${VERSION}
-   SOURCE_URL[0]=ftp://ftp.win.tue.nl/pub/linux-local/utils/${SPELL}/${SOURCE}
-     SOURCE_HASH=sha512:b0c86b7ccb5e03edfeacf12153fe045aca496aaaf1638bd680fc23db23e59c0acf14868597c4f3e4b60ddb405843cbea010e06176c453a191c067517a117f26b
+         VERSION=1.14.1
+          SOURCE=$SPELL-$VERSION.tar.gz
+SOURCE_DIRECTORY="$BUILD_DIRECTORY/$SPELL-$VERSION"
+   SOURCE_URL[0]=ftp://ftp.altlinux.org/pub/people/legion/$SPELL/$SOURCE
+     SOURCE_HASH=sha512:a98cfbf874d9d34995c39fb99c8db9d503d92401ed932fa1503493fccc8ae3932fe0fca7301252fe704a79fcb020e385776d9b9b3e7275a77a4468b59f4c2669
         WEB_SITE=http://freshmeat.net/projects/kbd/
          ENTERED=20011113
-      PATCHLEVEL=3
       LICENSE[0]=GPL
         KEYWORDS="utils"
-           SHORT="Keytable files and keyboard utilities"
+           SHORT="keytable files and keyboard utilities"
 cat << EOF
 The kbd package contains keytable files and keyboard utilities compatible with
-kernel version 1.1.54 and later.  Setfont requires 1.1.92 or later.
+kernel version 1.1.54 and later. Setfont requires 1.1.92 or later.
 EOF
diff --git a/utils/kbd/HISTORY b/utils/kbd/HISTORY
index cb7e0a8..745441c 100644
--- a/utils/kbd/HISTORY
+++ b/utils/kbd/HISTORY
@@ -1,3 +1,21 @@
+2008-09-01 Vlad Glagolev <stealth at sourcemage.org>
+	* DETAILS: updated spell to 1.14.1; fixed SOURCE_URL[0], WEB_SITE (new
+	  maintainer); fixed short desc; cleaned up; quoting the paths
+	* BUILD: added OPTS for CONFIGURE; removed useless stuff; cleaned up
+	* gcc4_fix.patch, keymaps.diff, kbd-1.12-kbd_repeat-v2.patch: removed,
+	  not needed anymore (fixed by upstream)
+	* CONFIGURE: added the flags for optional progs selection
+	* DEPENDS: fixed the flags; cleaned up
+	* CONFLICTS: cleaned up
+	* INSTALL: default_install + logcolorize script
+	* PRE_BUILD: applied configure.patch for missing binaries; cleaned up
+	* init.d/keymap.sh: fixed a path for loadkeys binary
+	* configure.patch: added
+	* logcolorise.pl: renamed to logcolorize.pl
+	* init.d/log2cons: removed, extrascript a.k.a. "dirty hack" for the
+	  regular usage
+	* tailfmessages: removed, we don't need excessive files in the spell
+
 2007-02-14 Eric Sandall <sandalle at sourcemage.org>
 	* PRE_BUILD: Apply kbd_repeat patch
 	* kbd-1.12-kbd_repeat-v2.patch: Patch from Gentoo obtained at
@@ -127,4 +145,3 @@
 	* POST_INSTALL,POST_REMOVE: Cleaned up
 	* CONFLICTS: added console-data
 	* HISTORY: Added
-
diff --git a/utils/kbd/INSTALL b/utils/kbd/INSTALL
index fd35bcf..29c06b0 100755
--- a/utils/kbd/INSTALL
+++ b/utils/kbd/INSTALL
@@ -1 +1,3 @@
-make install DESTDIR=$INSTALL_ROOT
+default_install &&
+
+install -vm 755 "$SPELL_DIRECTORY/logcolorize.pl" "$INSTALL_ROOT/usr/bin"
diff --git a/utils/kbd/PRE_BUILD b/utils/kbd/PRE_BUILD
index 3bd17e2..0e14e28 100755
--- a/utils/kbd/PRE_BUILD
+++ b/utils/kbd/PRE_BUILD
@@ -1,9 +1,4 @@
-default_pre_build                                              &&
-cd $SOURCE_DIRECTORY                                           &&
-patch  -p1  data/Makefile  $SCRIPT_DIRECTORY/keymaps.diff      &&
-patch  -p1  <  $SCRIPT_DIRECTORY/kbd-1.12-kbd_repeat-v2.patch  &&
+default_pre_build &&
+cd "$SOURCE_DIRECTORY" &&
 
-# Fix for gcc4
-if use_gcc ^4; then
-  patch -p0 < $SCRIPT_DIRECTORY/gcc4_fix.patch
-fi
+patch -p0 < "$SPELL_DIRECTORY/configure.patch"
diff --git a/utils/kbd/configure.patch b/utils/kbd/configure.patch
new file mode 100644
index 0000000..80a6d4f
--- /dev/null
+++ b/utils/kbd/configure.patch
@@ -0,0 +1,11 @@
+--- src/Makefile.in.orig
++++ src/Makefile.in
+@@ -2,6 +2,8 @@ prefix         = @prefix@
+ exec_prefix    = @exec_prefix@
+ bindir         = $(DESTDIR)@bindir@
+ datarootdir    = @datarootdir@
++KEYCODES_PROGS = @KEYCODES_PROGS@
++RESIZECONS_PROGS = @RESIZECONS_PROGS@
+ OPTIONAL_PROGS = @OPTIONAL_PROGS@
+ 
+ # Something like /usr/lib/kbd or /usr/share/kbd
diff --git a/utils/kbd/gcc4_fix.patch b/utils/kbd/gcc4_fix.patch
deleted file mode 100644
index e266184..0000000
--- a/utils/kbd/gcc4_fix.patch
+++ /dev/null
@@ -1,46 +0,0 @@
---- src/psffontop.c	2006-03-12 12:35:42.000000000 +0200
-+++ src/psffontop.c.new	2006-03-12 12:32:01.000000000 +0200
-@@ -59,7 +59,6 @@
- 
- static unsigned int
- assemble_ucs2(char **inptr, int cnt) {
--	unsigned char **in = (unsigned char **) inptr;
- 	unsigned int u1, u2;
- 
- 	if (cnt < 2) {
-@@ -68,8 +67,8 @@
- 		exit(EX_DATAERR);
- 	}
- 
--	u1 = *(*in)++;
--	u2 = *(*in)++;
-+	u1 = (unsigned char)*(*inptr)++;
-+	u2 = (unsigned char)*(*inptr)++;
- 	return (u1 | (u2 << 8));
- }
- 
-@@ -110,7 +109,6 @@
-  */
- static void
- get_uni_entry(char **inptr, char **endptr, struct unicode_list *up, int utf8) {
--	unsigned char **in = (unsigned char **) inptr;
- 	unsigned char uc;
- 	unicode unichar;
- 	int inseq = 0;
-@@ -126,14 +124,14 @@
- 			exit(EX_DATAERR);
- 		}
- 		if (utf8) {
--			uc = *(*in)++;
-+			uc = *(*inptr)++;
- 			if (uc == PSF2_SEPARATOR)
- 				break;
- 			if (uc == PSF2_STARTSEQ) {
- 				inseq = 1;
- 				continue;
- 			}
--			--(*in);
-+			--(*inptr);
- 			unichar = assemble_utf8(inptr, *endptr - *inptr);
- 		} else {
- 			unichar = assemble_ucs2(inptr, *endptr - *inptr);
diff --git a/utils/kbd/init.d/keymap.sh b/utils/kbd/init.d/keymap.sh
index 874c8ac..79342c6 100755
--- a/utils/kbd/init.d/keymap.sh
+++ b/utils/kbd/init.d/keymap.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-PROGRAM=/bin/loadkeys
+PROGRAM=/usr/bin/loadkeys
 RUNLEVEL=S
 NEEDS="+local_fs"
 RECOMMENDED=yes
@@ -16,10 +16,10 @@ start()
   [[ "$TTY_NUMS" ]] && [[ "$SETFONT_ARGS" ]] &&
     required_executable /usr/bin/setfont
   [[ "$KEYMAP$INCLUDEMAPS" ]] &&
-    required_executable /bin/loadkeys
+    required_executable /usr/bin/loadkeys
 
   if [[ "$KEYMAP" ]]; then
-    echo "$(/bin/loadkeys $KEYMAP 2>&1)"
+    echo "$(/usr/bin/loadkeys $KEYMAP 2>&1)"
     evaluate_retval
   fi
 
@@ -27,7 +27,7 @@ start()
     [[ $(find /usr/share/kbd/keymaps/ -type f -name "$a.inc*" 2>/dev/null) ]] &&
     [[ ! $(find /usr/share/kbd/keymaps/ -type f -name "$a.map*" 2>/dev/null) ]] &&
       a="$a.inc"
-    echo "$(/bin/loadkeys $a 2>&1)"
+    echo "$(/usr/bin/loadkeys $a 2>&1)"
     evaluate_retval
   done
 
@@ -36,7 +36,7 @@ start()
   if [[ "$UNICODE_START" ]]; then
     required_executable /usr/bin/unicode_start
     /usr/bin/kbd_mode -u
-    /usr/bin/dumpkeys | /bin/loadkeys --unicode
+    /usr/bin/dumpkeys | /usr/bin/loadkeys --unicode
   fi
 
   if [[ "$TTY_NUMS" == '*' ]]; then
@@ -70,8 +70,8 @@ stop()
   [[ -f $dropfile ]] && . $dropfile && rm $dropfile
 
   [[ "$KEYMAP$INCLUDEMAPS" ]] &&
-    required_executable /bin/loadkeys &&
-    echo "$(/bin/loadkeys defkeymap 2>&1)"
+    required_executable /usr/bin/loadkeys &&
+    echo "$(/usr/bin/loadkeys defkeymap 2>&1)"
 
   [[ "$UNICODE_START" ]] &&
     required_executable /usr/bin/unicode_stop &&
diff --git a/utils/kbd/init.d/log2cons b/utils/kbd/init.d/log2cons
deleted file mode 100644
index 0f54fa4..0000000
--- a/utils/kbd/init.d/log2cons
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-RUNLEVEL=3
-PROGRAM=/bin/false
-NEEDS="+local_fs +syslog"
-LOGCONSOLE=/devices/vc/10
-
-. /etc/init.d/smgl_init
-
-start()
-{
-  /bin/tail -n 64 -f /var/log/messages | logcolorise.pl > $LOGCONSOLE &
-}
-              
-stop()
-{
-  killall logcolorise.pl
-  killall tail
-}
diff --git a/utils/kbd/kbd-1.12-kbd_repeat-v2.patch b/utils/kbd/kbd-1.12-kbd_repeat-v2.patch
deleted file mode 100644
index 3e7f11d..0000000
--- a/utils/kbd/kbd-1.12-kbd_repeat-v2.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Linux is nice and changes around core structures :)
-
---- kbd-1.12/src/kbdrate.c	Fri Jan 16 20:45:31 2004
-+++ kbd-1.12.kbdrate/src/kbdrate.c	Sun Feb  8 14:52:04 2004
-@@ -164,10 +169,10 @@
- 		exit( 1 );
- 	}
- 
--	kbdrate_s.period = (int) (rate + 0.5);  /* round up */
-+	kbdrate_s.rate = (int) (rate + 0.5);  /* round up */
- 	kbdrate_s.delay = delay * HZ / 1000;  /* convert ms to Hz */
--	if (kbdrate_s.period > 50)
--		kbdrate_s.period = 50;
-+	if (kbdrate_s.rate > 50)
-+		kbdrate_s.rate = 50;
- 
- 	if (ioctl( fd, KIOCSRATE, &kbdrate_s )) {
- 		perror( "ioctl(KIOCSRATE)" );
-@@ -177,7 +182,7 @@
- 
- 	if (!silent)
- 		printf( "Typematic Rate set to %d cps (delay = %d ms)\n",
--			kbdrate_s.period, kbdrate_s.delay * 1000 / HZ );
-+			kbdrate_s.rate, kbdrate_s.delay * 1000 / HZ );
- 
- 	return 1;
- #else /* no KIOCSRATE */
diff --git a/utils/kbd/keymaps.diff b/utils/kbd/keymaps.diff
deleted file mode 100644
index 28190b0..0000000
--- a/utils/kbd/keymaps.diff
+++ /dev/null
@@ -1,16 +0,0 @@
-diff -Naur kbd-1.12.orig/data/Makefile kbd-1.12/data/Makefile
---- kbd-1.12.orig/data/Makefile	2005-04-28 15:16:46.446294848 -0700
-+++ kbd-1.12/data/Makefile	2005-04-28 15:30:03.916061016 -0700
-@@ -29,7 +29,11 @@
- # compress data files - do not touch the distribution but copy first
- $(KEYMAPDIR)_Z:
- 	cp -r $(KEYMAPDIR) $(KEYMAPDIR)_Z
--	cd $(KEYMAPDIR)_Z && $(MYGZIP) */*.map */*/*.map
-+	for i in $(KEYMAPSUBDIRS); do \
-+		if [ "$$i"  !=  "include" ]; then\
-+		cd  $(KEYMAPDIR)_Z/$$i  &&  $(MYGZIP) *.map  &&  cd  -;\
-+		fi;\
-+	done
- 
- $(FONTDIR)_Z:
- 	cp -r $(FONTDIR) $(FONTDIR)_Z
diff --git a/utils/kbd/logcolorise.pl b/utils/kbd/logcolorise.pl
deleted file mode 100755
index dab4a22..0000000
--- a/utils/kbd/logcolorise.pl
+++ /dev/null
@@ -1,153 +0,0 @@
-#!/usr/bin/perl
-# logcolorize.pl 1.0.8 - A PERL script to colorize log viewing
-#
-# Copyright: (C) 1999, Michael T. Babcock
-#                      <mikebabcock at pobox.com>
-#                      http://www.linuxsupportline.com/~pgp/linux/
-#
-#   This program is free software; you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation; either version 2 of the License, or
-#   (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY; without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#   GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program; if not, write to the Free Software
-#   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-#
-#   For revisional changes, see ChangeLog file
-#
-######################################################################
-$black    = "\033[30m";
-$red      = "\033[31m";
-$green    = "\033[32m";
-$yellow   = "\033[33m";
-$blue     = "\033[34m";
-$magenta  = "\033[35m";
-$purple   = "\033[35m";
-$cyan     = "\033[36m";
-$white    = "\033[37m";
-$darkgray = "\033[30m";
-
-# Define global terms:
-# Define good notables:
- at word_good=("starting\n", "Freeing", "Detected", "starting.", "accepted.\n", "authenticated.\n", "Ready", "active", "reloading", "saved;", "restarting", "ONLINE\n");
- at word_warn=("dangling", "closed.\n", "Assuming", "root", "root\n", "exiting\n", "missing", "Ignored", "adminalert:", "deleting", "OFFLINE\n");
- at word_bad=("bad");
- at word_note=("LOGIN", "DHCP_OFFER", "optimized", "reset:", "unloaded", "disconnected", "connect", "Successful", "registered\n");
- at line_good=("up", "DHCP_ACK", "Cleaned", "Initializing", "Starting", "success", "successfully", "alive", "found", "ONLINE\n");
- at line_warn=("warning:", "WARNING:", "invalid", "obsolete", "bad", "Password", "detected", "timeout", "timeout:", "attackalert:", "wrong", "Lame", "FAILED", "failing", "unknown", "obsolete", "stopped.\n", "terminating.", "disabled\n", "disabled", "Lost");
- at line_bad=("DENY", "lost", "shutting", "dead", "DHCP_NAK", "failure;", "Unable", "inactive", "terminating", "refused", "rejected", "down", "OFFLINE\n", "error\n", "ERROR\n", "ERROR:", "error", "ERROR", "error:", "failed:");
-
-# Define specifics:
- at daemons=("named");
-
-# Now define what we want to use when:
-$col_good = $green;
-$col_warn = $yellow;
-$col_bad = $red;
-$col_note = $purple;
-
-$col_norm =		"\033[00m";
-$col_background =	"\033[07m";
-$col_brighten = 	"\033[01m";
-$col_underline = 	"\033[04m";
-$col_blink = 		"\033[05m";
-
-# Resets to normal colours and moves to the left one column ... 
-$col_default = "$col_norm$white";
-print "\n$col_norm$cyan";
-print "logcolorize.pl 1.0.8 by$col_brighten$cyan Michael T. Babcock$col_norm$cyan <$col_brighten$green";
-print "mikebabcock\@pobox.com$col_norm$cyan";
-print ">\n";
-
-$datespace=0;
-
-mainloop: while (<>)
-{
-	$thisline = $_;
-
-	$timestamp = substr($_,0,15);
-	s/................//;
-
-	@rec = split (/ /, $_);
-
-	$output="$col_brighten$cyan$timestamp";	# date & time
-	$output.=" $col_brighten$blue$rec[0]";	# hostname
-	if ($rec[1] eq "last")
-	{
-		$output.="$col_norm$green last message repeated ";
-		$output.="$col_brighten$rec[4]$col_norm$green times\n";
-		print "$output$col_default";
-		next mainloop;
-	}
-	# Extract PID if present
-	if ($rec[1] =~ /\[(\d+)\]\:/)
-	{
-		my($pid) = $1;
-		$rec[1]=~s/\[$1\]\:// ;
-		$output .= "$col_norm$green $rec[1]" .
-		           "$col_brighten$green\[";
-		$output .= "$col_brighten$white$pid" .
-		           "$col_brighten$green\]: ";
-	}
-	else {
-		$output .= "$col_norm$green $rec[1] ";
-	}
-
-	$restcolor="$col_norm$cyan";
-	$restoftheline="";
-	for ($therest=(2); $therest<=$#rec; $therest++)
-	{	$highlight=0;
-
-		# Check for keywords to highlight
-
-		for ($i=0; $i<=$#word_good; $i++)
-		{	if ($word_good[$i] eq $rec[$therest])
-			{ $restoftheline.="$col_brighten$col_good"; $highlight=1; }
-		}
-		for ($i=0; $i<=$#word_warn; $i++)
-		{	if ($word_warn[$i] eq $rec[$therest])
-			{ $restoftheline.="$col_brighten$col_warn"; $highlight=1; } 
-		}
-		for ($i=0; $i<=$#word_bad; $i++)
-		{	if ($word_bad[$i] eq $rec[$therest])
-			{ $restoftheline.="$col_brighten$col_bad"; $highlight=1; } 
-		}
-		for ($i=0; $i<=$#word_note; $i++) 
-		{	if ($word_note[$i] eq $rec[$therest])
-			{ $restoftheline.="$col_brighten$col_note"; $highlight=1; } 
-		}
-
-		# Watch for words that indicate entire lines should be highlighted
-
-		for ($i=0; $i<=$#line_good; $i++)
-		{	if ($line_good[$i] eq $rec[$therest])
-			{ $restcolor="$col_norm$col_good";
-			  $restoftheline.="$col_brighten$col_good"; $highlight=1; }
-		}
-		for ($i=0; $i<=$#line_warn; $i++)
-		{	if ($line_warn[$i] eq $rec[$therest])
-			{ $restcolor="$col_norm$col_warn";
-			  $restoftheline.="$col_brighten$col_warn"; $highlight=1; }
-		}
-		for ($i=0; $i<=$#line_bad; $i++)
-		{	if ($line_bad[$i] eq $rec[$therest])
-			{ $restcolor="$col_norm$col_bad";
-			  $restoftheline.="$col_brighten$col_bad"; $highlight=1; }
-		}
-
-		$restoftheline.="$rec[$therest] ";
-		if ($highlight == 1)
-		{ $restoftheline.=$restcolor; }
-	}
-	$output.="$restcolor$restoftheline";
-	print "$output$col_default\033[1G";
-}
-
-exit(0);
-
diff --git a/utils/kbd/logcolorize.pl b/utils/kbd/logcolorize.pl
new file mode 100755
index 0000000..3f3e1e6
--- /dev/null
+++ b/utils/kbd/logcolorize.pl
@@ -0,0 +1,152 @@
+#!/usr/bin/perl
+# logcolorize.pl 1.0.8 - A PERL script to colorize log viewing
+#
+# Copyright: (C) 1999, Michael T. Babcock
+#                      <mikebabcock at pobox.com>
+#                      http://www.linuxsupportline.com/~pgp/linux/
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#   For revisional changes, see ChangeLog file
+#
+######################################################################
+$black    = "\033[30m";
+$red      = "\033[31m";
+$green    = "\033[32m";
+$yellow   = "\033[33m";
+$blue     = "\033[34m";
+$magenta  = "\033[35m";
+$purple   = "\033[35m";
+$cyan     = "\033[36m";
+$white    = "\033[37m";
+$darkgray = "\033[30m";
+
+# Define global terms:
+# Define good notables:
+ at word_good=("starting\n", "Freeing", "Detected", "starting.", "accepted.\n", "authenticated.\n", "Ready", "active", "reloading", "saved;", "restarting", "ONLINE\n");
+ at word_warn=("dangling", "closed.\n", "Assuming", "root", "root\n", "exiting\n", "missing", "Ignored", "adminalert:", "deleting", "OFFLINE\n");
+ at word_bad=("bad");
+ at word_note=("LOGIN", "DHCP_OFFER", "optimized", "reset:", "unloaded", "disconnected", "connect", "Successful", "registered\n");
+ at line_good=("up", "DHCP_ACK", "Cleaned", "Initializing", "Starting", "success", "successfully", "alive", "found", "ONLINE\n");
+ at line_warn=("warning:", "WARNING:", "invalid", "obsolete", "bad", "Password", "detected", "timeout", "timeout:", "attackalert:", "wrong", "Lame", "FAILED", "failing", "unknown", "obsolete", "stopped.\n", "terminating.", "disabled\n", "disabled", "Lost");
+ at line_bad=("DENY", "lost", "shutting", "dead", "DHCP_NAK", "failure;", "Unable", "inactive", "terminating", "refused", "rejected", "down", "OFFLINE\n", "error\n", "ERROR\n", "ERROR:", "error", "ERROR", "error:", "failed:");
+
+# Define specifics:
+ at daemons=("named");
+
+# Now define what we want to use when:
+$col_good = $green;
+$col_warn = $yellow;
+$col_bad = $red;
+$col_note = $purple;
+
+$col_norm =		"\033[00m";
+$col_background =	"\033[07m";
+$col_brighten = 	"\033[01m";
+$col_underline = 	"\033[04m";
+$col_blink = 		"\033[05m";
+
+# Resets to normal colours and moves to the left one column ... 
+$col_default = "$col_norm$white";
+print "\n$col_norm$cyan";
+print "logcolorize.pl 1.0.8 by$col_brighten$cyan Michael T. Babcock$col_norm$cyan <$col_brighten$green";
+print "mikebabcock\@pobox.com$col_norm$cyan";
+print ">\n";
+
+$datespace=0;
+
+mainloop: while (<>)
+{
+	$thisline = $_;
+
+	$timestamp = substr($_,0,15);
+	s/................//;
+
+	@rec = split (/ /, $_);
+
+	$output="$col_brighten$cyan$timestamp";	# date & time
+	$output.=" $col_brighten$blue$rec[0]";	# hostname
+	if ($rec[1] eq "last")
+	{
+		$output.="$col_norm$green last message repeated ";
+		$output.="$col_brighten$rec[4]$col_norm$green times\n";
+		print "$output$col_default";
+		next mainloop;
+	}
+	# Extract PID if present
+	if ($rec[1] =~ /\[(\d+)\]\:/)
+	{
+		my($pid) = $1;
+		$rec[1]=~s/\[$1\]\:// ;
+		$output .= "$col_norm$green $rec[1]" .
+		           "$col_brighten$green\[";
+		$output .= "$col_brighten$white$pid" .
+		           "$col_brighten$green\]: ";
+	}
+	else {
+		$output .= "$col_norm$green $rec[1] ";
+	}
+
+	$restcolor="$col_norm$cyan";
+	$restoftheline="";
+	for ($therest=(2); $therest<=$#rec; $therest++)
+	{	$highlight=0;
+
+		# Check for keywords to highlight
+
+		for ($i=0; $i<=$#word_good; $i++)
+		{	if ($word_good[$i] eq $rec[$therest])
+			{ $restoftheline.="$col_brighten$col_good"; $highlight=1; }
+		}
+		for ($i=0; $i<=$#word_warn; $i++)
+		{	if ($word_warn[$i] eq $rec[$therest])
+			{ $restoftheline.="$col_brighten$col_warn"; $highlight=1; } 
+		}
+		for ($i=0; $i<=$#word_bad; $i++)
+		{	if ($word_bad[$i] eq $rec[$therest])
+			{ $restoftheline.="$col_brighten$col_bad"; $highlight=1; } 
+		}
+		for ($i=0; $i<=$#word_note; $i++) 
+		{	if ($word_note[$i] eq $rec[$therest])
+			{ $restoftheline.="$col_brighten$col_note"; $highlight=1; } 
+		}
+
+		# Watch for words that indicate entire lines should be highlighted
+
+		for ($i=0; $i<=$#line_good; $i++)
+		{	if ($line_good[$i] eq $rec[$therest])
+			{ $restcolor="$col_norm$col_good";
+			  $restoftheline.="$col_brighten$col_good"; $highlight=1; }
+		}
+		for ($i=0; $i<=$#line_warn; $i++)
+		{	if ($line_warn[$i] eq $rec[$therest])
+			{ $restcolor="$col_norm$col_warn";
+			  $restoftheline.="$col_brighten$col_warn"; $highlight=1; }
+		}
+		for ($i=0; $i<=$#line_bad; $i++)
+		{	if ($line_bad[$i] eq $rec[$therest])
+			{ $restcolor="$col_norm$col_bad";
+			  $restoftheline.="$col_brighten$col_bad"; $highlight=1; }
+		}
+
+		$restoftheline.="$rec[$therest] ";
+		if ($highlight == 1)
+		{ $restoftheline.=$restcolor; }
+	}
+	$output.="$restcolor$restoftheline";
+	print "$output$col_default\033[1G";
+}
+
+exit(0);
diff --git a/utils/kbd/tailfmessages b/utils/kbd/tailfmessages
deleted file mode 100755
index 2e5b923..0000000
--- a/utils/kbd/tailfmessages
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-clear
-/bin/tail -n 30 -f /var/log/messages | /usr/bin/logcolorise.pl
-



More information about the SM-Commit mailing list