OLD | NEW |
(Empty) | |
| 1 #!/bin/bash |
| 2 # |
| 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 |
| 5 # getting checked out are defined in WPTHeads. |
| 6 |
| 7 DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
| 8 cd $DIR |
| 9 |
| 10 TARGET_DIR=$DIR/wpt |
| 11 REMOTE_REPO="https://chromium.googlesource.com/external/w3c/web-platform-tests.g
it" |
| 12 |
| 13 # First line is the main repo HEAD. |
| 14 WPT_HEAD=$(head -n 1 $DIR/WPTHeads) |
| 15 |
| 16 # Remove existing repo if already exists. |
| 17 [ -d "$TARGET_DIR" ] && rm -rf $TARGET_DIR |
| 18 |
| 19 # Clone the main repository. |
| 20 git clone $REMOTE_REPO $TARGET_DIR |
| 21 cd $TARGET_DIR && git checkout $WPT_HEAD |
| 22 |
| 23 # Starting from the 2nd line of WPTWhiteList, we read and checkout submodules. |
| 24 tail -n+2 $DIR/WPTHeads | while read dir submodule commit; do |
| 25 cd $TARGET_DIR/$dir && \ |
| 26 git submodule update --init $submodule && \ |
| 27 cd $TARGET_DIR/$dir/$submodule && \ |
| 28 git checkout $commit |
| 29 done |
| 30 |
| 31 # Remove all except white-listed. |
| 32 cd $TARGET_DIR |
| 33 find . -type f | grep -Fxvf ../WPTWhiteList | xargs -n 1 rm |
| 34 find . -empty -type d -delete |
| 35 |
| 36 # TODO(burnik): Handle the SSL certs and other configuration. |
OLD | NEW |