--- lib/File/MimeInfo.pm.orig	2008-02-13 16:38:59.000000000 -0800
+++ lib/File/MimeInfo.pm	2008-10-31 10:52:12.000000000 -0700
@@ -136,6 +136,19 @@
 sub rehash {
 	(@globs, %literal, %extension, %mime2ext) = (); # clear all data
 	local $_; # limit scope of $_ ... :S
+	
+	## setup @DIRS to point to the DB that MacPorts installed,
+	## thus users don't have to set ENV vars and such.
+	my $DIRS_index = undef;
+	for ($DIRS_index = 0; $DIRS_index < @DIRS; $DIRS_index++) {
+		if ($DIRS[$DIRS_index] =~ m|__PREFIX__/share/mime|) {
+			last;
+		}
+	}
+	if ($DIRS_index >= @DIRS) {
+		## we didn't find the MP prefix path, add it...
+		push @DIRS, '__PREFIX__/share/mime';
+	}
 	my @globfiles = @DIRS
 		? ( grep {-e $_ && -r $_} map "$_/globs", @DIRS )
 		: ( reverse data_files('mime/globs')        );
