OLD | NEW |
---|---|
1 #!/bin/bash | 1 #!/bin/bash |
2 # | 2 # |
3 # Copyright 2014 The Chromium Authors. All rights reserved. | 3 # Copyright 2014 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 # | 6 # |
7 | 7 |
8 # Clones the dom-distiller repo, compiles and extracts its javascript Then | 8 # Clones the dom-distiller repo, compiles and extracts its javascript Then |
9 # copies that js into the Chromium tree. | 9 # copies that js into the Chromium tree. |
10 # This script should be run from the src/ directory and requires that ant is | 10 # This script should be run from the src/ directory and requires that ant is |
11 # installed. | 11 # installed. |
12 | 12 |
13 ( | 13 ( |
14 dom_distiller_js_path=third_party/dom_distiller_js | 14 dom_distiller_js_path=third_party/dom_distiller_js |
15 dom_distiller_js_package=$dom_distiller_js_path/package | 15 dom_distiller_js_package=$dom_distiller_js_path/package |
16 readme_chromium=$dom_distiller_js_path/README.chromium | 16 readme_chromium=$dom_distiller_js_path/README.chromium |
17 tmpdir=/tmp/domdistiller-$$ | 17 tmpdir=/tmp/domdistiller-$$ |
18 changes=/tmp/domdistiller.changes | 18 changes=$tmpdir/domdistiller.changes |
19 bugs=$tmpdir/domdistiller.bugs | |
19 curr_gitsha=$(grep 'Version:' $readme_chromium | awk '{print $2}') | 20 curr_gitsha=$(grep 'Version:' $readme_chromium | awk '{print $2}') |
20 | 21 |
21 rm -rf $tmpdir | 22 rm -rf $tmpdir |
22 mkdir $tmpdir | 23 mkdir $tmpdir |
23 | 24 |
24 pushd $tmpdir | 25 pushd $tmpdir |
25 git clone https://code.google.com/p/dom-distiller/ . | 26 git clone https://code.google.com/p/dom-distiller/ . |
27 | |
26 new_gitsha=$(git rev-parse --short=10 HEAD) | 28 new_gitsha=$(git rev-parse --short=10 HEAD) |
27 git log --oneline ${curr_gitsha}.. > $changes | 29 git log --oneline ${curr_gitsha}.. > $changes |
30 | |
31 echo -n BUG= > $bugs | |
32 git log \ | |
33 | grep BUG= \ | |
34 | sed -e 's/.*BUG=\(.*\)/\1/' -e 's/\s*//g' -e '/^$/d' \ | |
nyquist
2014/05/19 22:41:26
This might warrant a quick comment?
cjhopman
2014/05/19 22:57:57
It's easiest to comment above this command, so the
| |
35 | tr ',' '\n' \ | |
36 | sort \ | |
37 | uniq \ | |
38 | tr '\n' ',' \ | |
39 | head --bytes=-2 \ | |
nyquist
2014/05/19 22:41:26
Are you sure -2 is right here?
cjhopman
2014/05/19 22:57:57
Done.
| |
40 >> $bugs | |
41 echo >> $bugs # add a newline | |
42 | |
28 ant package | 43 ant package |
29 popd | 44 popd |
30 | 45 |
31 rm -rf $dom_distiller_js_package | 46 rm -rf $dom_distiller_js_package |
32 mkdir $dom_distiller_js_package | 47 mkdir $dom_distiller_js_package |
33 cp -rf $tmpdir/out/package/* $dom_distiller_js_package | 48 cp -rf $tmpdir/out/package/* $dom_distiller_js_package |
34 cp $tmpdir/LICENSE $dom_distiller_js_path/ | 49 cp $tmpdir/LICENSE $dom_distiller_js_path/ |
35 sed -i "s/Version: [0-9a-f]*/Version: $new_gitsha/" $readme_chromium | 50 sed -i "s/Version: [0-9a-f]*/Version: $new_gitsha/" $readme_chromium |
36 | 51 |
52 echo | |
53 echo | |
54 echo "---Generated commit message---" | |
55 echo | |
37 echo "Picked up changes:" | 56 echo "Picked up changes:" |
38 cat $changes | 57 cat $changes |
58 echo | |
59 cat $bugs | |
39 | 60 |
40 # Run checklicenses.py on the pulled files, but only print the output on | 61 # Run checklicenses.py on the pulled files, but only print the output on |
41 # failures. | 62 # failures. |
42 tools/checklicenses/checklicenses.py $dom_distiller_js_path > $tmpdir/checklic enses.out || cat $tmpdir/checklicenses.out | 63 tools/checklicenses/checklicenses.py $dom_distiller_js_path > $tmpdir/checklic enses.out || cat $tmpdir/checklicenses.out |
43 | 64 |
44 rm -rf $tmpdir | 65 rm -rf $tmpdir |
45 rm $changes | |
46 ) | 66 ) |
OLD | NEW |