generator: improve version autodetection to match other render targets
This commit is contained in:
parent
95622b6198
commit
445feba9ee
7 changed files with 11 additions and 9 deletions
|
@ -117,6 +117,7 @@ def main():
|
|||
spec_contents = spec_render_workspace(
|
||||
metadata=metadata,
|
||||
main_package=main_package,
|
||||
upstream_version=version,
|
||||
target=args.target,
|
||||
rpm_name=rpm_name,
|
||||
license_files=license_files,
|
||||
|
|
|
@ -512,6 +512,7 @@ def spec_render_workspace(
|
|||
*,
|
||||
metadata: Metadata,
|
||||
main_package: Package,
|
||||
upstream_version: str,
|
||||
target: str,
|
||||
rpm_name: str,
|
||||
license_files: list[str],
|
||||
|
@ -532,9 +533,7 @@ def spec_render_workspace(
|
|||
|
||||
is_cdylib = metadata.is_cdylib()
|
||||
|
||||
upstream_version = main_package.version
|
||||
rpm_version = Version.parse(upstream_version).to_rpm()
|
||||
|
||||
rpm_description = main_package.get_description()
|
||||
rpm_summary = main_package.get_summary()
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
%bcond_without check
|
||||
|
||||
Name: system76-keyboard-configurator
|
||||
Version: 0.1.0
|
||||
Version: 1.3.9
|
||||
Release: %autorelease
|
||||
Summary: # FIXME
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
%bcond_without check
|
||||
|
||||
Name: system76-keyboard-configurator
|
||||
Version: 0.1.0
|
||||
Version: 1.3.9
|
||||
Release: %mkrel 1
|
||||
Summary: # FIXME
|
||||
Group: Development/Rust
|
||||
|
@ -88,5 +88,5 @@ BuildRequires: (crate(zbus/default) >= 1.9.1 with crate(zbus/default) < 2.0.0~)
|
|||
%{_bindir}/system76-keyboard-configurator
|
||||
|
||||
%changelog
|
||||
* Thu Jan 01 1970 Jane Jane <jane@jane.org> - 0.1.0-1
|
||||
* Thu Jan 01 1970 Jane Jane <jane@jane.org> - 1.3.9-1
|
||||
- Initial package
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
%bcond_without check
|
||||
|
||||
Name: system76-keyboard-configurator
|
||||
Version: 0.1.0
|
||||
Version: 1.3.9
|
||||
Release: 0
|
||||
Summary: # FIXME
|
||||
Group: Development/Libraries/Rust
|
||||
|
@ -106,5 +106,5 @@ BuildRequires: (crate(zbus/default) >= 1.9.1 with crate(zbus/default) < 2.0.0~)
|
|||
|
||||
%changelog
|
||||
* Thu Jan 01 03:25:45 GMT 1970 Jane Jane <jane@jane.org>
|
||||
- Version 0.1.0
|
||||
- Version 1.3.9
|
||||
- Initial package
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
%bcond_without check
|
||||
|
||||
Name: system76-keyboard-configurator
|
||||
Version: 0.1.0
|
||||
Version: 1.3.9
|
||||
Release: 1%{?dist}
|
||||
Summary: # FIXME
|
||||
|
||||
|
@ -87,5 +87,5 @@ BuildRequires: (crate(zbus/default) >= 1.9.1 with crate(zbus/default) < 2.0.0~)
|
|||
%{_bindir}/system76-keyboard-configurator
|
||||
|
||||
%changelog
|
||||
* Thu Jan 01 1970 Jane Jane <jane@jane.org> - 0.1.0-1
|
||||
* Thu Jan 01 1970 Jane Jane <jane@jane.org> - 1.3.9-1
|
||||
- Initial package
|
||||
|
|
|
@ -156,6 +156,7 @@ def test_spec_file_render_project(filename: str, vendor_tarball: Optional[str],
|
|||
def test_spec_file_render_workspace(filename: str, vendor_tarball: Optional[str], target: str):
|
||||
crate_name_version = filename.removesuffix(".json")
|
||||
crate = crate_name_version.rsplit("-", 1)[0]
|
||||
version = crate_name_version.rsplit("-", 1)[1]
|
||||
|
||||
real_path = resources.files("rust2rpm.tests.samples").joinpath(filename)
|
||||
metadata = Metadata.from_json(real_path.read_text())
|
||||
|
@ -163,6 +164,7 @@ def test_spec_file_render_workspace(filename: str, vendor_tarball: Optional[str]
|
|||
rendered = spec_render_workspace(
|
||||
metadata=metadata,
|
||||
main_package=guess_main_package(metadata),
|
||||
upstream_version=version,
|
||||
target=target,
|
||||
rpm_name=crate,
|
||||
license_files=["LIC1", "LIC2"],
|
||||
|
|
Loading…
Reference in a new issue