Index: TODO
===================================================================
RCS file: /home/cvsroot/scsidev/TODO,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- TODO	14 Jul 2000 23:59:35 -0000	1.3
+++ TODO	4 Oct 2002 12:22:04 -0000	1.3.2.1
@@ -1,4 +1,4 @@
-TODO ($Id: TODO,v 1.3 2000/07/14 23:59:35 garloff Exp $)
+TODO ($Id: TODO,v 1.3.2.1 2002/10/04 12:22:04 garloff Exp $)
 ====
 
 * Update README file.
@@ -11,5 +11,6 @@
   - Set up relations
 * A completely different approach would use /proc/scsi/scsi.
   This should be even more safe.
+  => DONE in 2.25.
   Probably this could be done in a little perl or bash script.
   
Index: VERSION
===================================================================
RCS file: /home/cvsroot/scsidev/VERSION,v
retrieving revision 1.8.2.5
retrieving revision 1.8.2.6
diff -u -r1.8.2.5 -r1.8.2.6
--- VERSION	7 Aug 2002 09:09:19 -0000	1.8.2.5
+++ VERSION	4 Oct 2002 09:26:47 -0000	1.8.2.6
@@ -1 +1 @@
-2.27
+2.28
Index: boot.scsidev
===================================================================
RCS file: /home/cvsroot/scsidev/Attic/boot.scsidev,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- boot.scsidev	29 Jul 2002 23:56:28 -0000	1.1.2.1
+++ boot.scsidev	4 Oct 2002 12:19:42 -0000	1.1.2.2
@@ -13,7 +13,7 @@
 # Default-Start:     B
 # Default-Stop:
 # Short-Description: set up /dev/scsi/ 
-# Description:       scsidev creates persistenit device nodes
+# Description:       scsidev creates persistent device nodes
 #	in /dev/scsi/ even if your SCSI config changes.
 ### END INIT INFO
 
Index: scsidev.8
===================================================================
RCS file: /home/cvsroot/scsidev/scsidev.8,v
retrieving revision 1.11.2.2
retrieving revision 1.11.2.4
diff -u -r1.11.2.2 -r1.11.2.4
--- scsidev.8	30 Jul 2002 08:21:53 -0000	1.11.2.2
+++ scsidev.8	4 Oct 2002 12:20:37 -0000	1.11.2.4
@@ -1,8 +1,8 @@
 #
-# $Id: scsidev.8,v 1.11.2.2 2002/07/30 08:21:53 garloff Exp $
+# $Id: scsidev.8,v 1.11.2.4 2002/10/04 12:20:37 garloff Exp $
 #
 .\" -*- nroff -*-
-.TH SCSIDEV 8 "July 2002" "Version 2.25"
+.TH SCSIDEV 8 "October 2002" "Version 2.28"
 .SH NAME
 scsidev \- populate /dev/scsi with device names that are independent of reconfiguration.
 .SH SYNOPSIS
