#57 Backport macros.shell-completions from Fedora
Merged a year ago by sergiomb. Opened 2 years ago by tmz.
rpms/ tmz/epel-rpm-macros tmz/epel8-shell-completions  into  epel8

file modified
+8 -2
@@ -1,6 +1,6 @@ 

  Name:           epel-rpm-macros

  Version:        8

- Release:        34

+ Release:        35

  Summary:        Extra Packages for Enterprise Linux RPM macros

  

  License:        GPLv2
@@ -22,6 +22,7 @@ 

  

  # misc macros

  Source150:      macros.build-constraints

+ Source151:      https://src.fedoraproject.org/rpms/redhat-rpm-config/raw/rawhide/f/macros.shell-completions

I'm a hesitant about pinning to a branch, because it's ambiguous, but I'll defer to you.

  

  BuildArch:      noarch

  Requires:       redhat-release >= %{version}
@@ -92,7 +93,8 @@ 

  # misc macros

  install -Dpm 644 %{SOURCE150} \

      %{buildroot}%{_rpmmacrodir}/macros.build-constraints

- 

+ install -Dpm 644 %{SOURCE151} \

+     %{buildroot}%{_rpmmacrodir}/macros.shell-completions

  

  %files

  %license GPL
@@ -102,6 +104,7 @@ 

  

  # misc macros

  %{_rpmmacrodir}/macros.build-constraints

+ %{_rpmmacrodir}/macros.shell-completions

  

  %files systemd

  # sysusers
@@ -112,6 +115,9 @@ 

  

  

  %changelog

+ * Tue Nov 22 2022 Todd Zullinger <tmz@pobox.com> - 8-35

+ - Backport macros.shell-completions from Fedora

+ 

  * Tue Nov 08 2022 Maxwell G <gotmax@e.email> - 8-34

  - Set %%__python3 to /usr/bin/python3.6 by default

  

file modified
+4 -1
@@ -8,7 +8,10 @@ 

  %_monogacdir %{_monodir}/gac

  

  # Bash completions; not in bash to not intefere with install ordering

- %bash_completion_dir %{_datadir}/bash-completion/completions/

+ #

+ # NOTE: This macro is deprecated; point to the preferred macro from

+ # macros.shell-completions

+ %bash_completion_dir %{bash_completions_dir}

  

  # Use the non-underscored Python macros to refer to Python in spec, etc.

  %python2 %__python2

@@ -0,0 +1,3 @@ 

+ %bash_completions_dir   %{_datadir}/bash-completion/completions

+ %zsh_completions_dir    %{_datadir}/zsh/site-functions

+ %fish_completions_dir   %{_datadir}/fish/vendor_completions.d

Add a note that the older %bash_completion_dir macro is deprecated.

(cherry picked from commit c212ede)

As mentioned on the devel list: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/VVL2OAMMA77V37LRBAIV5FH56IJFPWZM/

Build failed. More information on how to proceed and troubleshoot errors available at https://fedoraproject.org/wiki/Zuul-based-ci

Note this fix %bash_completion_dir on epel-rpm-macros which should be %bash_completions_dir

Would this be better as (

%bash_completion_dir %{warn:%%{bash_completion_dir} is deprecated. Use %%{bash_completions_dir} instead.}%{bash_completions_dir}

)?

I'm a hesitant about pinning to a branch, because it's ambiguous, but I'll defer to you.

If there are no annoyances with nor objections to adding such a warning, then sure. I don't have any strong preference for or against.

On EL7, the warning is printed without a newline. I don't know if that will matter in practical use:

$ rpm -E '%{warn:%%{bash_completion_dir} is deprecated. Use %%{bash_completions_dir} instead.}%{bash_completions_dir}'
%{bash_completion_dir} is deprecated. Use %{bash_completions_dir} instead./usr/share/bash-completion/completions

I'm a hesitant about pinning to a branch, because it's ambiguous, but I'll defer to you.

Since we're not downloading the source via the URL each time, I don't think it's a problem. It makes it slightly easier to refresh if/when desired though, by just removing the current file and using spectool -g. And it saves the need for a comment line. That's my thinking, anyway.

I don't have a strong preference either way. :)

Since we're not downloading the source via the URL each time, I don't think it's a problem. It makes it slightly easier to refresh if/when desired though, by just removing the current file and using spectool -g. And it saves the need for a comment line. That's my thinking, anyway.

Fair enough. I'm the original author of these macros, so I'll sync this if I make any changes.

On EL7, the warning is printed without a newline. I don't know if that will matter in practical use:

As an example, I added %global _bindir %{warn:error message}%{_bindir} to a specfile and parsed it with rpmspec -P on EL 7. %{_bindir} still evaluated properly. You can also run rpm -E .... 2>/dev/null and you'll see that that the result is the same with or without the %{warn}.

Either way, I'm thinking we can go without the warning. We're not going to remove this in a stable release, so I don't think it's worth the trouble.

in my point of view after check [1] and saw that we just have 4 cases with the wrong %bash_completion_dir

in warn I would write %{warn:%{bash_completion_dir} is a typo ....

and add 4 pull request fixing the 4 packages

[1]
https://sourcegraph.com/search?q=context:global+r:src.fedoraproject.org+file:.*%5C.spec+bash_completion_dir&patternType=regexp&case=yes&sm=0

But first lets approve this , build it and bring it to stable repositories just after that we can start fix all rpms specs that have bash_completion_dir

@everyone can I processed we need this ? this is a fix of one typo on %bash_completion_dir on epel-rpm-macros which should be %bash_completions_dir with "s" , without this in stable we can't fix the spec that use %bash_completions_dir with the typo

FWIW, I was waiting a bit to see whether any of the maintainers had comments before making any further changes here (such as adding the %{warning} macro).

Until we have some feedback from the maintainers, I don't see what we can do except wait?

If the maintainers say they would prefer to have %{warn:...} around the old %bash_completion_dir macro, that's easy to add.

As a reminder (to myself as much as anyone), if we do mark %bash_completion_dir as deprecated in epel7/epel8, we should do the same for epel9 and try to ensure that it is not copied into epel10.

FWIW, I was waiting a bit to see whether any of the maintainers had comments before making any further changes here (such as adding the %{warning} macro).

I think we should add the warning , because is to remove (bash_completion_dir)
But I will merge this soon, with our without warning .

Pull-Request has been merged by sergiomb

a year ago