Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use cmake configured completion file #6

Merged
merged 1 commit into from
Aug 11, 2022
Merged

Use cmake configured completion file #6

merged 1 commit into from
Aug 11, 2022

Conversation

azeey
Copy link
Contributor

@azeey azeey commented Aug 4, 2022

We were using the ign.bash_completion.sh file from the source, not after it was configured by cmake. In gazebosim/gz-tools#103, I needed to use a cmake configured file in order to source gz1.completion from wherever it's installed. This is so that the bash completion files for other ign/gz libraries can be sourced automatically.

Also in that PR, I'm using cmake to install the etc/ign.bash_completion.sh to /usr/share/bash-completion/completions/ign, so the ignition-tools.install file can be simplified (no need for renames). It also makes it possible for users to build from ign-tools from source and still get tab completion.

In addition, this PR installs /usr/share/gz/gz1.completion, which wasn't being installed before.

The resulting deb file has the following contents

drwxr-xr-x root/root         0 2021-10-27 11:04 ./
drwxr-xr-x root/root         0 2021-10-27 11:04 ./usr/
drwxr-xr-x root/root         0 2021-10-27 11:04 ./usr/bin/
-rwxr-xr-x root/root      9256 2021-10-27 11:04 ./usr/bin/ign
drwxr-xr-x root/root         0 2021-10-27 11:04 ./usr/lib/
drwxr-xr-x root/root         0 2021-10-27 11:04 ./usr/lib/x86_64-linux-gnu/
-rw-r--r-- root/root     52040 2021-10-27 11:04 ./usr/lib/x86_64-linux-gnu/libignition-tools-backward.so
drwxr-xr-x root/root         0 2021-10-27 11:04 ./usr/share/
drwxr-xr-x root/root         0 2021-10-27 11:04 ./usr/share/bash-completion/
drwxr-xr-x root/root         0 2021-10-27 11:04 ./usr/share/bash-completion/completions/
-rw-r--r-- root/root      1981 2021-10-27 11:04 ./usr/share/bash-completion/completions/ign
drwxr-xr-x root/root         0 2021-10-27 11:04 ./usr/share/doc/
drwxr-xr-x root/root         0 2021-10-27 11:04 ./usr/share/doc/ignition-tools/
-rw-r--r-- root/root       396 2021-10-27 11:04 ./usr/share/doc/ignition-tools/changelog.Debian.gz
-rw-r--r-- root/root       328 2021-10-26 11:48 ./usr/share/doc/ignition-tools/copyright
drwxr-xr-x root/root         0 2021-10-27 11:04 ./usr/share/gz/
-rw-r--r-- root/root      1123 2021-10-27 11:04 ./usr/share/gz/gz1.completion

See gazebosim/gz-tools#103 for quick instructions for building the deb file locally.

Note
Not sure if this has been addressed before, but AFAIK, installing to /usr/share/bash-completion/completions/ign will prevent side-by-side installation of ign-tools. I guess for the near term it won't be a problem because ign-tools2 would be using gz instead of ign, but could be a problem if we have ign-tools3 at some point.

This also install the `gz*.completion` file.

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@azeey
Copy link
Contributor Author

azeey commented Aug 9, 2022

Build Status

Building to prerelease didn't work. Trying nightlies:
Build Status

@mjcarroll
Copy link

Also in that PR, I'm using cmake to install the etc/ign.bash_completion.sh to /usr/share/bash-completion/completions/ign

Should that be reflected in the nightly debs that were built above? I downloaded and queried and I'm seeing:

