#2 Preserve macros in name
Closed by zbyszek. Opened by churchyard.
churchyard/pyrenamer macroname  into  master

Download 2.patch

Fixes https://pagure.io/pyrenamer/issue/1

This uses the original casing of the name. E.g. the diff between the diff before your patch and with your patch:

 +%description %_description
 +
-+%package -n python2-4suite-xml
++%package -n python2-4Suite-XML
 +Summary: %summary
-+%{?python_provide:%python_provide python2-4suite-xml}
++%{?python_provide:%python_provide python2-4Suite-XML}
 +
-+%description -n python2-4suite-xml %_description
++%description -n python2-4Suite-XML %_description
 +

I think we want the names to be lower case. That's what ncoghlan wrote:

immediately before the first BuildRequires or Requires entry, add a
%package section header for "-n python2-" (where "" is the lowercased package source name with any "python-" prefix stripped)

and what the guidelines for package naming recommend. I think it'd be preferable not to add any new mixed-case names.

So I think it'd be better to filter out the cases where this would create a mixed-case name. First, look for the python3- subpackage declaration, and if that uses a macro, try that in preference to the macro from "Name:". And second, do rpmspec -q --qf '%{name}\n' ... | grep python2- and if that gives a mixed-case name, revert to using the lower-case string in the python2- subpackage declaration.

This will give a few packages which will have python2- and python3- subpackages with different casing. I'd rather rename the python3- subpackages by hand. If I got my query correctly, that'd be:
- python-astroML/
- python-CacheControl/
- python-PyGithub/
- python-WSGIProxy2/
- python-astroML-addons/
- python-OWSLib/
- python-PyRSS2Gen/

I see. You are right, will revisit the patch tomorrow.

I rebased your patch and applied it, and then added a detection for name lowercasedness on top. Seems pretty nice now.

It seems I cannot close a PR. What?!

Update: found the button ;) It's just in an unexpected place.

Pull-Request has been closed by zbyszek

Oh, sorry for not finishing it. I was overwhelmed with other deadlines.

No, no problem. It was fun to work on this.

Metadata