Skip to content

Commit

Permalink
fix #51: improve deps-update and fix tools-update
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilsk committed Aug 21, 2021
1 parent 2274c8c commit cf535c5
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 20 deletions.
13 changes: 8 additions & 5 deletions dist/Go Module/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,15 @@ deps-tidy:
deps-update: selector = '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}'
deps-update:
$(AT) if command -v egg >/dev/null; then \
packages="`egg deps list | tr ' ' '\n' | sed -e 's|$$|/...@latest|'`"; \
packages="`egg deps list | tr ' ' '\n'`"; \
else \
packages="`go list -f $(selector) -m -mod=readonly all | sed -e 's|$$|/...@latest|'`"; \
packages="`go list -f $(selector) -m -mod=readonly all`"; \
fi; \
if [[ "$$packages" = "/...@latest" ]]; then exit; fi; \
for package in $$packages; do go get -d $$package; done
if [ -z "$$packages" ]; then exit; fi; \
for package in $$packages; do \
go mod edit -require=$$package@latest; \
go mod tidy; \
done
$(AT) $(MAKE) deps-tidy
.PHONY: deps-update

Expand Down Expand Up @@ -275,7 +278,7 @@ tools-update: selector = '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}'
tools-update:
$(AT) cd tools; \
if command -v egg >/dev/null; then \
packages="`egg deps list | tr ' ' '\n' | sed -e 's|$$|/...@latest|'`"; \
packages="`egg deps list | tr ' ' '\n'`"; \
else \
packages="`go list -f $(selector) -m -mod=readonly all`"; \
fi; \
Expand Down
13 changes: 8 additions & 5 deletions dist/Go Service/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,15 @@ deps-tidy:
deps-update: selector = '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}'
deps-update:
$(AT) if command -v egg >/dev/null; then \
packages="`egg deps list | tr ' ' '\n' | sed -e 's|$$|/...@latest|'`"; \
packages="`egg deps list | tr ' ' '\n'`"; \
else \
packages="`go list -f $(selector) -m -mod=readonly all | sed -e 's|$$|/...@latest|'`"; \
packages="`go list -f $(selector) -m -mod=readonly all`"; \
fi; \
if [[ "$$packages" = "/...@latest" ]]; then exit; fi; \
for package in $$packages; do go get -d $$package; done
if [ -z "$$packages" ]; then exit; fi; \
for package in $$packages; do \
go mod edit -require=$$package@latest; \
go mod tidy; \
done
$(AT) $(MAKE) deps-tidy
.PHONY: deps-update

Expand Down Expand Up @@ -338,7 +341,7 @@ tools-update: selector = '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}'
tools-update:
$(AT) cd tools; \
if command -v egg >/dev/null; then \
packages="`egg deps list | tr ' ' '\n' | sed -e 's|$$|/...@latest|'`"; \
packages="`egg deps list | tr ' ' '\n'`"; \
else \
packages="`go list -f $(selector) -m -mod=readonly all`"; \
fi; \
Expand Down
13 changes: 8 additions & 5 deletions dist/Go Tool/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,15 @@ deps-tidy:
deps-update: selector = '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}'
deps-update:
$(AT) if command -v egg >/dev/null; then \
packages="`egg deps list | tr ' ' '\n' | sed -e 's|$$|/...@latest|'`"; \
packages="`egg deps list | tr ' ' '\n'`"; \
else \
packages="`go list -f $(selector) -m -mod=readonly all | sed -e 's|$$|/...@latest|'`"; \
packages="`go list -f $(selector) -m -mod=readonly all`"; \
fi; \
if [[ "$$packages" = "/...@latest" ]]; then exit; fi; \
for package in $$packages; do go get -d $$package; done
if [ -z "$$packages" ]; then exit; fi; \
for package in $$packages; do \
go mod edit -require=$$package@latest; \
go mod tidy; \
done
$(AT) $(MAKE) deps-tidy
.PHONY: deps-update

Expand Down Expand Up @@ -323,7 +326,7 @@ tools-update: selector = '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}'
tools-update:
$(AT) cd tools; \
if command -v egg >/dev/null; then \
packages="`egg deps list | tr ' ' '\n' | sed -e 's|$$|/...@latest|'`"; \
packages="`egg deps list | tr ' ' '\n'`"; \
else \
packages="`go list -f $(selector) -m -mod=readonly all`"; \
fi; \
Expand Down
11 changes: 7 additions & 4 deletions src/go/deps.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ deps-tidy:
deps-update: selector = '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}'
deps-update:
$(AT) if command -v egg >/dev/null; then \
packages="`egg deps list | tr ' ' '\n' | sed -e 's|$$|/...@latest|'`"; \
packages="`egg deps list | tr ' ' '\n'`"; \
else \
packages="`go list -f $(selector) -m -mod=readonly all | sed -e 's|$$|/...@latest|'`"; \
packages="`go list -f $(selector) -m -mod=readonly all`"; \
fi; \
if [[ "$$packages" = "/...@latest" ]]; then exit; fi; \
for package in $$packages; do go get -d $$package; done
if [ -z "$$packages" ]; then exit; fi; \
for package in $$packages; do \
go mod edit -require=$$package@latest; \
go mod tidy; \
done
$(AT) $(MAKE) deps-tidy
.PHONY: deps-update
2 changes: 1 addition & 1 deletion src/go/tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ tools-update: selector = '{{if not (or .Main .Indirect)}}{{.Path}}{{end}}'
tools-update:
$(AT) cd tools; \
if command -v egg >/dev/null; then \
packages="`egg deps list | tr ' ' '\n' | sed -e 's|$$|/...@latest|'`"; \
packages="`egg deps list | tr ' ' '\n'`"; \
else \
packages="`go list -f $(selector) -m -mod=readonly all`"; \
fi; \
Expand Down

0 comments on commit cf535c5

Please sign in to comment.