This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
"This is going to be slow." This change switches OpenBSD locale
authorSteve Peters <steve@fisharerojo.org>
Tue, 21 Nov 2006 03:59:34 +0000 (03:59 +0000)
committerSteve Peters <steve@fisharerojo.org>
Tue, 21 Nov 2006 03:59:34 +0000 (03:59 +0000)
tests from the spaghetti doneness test to specifically testing
locales in its /usr/share/locale.  Speeds up lib/locale.t to
13 minutes a run vs. the previous time of over two hours.

p4raw-id: //depot/perl@29332

lib/locale.t

index 666b9a9..c3a9d94 100644 (file)
@@ -399,6 +399,17 @@ if (-x "/usr/bin/locale" && open(LOCALES, "/usr/bin/locale -a 2>/dev/null|")) {
         trylocale($_);
     }
     close(LOCALES);
+} elsif ($^O eq 'openbsd' && -e '/usr/share/locale') {
+
+   # OpenBSD doesn't have a locale executable, so reading /usr/share/locale
+   # is much easier and faster than the last resort method.
+
+    opendir(LOCALES, '/usr/share/locale');
+    while ($_ = readdir(LOCALES)) {
+        chomp;
+        trylocale($_);
+    }
+    close(LOCALES);
 } else {
 
     # This is going to be slow.