Changeset 172728 in webkit


Ignore:
Timestamp:
Aug 18, 2014, 2:44:24 PM (11 years ago)
Author:
mitz@apple.com
Message:

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.

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/Tools/ChangeLog

    r172726 r172728  
     12014-08-18  Dan Bernstein  <mitz@apple.com>
     2
     3        Added an update-webkit option to override the ../Internal check.
     4        Part of https://bugs.webkit.org/show_bug.cgi?id=135815
     5
     6        Reviewed by Tim Horton.
     7
     8        * Scripts/update-webkit:
     9        Added an explicit --internal option to control updating ../Internal, defaulting to whether
     10        ../Internal exists.
     11        (runSvnUpdate): Moved to webkitdirs.pm.
     12        (runGitUpdate): Ditto.
     13        * Scripts/webkitdirs.pm:
     14        (runSvnUpdateAndResolveChangeLogs): Moved runSvnUpdate from update-webkit and renamed to this.
     15        (runGitUpdate): Moved from update-webkit.
     16
    1172014-08-18  Pratik Solanki  <psolanki@apple.com>
    218
  • TabularUnified trunk/Tools/Scripts/update-webkit

    r172726 r172728  
    11#!/usr/bin/perl -w
    22
    3 # Copyright (C) 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved.
     3# Copyright (C) 2005-2009, 2013, 2014 Apple Inc. All rights reserved.
    44# Copyright (C) 2009 Google Inc. All rights reserved.
    55# Copyright (C) 2011 Brent Fulgham. All rights reserved.
     
    4040use webkitdirs;
    4141
    42 sub runSvnUpdate();
    43 sub runGitUpdate();
    44 
    4542# Handle options
    4643my $quiet = '';
     
    5350# FIXME: Remove the check for ../Internal once Apple-internal users of this script pass --no-auxiliary-libs
    5451my $auxiliaryLibs = ! -d "../Internal";
     52# FIXME: http://webkit.org/b/135815 update-webkit should not check for the presence of Apple's Internal directory
     53my $internal = -d "../Internal";
    5554
    5655my $getOptionsResult = GetOptions(
     
    5857    'q|quiet' => \$quiet,
    5958    'auxiliary-libs!' => \$auxiliaryLibs,
    60 );
     59    'internal!' => \$internal,
     60);
    6161
    6262if (!$getOptionsResult || $showHelp) {
     
    6666  -q|--quiet                pass -q to svn update for quiet updates
    6767  --[no-]auxiliary-libs     [don\'t] update the auxiliary libraries for Windows (default: update)
    68   --wincairo                also update dependencies of the WinCairo port
     68  --[no-]internal           [don\'t] update ../Internal (default: update if it exists)
    6969__END__
    7070    exit 1;
     
    7878
    7979print "Updating OpenSource\n" unless $quiet;
    80 runSvnUpdate() if isSVN();
     80runSvnUpdateAndResolveChangeLogs(@svnOptions) if isSVN();
    8181runGitUpdate() if isGit();
    8282
    83 if (-d "../Internal") {
     83if ($internal) {
    8484    chdir("../Internal");
    8585    print "Updating Internal\n" unless $quiet;
    86     runSvnUpdate() if isSVNDirectory(".");
     86    runSvnUpdateAndResolveChangeLogs(@svnOptions) if isSVNDirectory(".");
    8787    runGitUpdate() if isGitDirectory(".");
    8888}
     
    9999
    100100exit 0;
    101 
    102 sub runSvnUpdate()
    103 {
    104     open UPDATE, "-|", "svn", "update", @svnOptions or die;
    105     my @conflictedChangeLogs;
    106     while (my $line = <UPDATE>) {
    107         print $line;
    108         $line =~ m/^C\s+(.+?)[\r\n]*$/;
    109         if ($1) {
    110           my $filename = normalizePath($1);
    111           push @conflictedChangeLogs, $filename if basename($filename) eq "ChangeLog";
    112         }
    113     }
    114     close UPDATE or die;
    115 
    116     if (@conflictedChangeLogs) {
    117         print "Attempting to merge conflicted ChangeLogs.\n";
    118         my $resolveChangeLogsPath = File::Spec->catfile(dirname($0), "resolve-ChangeLogs");
    119         (system($resolveChangeLogsPath, "--no-warnings", @conflictedChangeLogs) == 0)
    120             or die "Could not open resolve-ChangeLogs script: $!.\n";
    121     }
    122 }
    123 
    124 sub runGitUpdate()
    125 {
    126     # Doing a git fetch first allows setups with svn-remote.svn.fetch = trunk:refs/remotes/origin/master
    127     # to perform the rebase much much faster.
    128     system("git", "fetch");
    129     if (isGitSVN()) {
    130         system("git", "svn", "rebase") == 0 or die;
    131     } else {
    132         # This will die if branch.$BRANCHNAME.merge isn't set, which is
    133         # almost certainly what we want.
    134         system("git", "pull") == 0 or die;
    135     }
    136 }
  • TabularUnified trunk/Tools/Scripts/webkitdirs.pm

    r172174 r172728  
    25212521}
    25222522
     2523sub runSvnUpdateAndResolveChangeLogs(@)
     2524{
     2525    my @svnOptions = @_;
     2526    open UPDATE, "-|", "svn", "update", @svnOptions or die;
     2527    my @conflictedChangeLogs;
     2528    while (my $line = <UPDATE>) {
     2529        print $line;
     2530        $line =~ m/^C\s+(.+?)[\r\n]*$/;
     2531        if ($1) {
     2532          my $filename = normalizePath($1);
     2533          push @conflictedChangeLogs, $filename if basename($filename) eq "ChangeLog";
     2534        }
     2535    }
     2536    close UPDATE or die;
     2537
     2538    if (@conflictedChangeLogs) {
     2539        print "Attempting to merge conflicted ChangeLogs.\n";
     2540        my $resolveChangeLogsPath = File::Spec->catfile(dirname($0), "resolve-ChangeLogs");
     2541        (system($resolveChangeLogsPath, "--no-warnings", @conflictedChangeLogs) == 0)
     2542            or die "Could not open resolve-ChangeLogs script: $!.\n";
     2543    }
     2544}
     2545
     2546sub runGitUpdate()
     2547{
     2548    # Doing a git fetch first allows setups with svn-remote.svn.fetch = trunk:refs/remotes/origin/master
     2549    # to perform the rebase much much faster.
     2550    system("git", "fetch");
     2551    if (isGitSVN()) {
     2552        system("git", "svn", "rebase") == 0 or die;
     2553    } else {
     2554        # This will die if branch.$BRANCHNAME.merge isn't set, which is
     2555        # almost certainly what we want.
     2556        system("git", "pull") == 0 or die;
     2557    }
     2558}
     2559
    252325601;
Note: See TracChangeset for help on using the changeset viewer.