diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2021-02-02 13:51:18 +0900 |
---|---|---|
committer | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2021-02-02 13:51:18 +0900 |
commit | 6d85edcdbb2acd0752a635df6ec4e3b35af2bff3 (patch) | |
tree | f9b5b8328938b5e7474d6279753eb7e09388ef14 /scripts | |
parent | 47edcb75af17f82450c246e08ad663c35196849e (diff) | |
parent | 74d4a13667939ac1f737dfaaf430afef4027dd43 (diff) |
Merge branch 'topic/bsp41x' into HEAD
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/base.py | 7 | ||||
-rwxr-xr-x | scripts/find.py | 26 | ||||
-rwxr-xr-x | scripts/myhtml.py | 58 | ||||
-rwxr-xr-x | scripts/peripelist_conv | 2 | ||||
-rwxr-xr-x | scripts/periupport_conv | 2 |
5 files changed, 63 insertions, 32 deletions
diff --git a/scripts/base.py b/scripts/base.py index 1a6396e..5e5161e 100755 --- a/scripts/base.py +++ b/scripts/base.py @@ -19,6 +19,7 @@ import subprocess class base: __top = os.path.abspath(__file__ + "/../../"); __key = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" + __bsp = ["bsp41x", "bsp39x"] #-------------------- # chomp @@ -33,6 +34,12 @@ class base: return base.__top; #-------------------- + # bsp_list() + #-------------------- + def bsp_list(self): + return base.__bsp; + + #-------------------- # is_key() #-------------------- def is_key(self, key): diff --git a/scripts/find.py b/scripts/find.py index 9941bff..d5060cd 100755 --- a/scripts/find.py +++ b/scripts/find.py @@ -27,7 +27,7 @@ class find(base.base): # replace -a NoAssignee to -na "" # # add "-ns Done" automatically - # if user doesn't specify "-s" or "-ns" + # if user doesn't specify "-s" or "-ns" or "-is" match = 0 for i in range(len(arg)): if (arg[i] == "-all"): @@ -36,7 +36,7 @@ class find(base.base): (arg[i+1] == "NoAssignee")): arg[i] = "-na" arg[i+1] = "" - if ((arg[i] == "-s") or (arg[i] == "-ns")): + if ((arg[i] == "-s") or (arg[i] == "-ns") or (arg[i] == "-is")): match = 1 if (not match): @@ -47,7 +47,7 @@ class find(base.base): #-------------------- # parse_option #-------------------- - def parse_option(self, arg, option, char, hit): + def parse_option(self, arg, option, tag, hit): op = "-l" # hit if (not hit): @@ -58,13 +58,17 @@ class find(base.base): if (cmd == option): match = 1 elif (match): - # Wolfram,Shimoda - # -> - # (Wolfram|Shimoda) - tgt = "({})".format(cmd.replace(",", "|")) - - self.files = self.run("echo \"{}\" | xargs egrep {} \"{}:\s+{}\"".\ - format(self.files, op, char, tgt)) + if (option == "-b"): + tag = cmd + tgt = "" + else: + # Wolfram,Shimoda + # -> + # (Wolfram|Shimoda) + tgt = "\s+({})".format(cmd.replace(",", "|")) + + self.files = self.run("echo \"{}\" | xargs egrep {} \"{}:{}\"".\ + format(self.files, op, tag, tgt)) return #-------------------- @@ -118,6 +122,7 @@ class find(base.base): # -na : not matched assignee # -t : matched team # -nt : not matched team + # -b : bsp if (self.files): self.parse_option(arg, "-s", "status", 1) self.parse_option(arg, "-ns", "status", 0) @@ -125,6 +130,7 @@ class find(base.base): self.parse_option(arg, "-na", "assignee", 0) self.parse_option(arg, "-t", "team", 1) self.parse_option(arg, "-nt", "team", 0) + self.parse_option(arg, "-b", None, 1) #-------------------- # get diff --git a/scripts/myhtml.py b/scripts/myhtml.py index e46b65e..2e4636a 100755 --- a/scripts/myhtml.py +++ b/scripts/myhtml.py @@ -332,14 +332,14 @@ class periject_html(base.base): #-------------------- # menu_bsp #-------------------- - def menu_bsp(self): + def menu_bsp(self, bsp): html("a", {"target":"summary", - "href":"./bsp.html"}).print("BSP patch list") + "href":"./{}.html".format(bsp)}).print(bsp) #-------------------- # menu #-------------------- - def menu(self): + def menu(self, argv): self.print_css("html") with html("body"): @@ -360,7 +360,10 @@ class periject_html(base.base): self.menu_team() html("h1").print("BSP") - self.menu_bsp() + with html("ul"): + for bsp in argv: + with html("li"): + self.menu_bsp(bsp) html("div").print("<br><br>update<br>{}".format( datetime.datetime.now().strftime("%Y/%m/%d %H:%M"))) @@ -492,16 +495,26 @@ class periject_html(base.base): #-------------------- # task_commit_bsp #-------------------- - def task_commit_bsp(self, bsp_list): - - cnt = 0 - + def print_commit_bsp(self, bsp_list): with html("ul"): for bsp in bsp_list: - cnt += 1 html("li").print(html("a", {"href":self.commit_url(bsp, "bsp"), "target":"_blank"}).text(self.git_title(bsp))) + return len(bsp_list) + + def task_commit_bsp(self, v): + cnt = 0 + + with html("table"): + for b in self.bsp_list(): + bsp_list = v.get_data(b) + if (not bsp_list): + continue + with html("tr"): + html("th").print(b) + with html("td"): + cnt += self.print_commit_bsp(bsp_list) return cnt #-------------------- @@ -568,19 +581,23 @@ class periject_html(base.base): #-------------------- def task_commit(self, v): - bsp = v.get_data("bsp-commits") + has_bsp = 0 + for b in self.bsp_list(): + if (v.get_data(b)): + has_bsp = 1 + break upstream = v.get_data("upstream") with html("table", {"border":"1"}): with html("tr"): - if (bsp): + if (has_bsp): html("th").print("BSP") if (upstream): html("th").print("upstream") with html("tr"): - if (bsp): + if (has_bsp): with html("td"): - self.task_commit_bsp(bsp) + self.task_commit_bsp(v) if (upstream): with html("td"): self.task_commit_upstream(v) @@ -667,10 +684,11 @@ class periject_html(base.base): cnt_all = 0 cnt_done= 0 tmp = 0 + bsp = argv.pop(0) self.print_css("html") with html("body"): - html("h2").print("BSP patch list") + html("h2").print(bsp) with html("table", {"border":"1"}): with html("tr"): @@ -682,8 +700,8 @@ class periject_html(base.base): v = view.viewer([file]) v.set_data(file) - bsp = v.get_data("bsp-commits") - if (not len(bsp)): + bsp_list = v.get_data(bsp) + if (not bsp_list): continue cnt_all += 1 @@ -695,7 +713,7 @@ class periject_html(base.base): v.get_data("status"))) with html("td"): - tmp = self.task_commit_bsp(bsp) + tmp = self.print_commit_bsp(bsp_list) cnt_bsp += tmp with html("td"): @@ -730,8 +748,8 @@ class periject_html(base.base): # html.py body self.body() elif (cmd == "menu"): - # html.py menu - self.menu() + # html.py menu bsp39x + self.menu(sys.argv) elif (cmd == "summary"): # html.py summary projects/linux/io self.summary(sys.argv) @@ -748,7 +766,7 @@ class periject_html(base.base): # ./script/find.py -t Core | xargs ./script/html.py status Core self.team(sys.argv) elif (cmd == "bsp"): - # ./script/find.py -a | xargs ./script/html.py bsp + # ./script/find.py -is -b bsp39x | xargs ./script/html.py bsp bsp39x self.bsp(sys.argv) elif (cmd == "wiki"): self.wiki(sys.argv) diff --git a/scripts/peripelist_conv b/scripts/peripelist_conv index 8610680..0c83b85 100755 --- a/scripts/peripelist_conv +++ b/scripts/peripelist_conv @@ -29,7 +29,7 @@ awk -F, -v team="$GRP" -v dst="$DST" -v cmd="$uuid_cmd" ' if ($2 != "?") print "target-date: " ($2 in date ? date[$2] : $2) >> F print "" >> F print "relationships:\n" >> F - print "bsp-commits:\n" >> F + print "bsp39x:\n" >> F print "upstream:\n" >> F print "comments:\n" >> F } diff --git a/scripts/periupport_conv b/scripts/periupport_conv index b8a2181..fc27ea3 100755 --- a/scripts/periupport_conv +++ b/scripts/periupport_conv @@ -53,7 +53,7 @@ gawk -v dst="$DST" -v ticket="$TICKET" -v cmd="$uuid_cmd" ' print "" >> F print "relationships:\n" >> F - print "bsp-commits:" >> F + print "bsp39x:" >> F for (idx in sorted_idx) { commit = tasks[task][sorted_idx[idx]] print " - " commit " # " bsp_desc[commit] >> F |