Merge ~vicamo/+git/hwe-tools:for-upstream/support-upstream-statements into ~vicamo/+git/hwe-tools:master
- Git
- lp:~vicamo/+git/hwe-tools
- for-upstream/support-upstream-statements
- Merge into master
Proposed by
You-Sheng Yang
Status: | Merged |
---|---|
Merged at revision: | 56af6c40e9f8101f026e5d1d4c3475ecc9a8eacf |
Proposed branch: | ~vicamo/+git/hwe-tools:for-upstream/support-upstream-statements |
Merge into: | ~vicamo/+git/hwe-tools:master |
Diff against target: |
299 lines (+118/-36) 4 files modified
find-upstream-fixes (+77/-14) get-oem-delta.sh (+20/-12) hwe-bug-checker.py (+1/-1) hwe-bug-monitor.py (+20/-9) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Canonical Hardware Enablement | Pending | ||
Review via email: mp+405173@code.launchpad.net |
Commit message
Description of the change
* remove debug prints
* detect `[ Upstream commit ... ]` and `commit ... upstream.`.
TODO: figure out why there are sometimes:
fatal: bad object ...
fatal: Not a valid commit name ...
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | diff --git a/find-upstream-fixes b/find-upstream-fixes | |||
2 | index 358df33..f1d6874 100755 | |||
3 | --- a/find-upstream-fixes | |||
4 | +++ b/find-upstream-fixes | |||
5 | @@ -1,10 +1,40 @@ | |||
6 | 1 | #!/bin/bash | 1 | #!/bin/bash |
7 | 2 | 2 | ||
8 | 3 | BOT=0 | ||
9 | 4 | BOT_HEADER="" | ||
10 | 5 | BOT_COMMITS="" | ||
11 | 6 | QUIET=0 | ||
12 | 7 | |||
13 | 8 | function println() { | ||
14 | 9 | if [ ${QUIET} -ne 1 ] || [ ! -z $2 ]; then | ||
15 | 10 | if [ ${BOT} -ne 1 ]; then | ||
16 | 11 | echo "$1" | ||
17 | 12 | fi | ||
18 | 13 | fi | ||
19 | 14 | } | ||
20 | 15 | |||
21 | 3 | if [ $# -lt 2 ]; then | 16 | if [ $# -lt 2 ]; then |
23 | 4 | echo "Usage: ${BASH_SOURCE[0]} <ref-range> <find1>[ <find2>...]" >&2 | 17 | echo "Usage: ${BASH_SOURCE[0]} [-b -q] <ref-range> <find1>[ <find2>...]" >&2 |
24 | 5 | exit 1 | 18 | exit 1 |
25 | 6 | fi | 19 | fi |
26 | 7 | 20 | ||
27 | 21 | OPTIND=1 | ||
28 | 22 | while getopts ":bqh?" opt; do | ||
29 | 23 | case ${opt} in | ||
30 | 24 | b) | ||
31 | 25 | QUIET=1 | ||
32 | 26 | BOT=1 | ||
33 | 27 | ;; | ||
34 | 28 | q) | ||
35 | 29 | QUIET=1 | ||
36 | 30 | ;; | ||
37 | 31 | *) | ||
38 | 32 | ;; | ||
39 | 33 | esac | ||
40 | 34 | done | ||
41 | 35 | |||
42 | 36 | shift $((OPTIND-1)) | ||
43 | 37 | [ "${1:-}" = "--" ] && shift | ||
44 | 8 | COMMIT_RANGE=$1 | 38 | COMMIT_RANGE=$1 |
45 | 9 | shift; | 39 | shift; |
46 | 10 | TARGET_TREES=("$@") | 40 | TARGET_TREES=("$@") |
47 | @@ -14,22 +44,31 @@ declare -A cherry_picked; | |||
48 | 14 | 44 | ||
49 | 15 | header_printed= | 45 | header_printed= |
50 | 16 | for commit in $(git log --reverse --pretty=format:%h "${COMMIT_RANGE}"); do | 46 | for commit in $(git log --reverse --pretty=format:%h "${COMMIT_RANGE}"); do |
52 | 17 | corb=( $(git log -1 --pretty=format:%b "${commit}" | \ | 47 | msg="$(git log -1 --pretty=format:%b "${commit}")" |
53 | 48 | todo=( $(echo "${msg}" | \ | ||
54 | 18 | grep -E '^\((cherry picked|backported) from commit ' | \ | 49 | grep -E '^\((cherry picked|backported) from commit ' | \ |
55 | 19 | sed -E 's,^\((cherry picked|backported) from commit ([a-f0-9]+).*,\2,') ) | 50 | sed -E 's,^\((cherry picked|backported) from commit ([a-f0-9]+).*,\2,') ) |
58 | 20 | if [ ${#corb} -ne 0 ]; then | 51 | todo+=( $(echo "${msg}" | \ |
59 | 21 | cherry_picked["${commit}"]="${corb[*]}" | 52 | grep -E '^\[ Upstream commit [a-f0-9]+ \]$' | \ |
60 | 53 | sed -E 's,^\[ Upstream commit ([a-f0-9]+) \]$,\1,') ) | ||
61 | 54 | todo+=( $(echo "${msg}" | \ | ||
62 | 55 | grep -E '^commit [a-f0-9]+ upstream.$' | \ | ||
63 | 56 | sed -E 's,^commit ([a-f0-9]+) upstream.$,\1,') ) | ||
64 | 57 | if [ ${#todo} -ne 0 ]; then | ||
65 | 58 | cherry_picked["${commit}"]="${todo[*]}" | ||
66 | 22 | continue | 59 | continue |
67 | 23 | fi | 60 | fi |
68 | 24 | 61 | ||
69 | 25 | if [ -z "${header_printed}" ]; then | 62 | if [ -z "${header_printed}" ]; then |
71 | 26 | echo "* No cherry-pick/backport statement found:" | 63 | println "* No cherry-pick/backport/upstream statement found:" |
72 | 27 | header_printed=yes | 64 | header_printed=yes |
73 | 28 | fi | 65 | fi |
74 | 29 | 66 | ||
78 | 30 | echo " * commit ${commit} (\"$(git log -1 --pretty=format:%s "${commit}")\")" | 67 | println " * commit ${commit} (\"$(git log -1 --pretty=format:%s "${commit}")\")" |
79 | 31 | git log -1 --pretty=format:%b "${commit}" | 68 | if [ ${QUIET} -ne 1 ]; then |
80 | 32 | echo | 69 | git log -1 --pretty=format:%b "${commit}" |
81 | 70 | fi | ||
82 | 71 | println "" | ||
83 | 33 | done | 72 | done |
84 | 34 | 73 | ||
85 | 35 | for checking in "${!cherry_picked[@]}"; do | 74 | for checking in "${!cherry_picked[@]}"; do |
86 | @@ -38,31 +77,55 @@ for checking in "${!cherry_picked[@]}"; do | |||
87 | 38 | 77 | ||
88 | 39 | for needle in ${origins}; do | 78 | for needle in ${origins}; do |
89 | 40 | needle_printed= | 79 | needle_printed= |
91 | 41 | needle_short=$(git log -1 --pretty=format:%h "${needle}") | 80 | if [ ${QUIET} -eq 1 ]; then |
92 | 81 | needle_short=$(git log -1 --pretty=format:%h "${needle}" 2> /dev/null) | ||
93 | 82 | else | ||
94 | 83 | needle_short=$(git log -1 --pretty=format:%h "${needle}") | ||
95 | 84 | fi | ||
96 | 42 | 85 | ||
97 | 86 | BOT_HEADER="" | ||
98 | 43 | for haystack in "${TARGET_TREES[@]}"; do | 87 | for haystack in "${TARGET_TREES[@]}"; do |
100 | 44 | git merge-base --is-ancestor "${needle}" "${haystack}" || continue | 88 | if [ ${QUIET} -eq 1 ]; then |
101 | 89 | git merge-base --is-ancestor "${needle}" "${haystack}" 2> /dev/null || continue | ||
102 | 90 | else | ||
103 | 91 | git merge-base --is-ancestor "${needle}" "${haystack}" || continue | ||
104 | 92 | fi | ||
105 | 45 | 93 | ||
106 | 46 | found=( $(git log -P --grep="^\s*Fixes:.*\s+${needle_short}" --pretty="format:%h" "${needle_short}..${haystack}") ) | 94 | found=( $(git log -P --grep="^\s*Fixes:.*\s+${needle_short}" --pretty="format:%h" "${needle_short}..${haystack}") ) |
107 | 47 | [ ${#found} -ne 0 ] || continue | 95 | [ ${#found} -ne 0 ] || continue |
108 | 48 | 96 | ||
109 | 49 | if [ -z "${header_printed}" ]; then | 97 | if [ -z "${header_printed}" ]; then |
111 | 50 | echo "###### Checking commit ${checking} (\"$(git log -1 --pretty=format:%s "${checking}")\") ######" | 98 | println "###### Checking commit ${checking} (\"$(git log -1 --pretty=format:%s "${checking}")\") ######" 1 |
112 | 51 | header_printed=yes | 99 | header_printed=yes |
113 | 100 | if [ ${BOT} -eq 1 ]; then | ||
114 | 101 | branch=`git branch --show-current` | ||
115 | 102 | BOT_HEADER="###### Branch ${branch} commit ${checking} (\"$(git log -1 --pretty=format:%s "${checking}")\") ######" | ||
116 | 103 | BOT_COMMITS="" | ||
117 | 104 | fi | ||
118 | 52 | fi | 105 | fi |
119 | 53 | if [ -z "${needle_printed}" ]; then | 106 | if [ -z "${needle_printed}" ]; then |
121 | 54 | echo " * Checking for origin ${needle_short} ..." | 107 | println " * Checking for origin ${needle_short} ..." 1 |
122 | 55 | needle_printed=yes | 108 | needle_printed=yes |
123 | 56 | fi | 109 | fi |
124 | 57 | 110 | ||
126 | 58 | echo " fixes found in ${haystack}: ${found[*]}" | 111 | println " fixes found in ${haystack}: ${found[*]}" 1 |
127 | 112 | if [ ${BOT} -eq 1 ]; then | ||
128 | 113 | BOT_COMMITS+=" fixes found in ${haystack}: ${found[*]}\n" | ||
129 | 114 | break | ||
130 | 115 | fi | ||
131 | 59 | for fix in "${found[@]}"; do | 116 | for fix in "${found[@]}"; do |
132 | 60 | case " ${cherry_picked[@]} " in | 117 | case " ${cherry_picked[@]} " in |
133 | 61 | *" ${fix}"*) format="(applied) %h %s" ;; | 118 | *" ${fix}"*) format="(applied) %h %s" ;; |
134 | 62 | *) format="(missing) %h %s" ;; | 119 | *) format="(missing) %h %s" ;; |
135 | 63 | esac | 120 | esac |
137 | 64 | git log -1 --pretty="format: ${format}" "${fix}" | 121 | if [ ${QUIET} -ne 1 ]; then |
138 | 122 | git log -1 --pretty="format: ${format}" "${fix}" | ||
139 | 123 | fi | ||
140 | 65 | done | 124 | done |
141 | 66 | done | 125 | done |
142 | 126 | if [ ${BOT} -eq 1 ] && [ ! -z "${BOT_HEADER}" ] ; then | ||
143 | 127 | echo -e "${BOT_HEADER}" | ||
144 | 128 | echo -e "${BOT_COMMITS}" | ||
145 | 129 | fi | ||
146 | 67 | done | 130 | done |
147 | 68 | done | 131 | done |
148 | diff --git a/get-oem-delta.sh b/get-oem-delta.sh | |||
149 | index 89f617c..540e7c3 100755 | |||
150 | --- a/get-oem-delta.sh | |||
151 | +++ b/get-oem-delta.sh | |||
152 | @@ -11,7 +11,7 @@ | |||
153 | 11 | # Where your linux-oem tree lives | 11 | # Where your linux-oem tree lives |
154 | 12 | OEM_KERNEL_TREE= | 12 | OEM_KERNEL_TREE= |
155 | 13 | OEM_KERNEL_BRANCH="oem" | 13 | OEM_KERNEL_BRANCH="oem" |
157 | 14 | GIT_PULL=0 | 14 | GIT_PULL=1 |
158 | 15 | WIDE_MODE=0 | 15 | WIDE_MODE=0 |
159 | 16 | 16 | ||
160 | 17 | bye() { cd "$pwd"; exit $1; } | 17 | bye() { cd "$pwd"; exit $1; } |
161 | @@ -24,9 +24,9 @@ usage() | |||
162 | 24 | echo -e " -b \e[3m<oem_kernel_branch>\e[0m\tBranch name to checkout in OEM kernel git repo, default is 'oem'"; | 24 | echo -e " -b \e[3m<oem_kernel_branch>\e[0m\tBranch name to checkout in OEM kernel git repo, default is 'oem'"; |
163 | 25 | echo -e " -t \e[3m<target_git_repo>\e[0m\t\tGit repo to check whether commits have landed"; | 25 | echo -e " -t \e[3m<target_git_repo>\e[0m\t\tGit repo to check whether commits have landed"; |
164 | 26 | echo -e " -B \e[3m<target_repo_branch>\e[0m\tBranch to switch to in the target kernel git repo (optional)"; | 26 | echo -e " -B \e[3m<target_repo_branch>\e[0m\tBranch to switch to in the target kernel git repo (optional)"; |
165 | 27 | echo -e " -p \t\t\t\tRuns git pull --rebase in the source and target git repos, default is not to git pull"; | ||
166 | 28 | echo -e " -w \t\t\t\tWide mode, suitable for file output, not suitable for screen display"; | 27 | echo -e " -w \t\t\t\tWide mode, suitable for file output, not suitable for screen display"; |
167 | 29 | echo -e " -T \e[3m<hash>\e[0m\t\t\tIf \e[3m<hash>\e[0m is provided then will only test this hash"; | 28 | echo -e " -T \e[3m<hash>\e[0m\t\t\tIf \e[3m<hash>\e[0m is provided then will only test this hash"; |
168 | 29 | echo -e " -P \t\t\t\tDO NOT run 'git pull --rebase' in the source and target git repos"; | ||
169 | 30 | echo -e " -d \t\t\t\tDebug mode"; | 30 | echo -e " -d \t\t\t\tDebug mode"; |
170 | 31 | echo -e " -h \t\t\t\tPrint this help"; | 31 | echo -e " -h \t\t\t\tPrint this help"; |
171 | 32 | echo | 32 | echo |
172 | @@ -39,7 +39,7 @@ escape() | |||
173 | 39 | echo $1 | sed -E 's/([][*])/\\\1/g' | 39 | echo $1 | sed -E 's/([][*])/\\\1/g' |
174 | 40 | } | 40 | } |
175 | 41 | 41 | ||
177 | 42 | while getopts ":hps:b:t:B:wdT:" opt; do | 42 | while getopts ":hPs:b:t:B:wdT:" opt; do |
178 | 43 | case ${opt} in | 43 | case ${opt} in |
179 | 44 | s) | 44 | s) |
180 | 45 | if [ -d $OPTARG ]; then | 45 | if [ -d $OPTARG ]; then |
181 | @@ -61,8 +61,8 @@ while getopts ":hps:b:t:B:wdT:" opt; do | |||
182 | 61 | B) | 61 | B) |
183 | 62 | TARGET_GIT_BRANCH=$OPTARG | 62 | TARGET_GIT_BRANCH=$OPTARG |
184 | 63 | ;; | 63 | ;; |
187 | 64 | p) | 64 | P) |
188 | 65 | GIT_PULL=1 | 65 | GIT_PULL=0 |
189 | 66 | ;; | 66 | ;; |
190 | 67 | w) | 67 | w) |
191 | 68 | WIDE_MODE=1 | 68 | WIDE_MODE=1 |
192 | @@ -87,27 +87,35 @@ shift $((OPTIND -1)) | |||
193 | 87 | 87 | ||
194 | 88 | pwd="$PWD" | 88 | pwd="$PWD" |
195 | 89 | 89 | ||
197 | 90 | cd "$OEM_KERNEL_TREE" | 90 | cd "$target_repo" |
198 | 91 | ( | 91 | ( |
201 | 92 | git remote | grep -q mainline || (print_err "mainline remote missing in OEM kernel tree"; bye 1) | 92 | [ -n $TARGET_GIT_BRANCH ] && git checkout $TARGET_GIT_BRANCH |
200 | 93 | git checkout $OEM_KERNEL_BRANCH | ||
202 | 94 | [ $GIT_PULL = 1 ] && git pull --rebase | 93 | [ $GIT_PULL = 1 ] && git pull --rebase |
203 | 95 | ) 1>&2 | 94 | ) 1>&2 |
204 | 95 | target_origin=`git remote get-url origin` | ||
205 | 96 | target_head_hash=`git rev-parse --short HEAD` | ||
206 | 97 | target_branch=`git branch --show-current` | ||
207 | 96 | 98 | ||
208 | 99 | cd "$OEM_KERNEL_TREE" | ||
209 | 97 | ( | 100 | ( |
212 | 98 | cd "$target_repo" | 101 | git remote | grep -q mainline || (print_err "mainline remote missing in OEM kernel tree"; bye 1) |
213 | 99 | [ -n $TARGET_GIT_BRANCH ] && git checkout $TARGET_GIT_BRANCH | 102 | git checkout $OEM_KERNEL_BRANCH |
214 | 103 | git fetch mainline | ||
215 | 100 | [ $GIT_PULL = 1 ] && git pull --rebase | 104 | [ $GIT_PULL = 1 ] && git pull --rebase |
216 | 101 | ) 1>&2 | 105 | ) 1>&2 |
218 | 102 | 106 | source_origin=`git remote get-url origin` | |
219 | 107 | source_head_hash=`git rev-parse --short HEAD` | ||
220 | 108 | source_branch=`git branch --show-current` | ||
221 | 103 | 109 | ||
222 | 104 | FIRST_AND_LAST_HASH=( `git log --oneline -E --grep "UBUNTU: Ubuntu-[1-9]+" | sort -rV -k3 | awk 'NR==1 { print $1 }; END { print $1 }'` ) | 110 | FIRST_AND_LAST_HASH=( `git log --oneline -E --grep "UBUNTU: Ubuntu-[1-9]+" | sort -rV -k3 | awk 'NR==1 { print $1 }; END { print $1 }'` ) |
223 | 105 | LATEST_UBUNTU_HASH=${FIRST_AND_LAST_HASH[0]} | 111 | LATEST_UBUNTU_HASH=${FIRST_AND_LAST_HASH[0]} |
224 | 106 | EARLIEST_UBUNTU_HASH_DATE=`git log -1 --format=%aI ${FIRST_AND_LAST_HASH[1]}` | 112 | EARLIEST_UBUNTU_HASH_DATE=`git log -1 --format=%aI ${FIRST_AND_LAST_HASH[1]}` |
225 | 107 | 113 | ||
226 | 108 | printf "Report generated at "; date | 114 | printf "Report generated at "; date |
227 | 115 | printf "Source: $source_origin $source_head_hash ($source_branch)\n" | ||
228 | 116 | printf "Target: $target_origin $target_head_hash ($target_branch)\n" | ||
229 | 109 | printf "T=Type: C=Cherry-pick, B=Backport, S=SAUCE patch, R=Revert, F=conFig\n" | 117 | printf "T=Type: C=Cherry-pick, B=Backport, S=SAUCE patch, R=Revert, F=conFig\n" |
231 | 110 | printf "L=Landed in %s?\n" "${target_repo}" | 118 | printf "L=Landed?\n" |
232 | 111 | printf " + Y=Landed, N=Not landed, M=Log messages differ but w/ identical patch contents\n" | 119 | printf " + Y=Landed, N=Not landed, M=Log messages differ but w/ identical patch contents\n" |
233 | 112 | printf " + x%%=Commit with same log message found but patch contents differ\n" | 120 | printf " + x%%=Commit with same log message found but patch contents differ\n" |
234 | 113 | perl -e 'print "-" x 180; print "\n"' | 121 | perl -e 'print "-" x 180; print "\n"' |
235 | diff --git a/hwe-bug-checker.py b/hwe-bug-checker.py | |||
236 | index 89fdbc5..ec8f51a 100755 | |||
237 | --- a/hwe-bug-checker.py | |||
238 | +++ b/hwe-bug-checker.py | |||
239 | @@ -12,7 +12,7 @@ from launchpadlib.uris import lookup_service_root | |||
240 | 12 | 12 | ||
241 | 13 | APP_NAME = 'hwe-bug-checker' | 13 | APP_NAME = 'hwe-bug-checker' |
242 | 14 | SERVICE_ROOT = 'production' | 14 | SERVICE_ROOT = 'production' |
244 | 15 | HWE_OEM_PROJECTS = ['somerville/hwe-somerville', 'sutton/hwe-sutton', 'stella/hwe-stella', 'busan/hwe-busan', 'nashville/hwe-nashville', 'amaro/hwe-amaro', 'timbuktu/hwe-timbuktu', 'denver/hwe-denver'] | 15 | HWE_OEM_PROJECTS = ['somerville/hwe-somerville', 'sutton/hwe-sutton', 'stella/hwe-stella', 'busan/hwe-busan', 'nashville/hwe-nashville', 'amaro/hwe-amaro', 'timbuktu/hwe-timbuktu', 'denver/hwe-denver', 'anle/hwe-anle', 'pygmy-possum/hwe-pygmy-possum'] |
245 | 16 | 16 | ||
246 | 17 | logger = getLogger(APP_NAME) | 17 | logger = getLogger(APP_NAME) |
247 | 18 | 18 | ||
248 | diff --git a/hwe-bug-monitor.py b/hwe-bug-monitor.py | |||
249 | index 2aff1cf..519776b 100755 | |||
250 | --- a/hwe-bug-monitor.py | |||
251 | +++ b/hwe-bug-monitor.py | |||
252 | @@ -1,27 +1,38 @@ | |||
253 | 1 | #!/usr/bin/python3 | 1 | #!/usr/bin/python3 |
254 | 2 | 2 | ||
255 | 3 | import re | ||
256 | 4 | |||
257 | 3 | from os import path | 5 | from os import path |
258 | 4 | from subprocess import getoutput, getstatusoutput | 6 | from subprocess import getoutput, getstatusoutput |
259 | 5 | 7 | ||
260 | 6 | HWE_BUG_CHECKER = '~/hwe-tools/hwe-bug-checker.py' | 8 | HWE_BUG_CHECKER = '~/hwe-tools/hwe-bug-checker.py' |
264 | 7 | OEM_KERNELS = ['bionic git://git.launchpad.net/~canonical-kernel/ubuntu/+source/linux-oem/+git/bionic oem-next', | 9 | OEM_KERNELS = ['focal git://git.launchpad.net/~canonical-kernel/ubuntu/+source/linux-oem/+git/focal oem-5.14-next Ubuntu-oem-5.14', |
265 | 8 | 'focal git://git.launchpad.net/~canonical-kernel/ubuntu/+source/linux-oem/+git/focal oem-5.6-next', | 10 | 'jammy git://git.launchpad.net/~canonical-kernel/ubuntu/+source/linux-oem/+git/jammy oem-5.17-next Ubuntu-oem-5.17'] |
263 | 9 | 'focal git://git.launchpad.net/~canonical-kernel/ubuntu/+source/linux-oem/+git/focal oem-5.10-next'] | ||
266 | 10 | 11 | ||
267 | 11 | for kernel in OEM_KERNELS: | 12 | for kernel in OEM_KERNELS: |
268 | 12 | local = kernel.split(' ')[0] | 13 | local = kernel.split(' ')[0] |
269 | 13 | repo = kernel.split(' ')[1] | 14 | repo = kernel.split(' ')[1] |
270 | 14 | branch = kernel.split(' ')[2] | 15 | branch = kernel.split(' ')[2] |
271 | 16 | tag_prefix = kernel.split(' ')[3] | ||
272 | 15 | print("%s %s %s" % (local, repo, branch)) | 17 | print("%s %s %s" % (local, repo, branch)) |
273 | 16 | if not path.exists(local): | 18 | if not path.exists(local): |
274 | 17 | getoutput("git clone --depth 1 --single-branch --branch %s %s %s" % (branch, repo, local)) | 19 | getoutput("git clone --depth 1 --single-branch --branch %s %s %s" % (branch, repo, local)) |
280 | 18 | else: | 20 | status, result = getstatusoutput("cd %s; git rev-parse --verify %s" % (local, branch)) |
281 | 19 | status, result = getstatusoutput("cd %s; git rev-parse --verify %s" % (local, branch)) | 21 | if status != 0: |
282 | 20 | if status != 0: | 22 | print("hwe-bug-checker: adding new branch - %s" % branch) |
283 | 21 | print("hwe-bug-checker: adding new branch - %s" % branch) | 23 | getoutput("cd %s; git remote set-branches --add origin %s" % (local, branch)) |
284 | 22 | getoutput("cd %s; git remote set-branches --add origin %s" % (local, branch)) | 24 | getoutput("cd %s; git remote set-branches origin %s" % (local, branch)) |
285 | 23 | result = getoutput("(cd %s; git fetch origin)" % local) | 25 | result = getoutput("(cd %s; git fetch origin)" % local) |
287 | 24 | if 'new tag' in result: | 26 | for line in result.splitlines(): |
288 | 27 | tag_pattern = re.compile(r" \* \[new tag\] +(.*) -> (.*)") | ||
289 | 28 | tag = tag_pattern.match(line) | ||
290 | 29 | if tag != None: | ||
291 | 30 | if tag_prefix not in tag[1]: | ||
292 | 31 | getoutput("cd %s; git tag -d %s" % (local, tag[1])) | ||
293 | 32 | continue | ||
294 | 33 | else: | ||
295 | 34 | continue | ||
296 | 35 | |||
297 | 25 | getoutput("(cd %s; git checkout -B %s origin/%s)" % (local, branch, branch)) | 36 | getoutput("(cd %s; git checkout -B %s origin/%s)" % (local, branch, branch)) |
298 | 26 | result = getoutput("(cd %s; %s)" % (local, HWE_BUG_CHECKER)) | 37 | result = getoutput("(cd %s; %s)" % (local, HWE_BUG_CHECKER)) |
299 | 27 | print("hwe-bug-checker: %s" % result) | 38 | print("hwe-bug-checker: %s" % result) |