Bug 88689
Summary: | rpmbuild gives misleading/meaningless "Package already exists" errors | ||
---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | Gilles Detillieux <grdetil> |
Component: | rpm-build | Assignee: | Jeff Johnson <jbj> |
Status: | CLOSED WORKSFORME | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 9 | ||
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2003-04-14 18:43:55 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Gilles Detillieux
2003-04-11 22:03:51 UTC
Yes, the redhat-rpm-config package is overloading %install, so innocent uses of %install now get expanded in mysterious ways. Escaping the % (i.e. "%%install" not "%install") in comment is the best fix. Thanks, Jeff. Your response explains why rpmbuild now has problems with the %install in the changelog, but it doesn't explain why the error message is so misleading. What does 'error: Package already exists: %package debuginfo' have to do with anything that I was doing? If it gave a useful message like error: Section already exists: %install instead, I wouldn't have wasted hours trying to figure out what could possibly be the problem with my .spec files. There are two objects both with name "%install". The first is a section marker, this is the object you know well. The other is a macro, which is expanded wherever found, and, in this case, is being used as a vehicle to carry a definition for a -debuginfo sub-package into a spec file just before the %install section. Unfortunately, if "%install" is used elsewhere, then there are unintended side effects. The config is in /usr/lib/rpm/redhat/macros if you're interested. BTW, this is a requested feature that -debuginfo packages can be produced w/o changing spec files, although is is very mysterious. This is all very informative, but it only confirms my suspicion that without some pretty intimate knowledge of how rpmbuild works internally, a casual user doesn't have a hope of understanding this particular error message. If it's too difficult to change the error message to give a bit of context as to where the error occurs (even just a .spec file line number would be a HUGE help), then there really ought to be a section in the rpmbuild man page that gives a proper explanation of what this error message means. Red Hat 9 has only been out a week, so I don't think I'm going to be the only user to be totally baffled by this very mysterious message. I have to agree with Gilles, having been through the same process myself with the exact same error, and not knowing wtf was wrong. I had to hack off the bottom half of my spec file, basically the entire %changelog section which had some comments containing %%'s, and others having single %'s (which seemed to be causing the problem). There were so many single %'s, that it was easier to just remove the whole changelog to get things working. -greg |