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

change hardcoded bash completions path in rpm spec #15354

Closed
wants to merge 2 commits into from

Conversation

adamdmoss
Copy link
Contributor

@adamdmoss adamdmoss commented Oct 4, 2023

Motivation and Context

Description

This PR attempts to fix or work around #15355 ...

Since approximately eb955f6 a --with-config=srpm build fails like so:

+ /usr/lib/rpm/brp-remove-la-files
Processing files: zfs-2.2.99-308_g621fe1260.x86_64
error: File not found: /tmp/zfs-build-adam-KVjzreNT/BUILDROOT/zfs-2.2.99-308_g621fe1260.x86_64/etc/bash_completion.d/zfs


RPM build errors:
    File not found: /tmp/zfs-build-adam-KVjzreNT/BUILDROOT/zfs-2.2.99-308_g621fe1260.x86_64/etc/bash_completion.d/zfs
make[1]: *** [Makefile:14265: rpm-common] Error 1

This PR hardcodes the new bash completions path into the rpm spec. Dunno if this is the right 'fix' and maybe the way I'm building debs is obsolete (rpm->deb 'alien' conversion) and nobody told me, but here ya go, at least it unbroke builds for me. 😸

I'm guessing that instead of hardcoding either the old location or /usr/share/bash-completion/completions, the .spec.in file should actually be consuming $bashcompletiondir from autoconf (config/zfs-build.m4). But my efforts at making the spec.in 'see' that value have not been successful.

How Has This Been Tested?

Local testing.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

Signed-off-by: Adam Moss <c@yotes.com>
@adamdmoss adamdmoss changed the title remove bash_completion.d/zfs from rpm spec too change hardcoded bash completions path in rpm spec Oct 4, 2023
@@ -522,7 +522,7 @@ systemctl --system daemon-reload >/dev/null || true
%config(noreplace) %{_sysconfdir}/%{name}/vdev_id.conf.*.example
%attr(440, root, root) %config(noreplace) %{_sysconfdir}/sudoers.d/*

%config(noreplace) %{_sysconfdir}/bash_completion.d/zfs
%config(noreplace) /usr/share/bash-completion/completions

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should probably just be:

%{_datadir}/bash-completion/completions

(%{_datadir} expands to /usr/share and since the files live in /usr now, %config(noreplace) should probably be removed so RPM doesn't try to preserve edits.)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would break building on RHEL and related systems, which do expect bash_completion files in /etc/bash_completion.d

@siv0 siv0 mentioned this pull request Oct 6, 2023
13 tasks
@behlendorf
Copy link
Contributor

Closing in favor of the approach in #15365, thank you both for looking in to this and sorting it out.

@behlendorf behlendorf closed this Oct 6, 2023
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.

4 participants