OLD | NEW |
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2010 The Chromium OS 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 # Save the current state of the tree into a pinned deps file that can later | 7 # Save the current state of the tree into a pinned deps file that can later |
8 # be used to reconstruct the same tree. | 8 # be used to reconstruct the same tree. |
9 | 9 |
10 # Load common constants. This should be the first executable line. | 10 # Load common constants. This should be the first executable line. |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 | 92 |
93 rm -f "${TEMPFILE}" | 93 rm -f "${TEMPFILE}" |
94 } | 94 } |
95 | 95 |
96 commit_depfile() { | 96 commit_depfile() { |
97 echo "Commiting pinned DEPS file" | 97 echo "Commiting pinned DEPS file" |
98 | 98 |
99 pushd "${DEPPATH}" | 99 pushd "${DEPPATH}" |
100 | 100 |
101 git add "${FLAGS_depfile}" | 101 git add "${FLAGS_depfile}" |
102 git commit -m "Automated buildbot update of pinned DEPS file." | 102 git commit -m "Automated buildbot update of pinned DEPS file." --allow-empty |
103 git reset --hard HEAD | 103 git reset --hard HEAD |
104 git clean -f | 104 git clean -f |
105 git remote update | 105 git remote update |
106 git rebase -s ours origin/master | 106 git rebase -s ours origin/master |
107 git push | 107 git push |
108 | 108 |
109 popd | 109 popd |
110 } | 110 } |
111 | 111 |
112 # | 112 # |
113 # Generate a pinned deps file from the current gclient sync and check it into | 113 # Generate a pinned deps file from the current gclient sync and check it into |
114 # the deps.git repository. | 114 # the deps.git repository. |
115 # | 115 # |
116 trap "cleanup" EXIT | 116 trap "cleanup" EXIT |
117 | 117 |
118 if [[ $FLAGS_commit -eq $FLAGS_TRUE ]]; then | 118 if [[ $FLAGS_commit -eq $FLAGS_TRUE ]]; then |
119 reset_repository | 119 reset_repository |
120 fi | 120 fi |
121 | 121 |
122 generate_depfile | 122 generate_depfile |
123 | 123 |
124 if [[ $FLAGS_commit -eq $FLAGS_TRUE ]]; then | 124 if [[ $FLAGS_commit -eq $FLAGS_TRUE ]]; then |
125 commit_depfile | 125 commit_depfile |
126 fi | 126 fi |
127 | 127 |
128 trap - EXIT | 128 trap - EXIT |
OLD | NEW |