Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(247)

Side by Side Diff: third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/checkout.sh

Issue 2478073002: Revert of wptserve: Import the latest revision of wptserve-related files. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 # 2 #
3 # Removes ./wpt/ directory containing the reduced web-platform-tests tree and 3 # Removes ./wpt/ directory containing the reduced web-platform-tests tree and
4 # starts a new checkout. Only files in WPTWhiteList are retained. The revisions 4 # starts a new checkout. Only files in WPTWhiteList are retained. The revisions
5 # getting checked out are defined in WPTHeads. 5 # getting checked out are defined in WPTHeads.
6 6
7 DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) 7 DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
8 cd $DIR 8 cd $DIR
9 9
10 TARGET_DIR=$DIR/wpt 10 TARGET_DIR=$DIR/wpt
11 REMOTE_REPO="https://chromium.googlesource.com/external/w3c/web-platform-tests.g it" 11 REMOTE_REPO="https://chromium.googlesource.com/external/w3c/web-platform-tests.g it"
12 12
13 function clone { 13 function clone {
14 # First line is the main repo HEAD. 14 # First line is the main repo HEAD.
15 WPT_HEAD=$(head -n 1 $DIR/WPTHeads) 15 WPT_HEAD=$(head -n 1 $DIR/WPTHeads)
16 16
17 # Remove existing repo if already exists. 17 # Remove existing repo if already exists.
18 [ -d "$TARGET_DIR" ] && rm -rf $TARGET_DIR 18 [ -d "$TARGET_DIR" ] && rm -rf $TARGET_DIR
19 19
20 # Clone the main repository. 20 # Clone the main repository.
21 git clone $REMOTE_REPO $TARGET_DIR 21 git clone $REMOTE_REPO $TARGET_DIR
22 cd $TARGET_DIR && git checkout $WPT_HEAD 22 cd $TARGET_DIR && git checkout $WPT_HEAD
23 echo "WPTHead: " `git rev-parse HEAD`
24 23
25 # Starting from the 2nd line of WPTWhiteList, we read and checkout submodules. 24 # Starting from the 2nd line of WPTWhiteList, we read and checkout submodules.
26 tail -n+2 $DIR/WPTHeads | while read dir submodule commit; do 25 tail -n+2 $DIR/WPTHeads | while read dir submodule commit; do
27 cd $TARGET_DIR/$dir && \ 26 cd $TARGET_DIR/$dir && \
28 git submodule update --init $submodule && \ 27 git submodule update --init $submodule && \
29 cd $TARGET_DIR/$dir/$submodule && \ 28 cd $TARGET_DIR/$dir/$submodule && \
30 git checkout $commit 29 git checkout $commit
31 echo "WPTHead: $dir $submodule" `git rev-parse HEAD`
32 done 30 done
33 } 31 }
34 32
35 function reduce { 33 function reduce {
34 # Remove all except white-listed.
36 cd $TARGET_DIR 35 cd $TARGET_DIR
37 # web-platform-tests/html/ contains a filename with ', and it confuses
38 # xargs on macOS.
39 rm -fr html
40 # Remove all except white-listed.
41 find . -type f | grep -Fxvf ../WPTWhiteList | xargs -n 1 rm 36 find . -type f | grep -Fxvf ../WPTWhiteList | xargs -n 1 rm
42 find . -empty -type d -delete 37 find . -empty -type d -delete
43 } 38 }
44 39
45 actions="clone reduce" 40 actions="clone reduce"
46 [ "$1" != "" ] && actions="$@" 41 [ "$1" != "" ] && actions="$@"
47 42
48 for action in $actions; do 43 for action in $actions; do
49 type -t $action >/dev/null || (echo "Unknown action: $action" 1>&2 && exit 1) 44 type -t $action >/dev/null || (echo "Unknown action: $action" 1>&2 && exit 1)
50 $action 45 $action
51 done 46 done
52 47
53 # TODO(burnik): Handle the SSL certs and other configuration. 48 # TODO(burnik): Handle the SSL certs and other configuration.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698