93dc30d
diff -rupN devscripts-2.15.5/scripts/licensecheck.pl devscripts-2.15.5-new/scripts/licensecheck.pl
93dc30d
--- devscripts-2.15.5/scripts/licensecheck.pl	2015-06-11 05:14:09.000000000 +0200
93dc30d
+++ devscripts-2.15.5-new/scripts/licensecheck.pl	2015-07-09 19:49:18.917819318 +0200
93dc30d
@@ -321,13 +321,15 @@ while (@files) {
93dc30d
     my %copyrights;
93dc30d
 
93dc30d
     # Encode::Guess does not work well, use good old file command to get file encoding
93dc30d
-    my $mime = `file -bi $file`;
93dc30d
+    my $mime = `file --brief --mime --dereference $file`;
93dc30d
     my $charset ;
93dc30d
-    if ($mime =~ /charset=([\w-]+)/) {
93dc30d
-        $charset = $1;
93dc30d
+    if ($mime =~ m!text/\w+; charset=([\w-]+)!) {
93dc30d
+	$charset = $1;
93dc30d
     }
93dc30d
     else {
93dc30d
-        die "can't find charset of $file\n";
93dc30d
+	chomp $mime;
93dc30d
+	warn "$0 warning: cannot parse file '$file' with mime type '$mime'\n";
93dc30d
+	next;
93dc30d
     }
93dc30d
 
93dc30d
     open (my $F, '<' ,$file) or die "Unable to access $file\n";