Index: library/package.tcl
===================================================================
RCS file: /cvsroot/tcl/tcl/library/package.tcl,v
retrieving revision 1.22
diff -u -r1.22 package.tcl
--- library/package.tcl	21 Feb 2003 05:30:18 -0000	1.22
+++ library/package.tcl	25 Feb 2003 23:06:29 -0000
@@ -145,6 +145,16 @@
 	cd $oldDir
 	return -code error -errorcode $errorCode -errorinfo $errorInfo $fileList
     }
+    if {[string length $loadPat]} {
+	foreach pkgname [list [string totitle $loadPat]
+		[string tolower $loadPat] $loadPat] {
+	    if {([catch {package present $pkgname}] == 1)
+		    && ([catch {package require $pkgname} version] == 0)} {
+		tclLog "successful \[package require $pkgname]: $version"
+		tclLog "to satisfy '-load $loadPat'"
+	    }
+	}
+    }
     foreach file $fileList {
 	# For each file, figure out what commands and packages it provides.
 	# To do this, create a child interpreter, load the file into the
@@ -176,7 +186,7 @@
 	    }
 	}
 	foreach pkg [info loaded] {
-	    if {! [string match $loadPat [lindex $pkg 1]]} {
+	    if {! [string match -nocase $loadPat [lindex $pkg 1]]} {
 		continue
 	    }
 	    if {$doVerbose} {
