Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
92fc59ca
Commit
92fc59ca
authored
May 27, 2016
by
Wojciech Tyczynski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Speedup update_codecgen by precomputing dependencies.
parent
227b8bad
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
update-codecgen.sh
hack/update-codecgen.sh
+5
-4
No files found.
hack/update-codecgen.sh
View file @
92fc59ca
...
...
@@ -56,11 +56,14 @@ function cleanup {
}
trap
cleanup EXIT
# Sort all files in the dependency order.
# Precompute dependencies for all directories.
# Then sort all files in the dependency order.
number
=
${#
generated_files
[@]
}
result
=
""
for
((
i
=
0
;
i<number
;
i++
))
;
do
visited[
${
i
}
]=
false
file
=
"
${
generated_files
[
${
i
}
]/\.generated\.go/.go
}
"
deps[
${
i
}
]=
$(
go list
-f
'{{range .Deps}}{{.}}{{"\n"}}{{end}}'
${
file
}
|
grep
"^
${
my_prefix
}
"
)
done
###echo "DBG: found $number generated files"
###for f in $(echo "${generated_files[@]}" | sort); do
...
...
@@ -70,11 +73,9 @@ done
# NOTE: depends function assumes that the whole repository is under
# $my_prefix - it will NOT work if that is not true.
function
depends
{
file
=
"
${
generated_files
[
$1
]/\.generated\.go/.go
}
"
rhs
=
"
$(
dirname
${
generated_files
[
$2
]/#./
${
my_prefix
}})
"
###echo "DBG: does ${file} depend on ${rhs}?"
deps
=
$(
go list
-f
'{{range .Deps}}{{.}}{{"\n"}}{{end}}'
${
file
}
|
grep
"^
${
my_prefix
}
"
)
for
dep
in
${
deps
}
;
do
for
dep
in
${
deps
[
$1
]
}
;
do
###echo "DBG: checking against $dep"
if
[[
"
${
dep
}
"
==
"
${
rhs
}
"
]]
;
then
###echo "DBG: = yes"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment