name spec/patch_file by real crate name

When renaming using patch file, we really want to change file names too.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Gnatenko 2018-09-10 23:37:40 +02:00
parent 72c0a79dde
commit 0dc9fc182e
No known key found for this signature in database
GPG key ID: 695714BD1BBC5F4C

View file

@ -218,7 +218,7 @@ def main():
template = JINJA_ENV.get_template("main.spec")
if args.patch and len(diff) > 0:
patch_file = "{}-fix-metadata.diff".format(crate)
patch_file = "{}-fix-metadata.diff".format(metadata.name)
else:
patch_file = None
@ -269,7 +269,7 @@ def main():
kwargs["license"] = license
kwargs["license_comments"] = comments
spec_file = "rust-{}.spec".format(crate)
spec_file = "rust-{}.spec".format(metadata.name)
spec_contents = template.render(md=metadata, patch_file=patch_file, **kwargs)
if args.stdout:
print("# {}".format(spec_file))