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

Fix GH-82: broken build with special characters in 'Name:' tag #84

Merged
merged 2 commits into from
Jan 12, 2018

Conversation

akopytov
Copy link
Member

@akopytov akopytov commented Dec 5, 2017

When generating RPMNAME from the 'Name:' tag in RPM Spec, expand RPM
macros to avoid breaking the build with 1) non-alphanumeric characters
in a Make variable and 2) inconsistencies between package names
generated by RPM tools and the ones being used by packpack.

When generating RPMNAME from the 'Name:' tag in RPM Spec, expand RPM
macros to avoid breaking the build with 1) non-alphanumeric characters
in a Make variable and 2) inconsistencies between package names
generated by RPM tools and the ones being used by packpack.
@akopytov
Copy link
Member Author

akopytov commented Dec 6, 2017

CentOS 6 was a problem, because rpmspec is not available there. Fixed.

@rtsisyk rtsisyk merged commit 8d46850 into packpack:master Jan 12, 2018
@rtsisyk
Copy link
Member

rtsisyk commented Jan 12, 2018

Sorry for the delay. Pushed, thanks!

@akopytov akopytov deleted the gh-82 branch January 15, 2018 06:52
@sergeyklay
Copy link
Member

sergeyklay commented Mar 9, 2018

@rtsisyk This PR broke our builds for CentOS 7. Now we have such build errors:

sudo dnf builddep -y /build/-3.3.2-1.ius.el7.centos.src.rpm || sudo yum-builddep -y /build/-3.3.2-1.ius.el7.centos.src.rpm

...
...
...

Error: Could not open /build/-3.3.2-1.ius.el7.centos.src.rpm .
Try running yum-builddep with the --nogpgcheck option.
There was a problem getting the build deps, exiting:
   Could not open local rpm file: /build/-3.3.2-1.ius.el7.centos.src.rpm: Unable to open file
make: *** [package] Error 1
rm /build/ls-lR.txt /build/VERSION
make: Leaving directory `/source'
make: *** [package] Error 2

Steps to reproduce:

$ echo "Name: 50me-P4ck4ge-N4me-W1th-D1g1ts" > test.spec
$ echo "Version: %{version}" >> test.spec
$ echo "Release: 1.%{repo_vendor}%{?dist}" >> test.spec
$ echo "Summary: High performance awesome tool" >> test.spec
$ echo "License: BSD 3-Clause" >> test.spec
$ /usr/bin/rpmspec -P test.spec
error: Too many levels of recursion in macro expansion. It is likely caused by recursive macro declaration.

Old behavior without using rpmspec:

$ sed -n -e 's/Name:\([\ \t]*\)\(.*\)/\2/p' test.spec
50me-P4ck4ge-N4me-W1th-D1g1ts

Refs:

sergeyklay added a commit to phalcon/packagecloud that referenced this pull request Mar 10, 2018
@akopytov
Copy link
Member Author

@sergeyklay the first link to RedHat Bugzilla says the reason for recursion is "Version: %{version}", so one should avoid that construct. Which makes even more sense with packpack, since that tag is overridden anyway. Would fixing the spec file instead be a better idea?

@sergeyklay
Copy link
Member

@akopytov It seems to me we need at least a "flag" to disable/enable current behavior with rpmspec.

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.

None yet

3 participants