Modified: trunk/Tools/ChangeLog (172727 => 172728)
--- trunk/Tools/ChangeLog 2014-08-18 21:33:01 UTC (rev 172727)
+++ trunk/Tools/ChangeLog 2014-08-18 21:44:24 UTC (rev 172728)
@@ -1,3 +1,19 @@
+2014-08-18 Dan Bernstein <m...@apple.com>
+
+ Added an update-webkit option to override the ../Internal check.
+ Part of https://bugs.webkit.org/show_bug.cgi?id=135815
+
+ Reviewed by Tim Horton.
+
+ * Scripts/update-webkit:
+ Added an explicit --internal option to control updating ../Internal, defaulting to whether
+ ../Internal exists.
+ (runSvnUpdate): Moved to webkitdirs.pm.
+ (runGitUpdate): Ditto.
+ * Scripts/webkitdirs.pm:
+ (runSvnUpdateAndResolveChangeLogs): Moved runSvnUpdate from update-webkit and renamed to this.
+ (runGitUpdate): Moved from update-webkit.
+
2014-08-18 Pratik Solanki <psola...@apple.com>
Make update-webkit more lenient for pure git svn repositories
Modified: trunk/Tools/Scripts/update-webkit (172727 => 172728)
--- trunk/Tools/Scripts/update-webkit 2014-08-18 21:33:01 UTC (rev 172727)
+++ trunk/Tools/Scripts/update-webkit 2014-08-18 21:44:24 UTC (rev 172728)
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
-# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved.
+# Copyright (C) 2005-2009, 2013, 2014 Apple Inc. All rights reserved.
# Copyright (C) 2009 Google Inc. All rights reserved.
# Copyright (C) 2011 Brent Fulgham. All rights reserved.
#
@@ -39,9 +39,6 @@
use VCSUtils;
use webkitdirs;
-sub runSvnUpdate();
-sub runGitUpdate();
-
# Handle options
my $quiet = '';
my $showHelp;
@@ -52,12 +49,15 @@
# FIXME: Remove the check for ../Internal once Apple-internal users of this script pass --no-auxiliary-libs
my $auxiliaryLibs = ! -d "../Internal";
+# FIXME: http://webkit.org/b/135815 update-webkit should not check for the presence of Apple's Internal directory
+my $internal = -d "../Internal";
my $getOptionsResult = GetOptions(
'h|help' => \$showHelp,
'q|quiet' => \$quiet,
'auxiliary-libs!' => \$auxiliaryLibs,
-);
+ 'internal!' => \$internal,
+);
if (!$getOptionsResult || $showHelp) {
print STDERR <<__END__;
@@ -65,7 +65,7 @@
-h|--help show the help message
-q|--quiet pass -q to svn update for quiet updates
--[no-]auxiliary-libs [don\'t] update the auxiliary libraries for Windows (default: update)
- --wincairo also update dependencies of the WinCairo port
+ --[no-]internal [don\'t] update ../Internal (default: update if it exists)
__END__
exit 1;
}
@@ -77,13 +77,13 @@
push @svnOptions, qw(--accept postpone) if isSVNVersion16OrNewer();
print "Updating OpenSource\n" unless $quiet;
-runSvnUpdate() if isSVN();
+runSvnUpdateAndResolveChangeLogs(@svnOptions) if isSVN();
runGitUpdate() if isGit();
-if (-d "../Internal") {
+if ($internal) {
chdir("../Internal");
print "Updating Internal\n" unless $quiet;
- runSvnUpdate() if isSVNDirectory(".");
+ runSvnUpdateAndResolveChangeLogs(@svnOptions) if isSVNDirectory(".");
runGitUpdate() if isGitDirectory(".");
}
@@ -98,39 +98,3 @@
setupAppleWinEnv() if isAppleWinWebKit();
exit 0;
-
-sub runSvnUpdate()
-{
- open UPDATE, "-|", "svn", "update", @svnOptions or die;
- my @conflictedChangeLogs;
- while (my $line = <UPDATE>) {
- print $line;
- $line =~ m/^C\s+(.+?)[\r\n]*$/;
- if ($1) {
- my $filename = normalizePath($1);
- push @conflictedChangeLogs, $filename if basename($filename) eq "ChangeLog";
- }
- }
- close UPDATE or die;
-
- if (@conflictedChangeLogs) {
- print "Attempting to merge conflicted ChangeLogs.\n";
- my $resolveChangeLogsPath = File::Spec->catfile(dirname($0), "resolve-ChangeLogs");
- (system($resolveChangeLogsPath, "--no-warnings", @conflictedChangeLogs) == 0)
- or die "Could not open resolve-ChangeLogs script: $!.\n";
- }
-}
-
-sub runGitUpdate()
-{
- # Doing a git fetch first allows setups with svn-remote.svn.fetch = trunk:refs/remotes/origin/master
- # to perform the rebase much much faster.
- system("git", "fetch");
- if (isGitSVN()) {
- system("git", "svn", "rebase") == 0 or die;
- } else {
- # This will die if branch.$BRANCHNAME.merge isn't set, which is
- # almost certainly what we want.
- system("git", "pull") == 0 or die;
- }
-}
Modified: trunk/Tools/Scripts/webkitdirs.pm (172727 => 172728)
--- trunk/Tools/Scripts/webkitdirs.pm 2014-08-18 21:33:01 UTC (rev 172727)
+++ trunk/Tools/Scripts/webkitdirs.pm 2014-08-18 21:44:24 UTC (rev 172728)
@@ -2520,4 +2520,41 @@
return sprintf("%02dm:%02ds", $buildMins, $buildSecs);
}
+sub runSvnUpdateAndResolveChangeLogs(@)
+{
+ my @svnOptions = @_;
+ open UPDATE, "-|", "svn", "update", @svnOptions or die;
+ my @conflictedChangeLogs;
+ while (my $line = <UPDATE>) {
+ print $line;
+ $line =~ m/^C\s+(.+?)[\r\n]*$/;
+ if ($1) {
+ my $filename = normalizePath($1);
+ push @conflictedChangeLogs, $filename if basename($filename) eq "ChangeLog";
+ }
+ }
+ close UPDATE or die;
+
+ if (@conflictedChangeLogs) {
+ print "Attempting to merge conflicted ChangeLogs.\n";
+ my $resolveChangeLogsPath = File::Spec->catfile(dirname($0), "resolve-ChangeLogs");
+ (system($resolveChangeLogsPath, "--no-warnings", @conflictedChangeLogs) == 0)
+ or die "Could not open resolve-ChangeLogs script: $!.\n";
+ }
+}
+
+sub runGitUpdate()
+{
+ # Doing a git fetch first allows setups with svn-remote.svn.fetch = trunk:refs/remotes/origin/master
+ # to perform the rebase much much faster.
+ system("git", "fetch");
+ if (isGitSVN()) {
+ system("git", "svn", "rebase") == 0 or die;
+ } else {
+ # This will die if branch.$BRANCHNAME.merge isn't set, which is
+ # almost certainly what we want.
+ system("git", "pull") == 0 or die;
+ }
+}
+
1;