@@ -32,6 +32,9 @@
 .B \-r
 ]
 [
+.B \-M
+]
+[
 .B \-e
 ]
 [
@@ -157,6 +160,14 @@
 removed devices from your SCSI config, it isn't safe any longer.
 This is only needed, if you don't have the /proc/scsi/scsi extensions
 for large disks.
+.TP
+.I \-M
+Multipath support.
+.B scsidev
+normally does complain if a line in scsi.alias matches more than one device
+and does not create an alias then. With multipatch support on, it just
+creates the alias for the first device found matching the description
+in the scsi.alias description.
 .TP
 .I \-e
 Instructs 
Index: scsidev.c
===================================================================
RCS file: /home/cvsroot/scsidev/scsidev.c,v
retrieving revision 1.28.2.19
retrieving revision 1.28.2.21
diff -u -r1.28.2.19 -r1.28.2.21
--- scsidev.c	7 Aug 2002 09:09:19 -0000	1.28.2.19
+++ scsidev.c	4 Oct 2002 12:42:09 -0000	1.28.2.21
@@ -101,6 +101,11 @@
  *    - Fix usage message
  *  -> 2.27
  * 
+ *  * 2002-10-04: Kurt Garloff <garloff@suse.de>
+ *    - Bugfix from Olaf Hering (don't use arg twice in sscanf)
+ *    - Multipathing support
+ *    - Fix Medium Changer (and other device types with spaces) detection 
+ *  -> 2.28
  */
 
 #include <stdio.h>
@@ -121,8 +126,8 @@
 #include <ctype.h>
 
 
-static char rcsid[] ="$Id: scsidev.c,v 1.28.2.19 2002/08/07 09:09:19 garloff Exp $";
-static char *versid = "scsidev " VERSION " 2002/08/07";
+static char rcsid[] ="$Id: scsidev.c,v 1.28.2.21 2002/10/04 12:42:09 garloff Exp $";
+static char *versid = "scsidev " VERSION " 2002-10-04";
 static char *copyright = "Copyright: GNU GPL  (see file COPYING)\n" \
 " (w)  1994--1997 Eric Youngdale <eric@andante.org>\n"\
 "      2000--2002 Kurt Garloff   <garloff@suse.de>";
@@ -158,6 +163,7 @@
 int no_procscsi = 0;
 int nm_cbtu = 0;
 int supp_rmvbl = 0;
+int supp_multi = 0;
 int override_link_perm = 1;
 char * no_serial = "No serial number";
 unsigned long long no_wwid = 0;
@@ -1412,8 +1418,9 @@
 	spnt->manufacturer = strdup (vendor);
 	spnt->model = strdup (product);
 	spnt->rev = strdup (rev);
-	sscanf (fourlnbuf[2], "  Type: %20s ANSI SCSI revision: %d",
+	sscanf (fourlnbuf[2], "  Type: %20c ANSI SCSI revision: %d",
 		devtype, &ansi);
+	devtype [20] = 0; rmv_trail_ws (devtype);
 	spnt->inq_devtp = linux_to_devtp (devtype);
 	if (!fourlnbuf[3][0])
 		return 0;
@@ -1594,8 +1601,7 @@
 		ptr = fgets (pline, 128, pf);
 		if (!ptr)
 			break;
-		blk = sscanf (pline, " %d %d %d %8s", &maj, &min, &blk, nm);
-		if (blk < 4)
+		if (sscanf (pline, " %d %d %d %8s", &maj, &min, &blk, nm) < 4)
 			continue;
 		
 		/* Strip part */
@@ -1862,6 +1868,7 @@
     fprintf (stderr, " -c mxms: Continue scanning until mxms missing devs found\n");
     fprintf (stderr, " -r     : trust Removeable media (only safe after boot)\n");
     fprintf (stderr, " -e     : use dEvfs like naming  (cbtu chars)\n");
+    fprintf (stderr, " -M     : support Multipathing: First device is aliased\n");
     fprintf (stderr, " -v/-q  : Verbose/Quiet operation\n");
     fprintf (stderr, " -h     : print Help and exit.\n");
 }
@@ -1882,7 +1889,7 @@
 	fprintf(stderr, DEVSCSI " either does not exist, or is not a directory\n");
 	exit(0);
     }
-    while ((c = getopt(argc, argv, "pflLvqshnderm:c:")) != EOF) {
+    while ((c = getopt(argc, argv, "pflLvqshnderMm:c:")) != EOF) {
 	switch (c) {
 	  case 'p':
 	    no_procscsi = 1; break;
@@ -1904,6 +1911,8 @@
 	    san_del = 1; break;
 	  case 'r':
 	    supp_rmvbl = 1; break;
+	  case 'M':
+	    supp_multi = 1; break;
 	  case 'e':
 	    nm_cbtu = 1; break;
 	  case 'v':
@@ -2334,12 +2343,17 @@
 	     * case we find a duplicate.
 	     */
 	    if( match != NULL ) {
-		fprintf (stderr, "Line %d not matched uniquely\n", line);
-		fprintf (stderr, " Prev. match: %s\n", match->name);
-		fprintf (stderr, " Curr. match: %s\n", spnt->name);
-		break;
-	    }
-	    else
+		if (!supp_multi) {
+		    fprintf (stderr, "Line %d not matched uniquely\n", line);
+		    fprintf (stderr, " Prev. match: %s\n", match->name);
+		    fprintf (stderr, " Curr. match: %s\n", spnt->name);
+		    break;
+		} else {
+		    if (!quiet) 
+			fprintf (stderr, "Line %d: %s <=> %s\n",
+				 line, match->name, spnt->name);
+		}
+	    } else
 		match = spnt;
 	}
 
