Add support for --suffix
For compat packages. Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
This commit is contained in:
parent
d9b2cef72e
commit
adba767c55
2 changed files with 12 additions and 2 deletions
|
@ -239,6 +239,8 @@ def main():
|
|||
help="Activate all available features")
|
||||
parser.add_argument("--dynamic-buildrequires", action="store_true",
|
||||
help="Use dynamic BuildRequires feature")
|
||||
parser.add_argument("--suffix", action="store",
|
||||
help="Package suffix")
|
||||
parser.add_argument("crate", help="crates.io name\n"
|
||||
"path/to/local.crate\n"
|
||||
"path/to/project/",
|
||||
|
@ -339,7 +341,15 @@ def main():
|
|||
|
||||
kwargs["distconf"] = conf[args.target]
|
||||
|
||||
spec_file = f"rust-{metadata.name}.spec"
|
||||
if args.suffix is not None:
|
||||
if metadata.name[-1].isdigit():
|
||||
suffix = f'-{args.suffix}'
|
||||
else:
|
||||
suffix = args.suffix
|
||||
else:
|
||||
suffix = ""
|
||||
kwargs["pkg_suffix"] = suffix
|
||||
spec_file = f"rust-{metadata.name}{suffix}.spec"
|
||||
spec_contents = template.render(md=metadata, patch_file=patch_file, **kwargs)
|
||||
if args.stdout:
|
||||
print(f"# {spec_file}")
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
%global real_crate {{ crate }}
|
||||
{% endif %}
|
||||
|
||||
Name: rust-%{crate}
|
||||
Name: rust-%{crate}{{ pkg_suffix }}
|
||||
Version: {{ md.version }}
|
||||
Release: {{ pkg_release }}
|
||||
{% if md.description is none %}
|
||||
|
|
Loading…
Reference in a new issue