Title: [90664] trunk/Tools
- Revision
- 90664
- Author
- [email protected]
- Date
- 2011-07-08 13:58:44 -0700 (Fri, 08 Jul 2011)
Log Message
Remove commit-log-editor's dependency on Module::Load::Conditional
This module isn't available in Perl 5.8.8 (the version used on Leopard).
Fixes <http://webkit.org/b/64198> REGRESSION (r90583):
webkitpy.common.checkout.checkout_unittest failing on Leopard
Reviewed by Daniel Bates.
* Scripts/commit-log-editor: Use the new loadTermReadKey() function instead of
Module::Load::Conditional::can_load.
(loadTermReadKey): Added. Tries to load Term::ReadKey and returns true if it's successful.
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (90663 => 90664)
--- trunk/Tools/ChangeLog 2011-07-08 20:37:26 UTC (rev 90663)
+++ trunk/Tools/ChangeLog 2011-07-08 20:58:44 UTC (rev 90664)
@@ -1,5 +1,20 @@
2011-07-08 Adam Roben <[email protected]>
+ Remove commit-log-editor's dependency on Module::Load::Conditional
+
+ This module isn't available in Perl 5.8.8 (the version used on Leopard).
+
+ Fixes <http://webkit.org/b/64198> REGRESSION (r90583):
+ webkitpy.common.checkout.checkout_unittest failing on Leopard
+
+ Reviewed by Daniel Bates.
+
+ * Scripts/commit-log-editor: Use the new loadTermReadKey() function instead of
+ Module::Load::Conditional::can_load.
+ (loadTermReadKey): Added. Tries to load Term::ReadKey and returns true if it's successful.
+
+2011-07-08 Adam Roben <[email protected]>
+
Make checkout_unittest more robust against files moving around
Fixes <http://webkit.org/b/64197> checkout_unittest contains ugly, fragile code to find the
Modified: trunk/Tools/Scripts/commit-log-editor (90663 => 90664)
--- trunk/Tools/Scripts/commit-log-editor 2011-07-08 20:37:26 UTC (rev 90663)
+++ trunk/Tools/Scripts/commit-log-editor 2011-07-08 20:58:44 UTC (rev 90664)
@@ -34,13 +34,13 @@
use File::Basename;
use File::Spec;
use FindBin;
-use Module::Load::Conditional qw(can_load);
use lib $FindBin::Bin;
use VCSUtils;
use webkitdirs;
sub createCommitMessage(@);
sub fixEnvironment();
+sub loadTermReadKey();
sub normalizeLineEndings($$);
sub patchAuthorshipString($$$);
sub removeLongestCommonPrefixEndingInDoubleNewline(\%);
@@ -158,7 +158,7 @@
$endl = $1 if $logContents =~ /(\r?\n)/;
my $keepExistingLog = 1;
-if ($regenerateLog && $existingLog && scalar(@changeLogs) > 0 && can_load(modules=>{ 'Term::ReadKey'=>undef })) {
+if ($regenerateLog && $existingLog && scalar(@changeLogs) > 0 && loadTermReadKey()) {
print "Existing log message detected, Use 'r' to regenerate log message from ChangeLogs, or any other key to keep the existing message.\n";
Term::ReadKey::ReadMode('cbreak');
my $key = Term::ReadKey::ReadKey(0);
@@ -332,6 +332,12 @@
}
}
+sub loadTermReadKey()
+{
+ eval { require Term::ReadKey; };
+ return !$@;
+}
+
sub normalizeLineEndings($$)
{
my ($string, $endl) = @_;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes