@@ -9,8 +9,7 @@ override_dh_auto_build:
99 mkdir -p /go/src/github.com/docker && \
1010 ln -snf $(CURDIR ) /cli /go/src/github.com/docker/cli && \
1111 cd /go/src/github.com/docker/cli && \
12- VERSION=$(VERSION ) GITCOMMIT=$(REVISION ) LDFLAGS=' ' GO_LINKMODE=dynamic ./scripts/build/binary && \
13- DISABLE_WARN_OUTSIDE_CONTAINER=1 LDFLAGS=' ' make manpages shell-completion
12+ make DISABLE_WARN_OUTSIDE_CONTAINER=1 VERSION=$(VERSION ) GITCOMMIT=$(REVISION ) LDFLAGS=' ' dynbinary manpages shell-completion
1413
1514override_dh_auto_test :
1615 ver=" $$ (cli/build/docker --version)" ; \
@@ -26,9 +25,40 @@ override_dh_dwz:
2625 @# https://packages.ubuntu.com/debhelper
2726
2827override_dh_auto_install :
29- install -D -m 0644 cli/build/completion/fish/docker.fish debian/docker-ce-cli/usr/share/fish/vendor_completions.d/docker.fish
30- install -D -m 0644 cli/build/completion/zsh/_docker debian/docker-ce-cli/usr/share/zsh/vendor-completions/_docker
31- install -D -m 0755 cli/build/docker debian/docker-ce-cli/usr/bin/docker
28+ install -D -p -m 0755 cli/build/docker debian/docker-ce-cli/usr/bin/docker
29+
30+ # docker-ce-cli shell-completion
31+ #
32+ # We are manually installing bash completions instead of using the "dh_bash-completion"
33+ # debhelper (see [1]); dh_bash-completion only supports bash, and none of the other shells,
34+ # which meant that we had to install 2 out of 3 manually, which was confusing ("what about
35+ # Bash?"). Given that locations to install these completion scripts are well-known, we
36+ # can safely use the manual approach for installing them.
37+ #
38+ # In future, can consider using "dh_shell_completions" (see [2]), which supports bash, zsh
39+ # and fish. However, "dh_shell_completions" is still really premature, and not available
40+ # in stable releases. So, currently, adding it as build-dependency, especially since
41+ # these are well-known, may not be a good choice, but we can revisit that in future
42+ # if things mature in this area.
43+ #
44+ # Observant readers may notice that we don't include PowerShell completion in
45+ # this list (even though Cobra provides them, and PowerShell *can* be installed
46+ # oon Linux). The short story is that there's no well-defined location, nor
47+ # a well-defined approach for this.
48+ #
49+ # The PowerShell maintainers (see [3]) considering that no completion scripts
50+ # are needed for anything following the PowerShell specifications, and for
51+ # anything else, PowerShell is capable enough to use zsh and bash completions.
52+ #
53+ # All of the above taken into account; it's fuzzy enough to just leave it as
54+ # an exercise for the user to decide what to do.
55+ #
56+ # [1]: https://manpages.debian.org/bookworm/bash-completion/dh_bash-completion.1.en.html
57+ # [2]: https://manpages.debian.org/testing/dh-shell-completions/dh_shell_completions.1.en.html
58+ # [3]: https://github.com/PowerShell/PowerShell/issues/17582
59+ install -D -p -m 0644 cli/build/completion/fish/docker.fish debian/docker-ce-cli/usr/share/fish/vendor_completions.d/docker.fish
60+ install -D -p -m 0644 cli/build/completion/zsh/_docker debian/docker-ce-cli/usr/share/zsh/vendor-completions/_docker
61+ install -D -p -m 0755 cli/build/docker debian/docker-ce-cli/usr/bin/docker
3262
3363override_dh_installinit :
3464 dh_installinit
0 commit comments