dpkg-deb --contents ignition-tools_1.4.1+nightly+git20220809+1r4e79cc3284847e59fe16f4c3b4b0be351e3213ea-1_focal_amd64.deb
drwxr-xr-x root/root         0 2022-08-09 15:38 ./
drwxr-xr-x root/root         0 2022-08-09 15:38 ./usr/
drwxr-xr-x root/root         0 2022-08-09 15:38 ./usr/bin/
-rwxr-xr-x root/root      9256 2022-08-09 15:38 ./usr/bin/ign
drwxr-xr-x root/root         0 2022-08-09 15:38 ./usr/lib/
drwxr-xr-x root/root         0 2022-08-09 15:38 ./usr/lib/x86_64-linux-gnu/
-rw-r--r-- root/root     39648 2022-08-09 15:38 ./usr/lib/x86_64-linux-gnu/libignition-tools-backward.so
drwxr-xr-x root/root         0 2022-08-09 15:38 ./usr/share/
drwxr-xr-x root/root         0 2022-08-09 15:38 ./usr/share/doc/
drwxr-xr-x root/root         0 2022-08-09 15:38 ./usr/share/doc/ignition-tools/
-rw-r--r-- root/root       500 2022-08-09 15:38 ./usr/share/doc/ignition-tools/changelog.Debian.gz
-rw-r--r-- root/root       328 2022-08-09 15:38 ./usr/share/doc/ignition-tools/copyright
drwxr-xr-x root/root         0 2022-08-09 15:38 ./usr/share/gz/
-rw-r--r-- root/root      1123 2022-08-09 15:38 ./usr/share/gz/gz1.completion
drwxr-xr-x root/root         0 2022-08-09 15:38 ./usr/share/gz/gz1.completion.d/
-rw-r--r-- root/root      1943 2022-08-09 15:38 ./usr/share/gz/gz1.completion.d/ign1.bash_completion.sh

@mjcarroll
Copy link

In a local docker container I believe I am seeing the correct results though:

dpkg-deb --contents ignition-tools_1.4.1-1~focal_amd64.deb
drwxr-xr-x root/root         0 2021-10-27 16:04 ./
drwxr-xr-x root/root         0 2021-10-27 16:04 ./usr/
drwxr-xr-x root/root         0 2021-10-27 16:04 ./usr/bin/
-rwxr-xr-x root/root      9256 2021-10-27 16:04 ./usr/bin/ign
drwxr-xr-x root/root         0 2021-10-27 16:04 ./usr/lib/
drwxr-xr-x root/root         0 2021-10-27 16:04 ./usr/lib/x86_64-linux-gnu/
-rw-r--r-- root/root     39648 2021-10-27 16:04 ./usr/lib/x86_64-linux-gnu/libignition-tools-backward.so
drwxr-xr-x root/root         0 2021-10-27 16:04 ./usr/share/
drwxr-xr-x root/root         0 2021-10-27 16:04 ./usr/share/bash-completion/
drwxr-xr-x root/root         0 2021-10-27 16:04 ./usr/share/bash-completion/completions/
-rw-r--r-- root/root      1981 2021-10-27 16:04 ./usr/share/bash-completion/completions/ign
drwxr-xr-x root/root         0 2021-10-27 16:04 ./usr/share/doc/
drwxr-xr-x root/root         0 2021-10-27 16:04 ./usr/share/doc/ignition-tools/
-rw-r--r-- root/root       396 2021-10-27 16:04 ./usr/share/doc/ignition-tools/changelog.Debian.gz
-rw-r--r-- root/root       328 2021-10-27 16:04 ./usr/share/doc/ignition-tools/copyright
drwxr-xr-x root/root         0 2021-10-27 16:04 ./usr/share/gz/
-rw-r--r-- root/root      1123 2021-10-27 16:04 ./usr/share/gz/gz1.completion

@chapulina
Copy link
Contributor

Should that be reflected in the nightly debs that were built above?

I think the regular nightlies built from the main branch probably overrode that test build already.

@azeey
Copy link
Contributor Author

azeey commented Aug 10, 2022

Sorry, I didn't build the debs with the correct gz-tools branch. Let me fix that.

@azeey
Copy link
Contributor Author

azeey commented Aug 10, 2022

New build: Build Status

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants