#191 Fix rpm command to get changelog from SPEC
Merged by cqi. Opened by cqi.
cqi/rpkg fix-bug-1412224  into  master

Download 191.patch

Commands.rpmdefines was not added to rpm command to get changelog from
SPEC. This causes SPEC cannot be parsed correctly if it contains SourceN
or PatchN. Like other methods in Commands class that runs rpm,
Commands.rpmdefines should be always added to the rpm command.

Resolves: rhbz#1412224

Signed-off-by: Chenxiong Qi cqi@redhat.com

rebased

This will break if If the path to spec file contains a space. Maybe splitting rpmdefines on first space to create a list like ['--define', '_sourcedir …', …] would be safer?

rebased

This will break if If the path to spec file contains a space. Maybe splitting rpmdefines on first space to create a list like ['--define', '_sourcedir …', …] would be safer?

Hi @lsedlar, fixed this in the same way of load_nameverrel. Thanks for catching this bug.

Hmm, it still does not work with a path with space. For example in the systemd example from original bug report (after renaming parent directory from systemd to break me) I'm getting malformed %include statement. This is failing at rpm level and I can't find a combination of quotes that would fix that. I say let's not worry about it and get the fix out the way it is now.

Okay. I have no idea what %include does. I run the raw rpm by quoting all paths, like --define '_sourcedir "/home/cqi/packages/my fedora packages/systemd"', it still breaks the parse.

It could probably be caused by rpm itself. From line 462, rpm does not handle space within path.

Yeah, could be. The %include statement should just take another file and put it into the spec file. A use case I know of is to move long changelog to a separate file.

The fix is good from my point of view :thumbsup:

this needs to be rebased. It is causing breakage for at least fedora-release package

Yup, rebasing now.

rebased

rebased

There's a typo here: referernce -> reference. Not a big deal :)

Looks good to me.

rebased

Rebased and fixed the typo.

rebased

Pull-Request has been merged by cqi

Bug mentioned in my comment is fixed already in rpm 9d38b2f.

Metadata