Hello community, here is the log from the commit of package rust-packaging for openSUSE:Factory checked in at 2020-05-26 17:20:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rust-packaging (Old) and /work/SRC/openSUSE:Factory/.rust-packaging.new.2738 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rust-packaging" Tue May 26 17:20:30 2020 rev:10 rq:808277 version:15 Changes: -------- --- /work/SRC/openSUSE:Factory/rust-packaging/rust-packaging.changes 2020-04-04 12:26:41.880006477 +0200 +++ /work/SRC/openSUSE:Factory/.rust-packaging.new.2738/rust-packaging.changes 2020-05-26 17:20:31.724130676 +0200 @@ -1,0 +2,14 @@ +Fri May 22 13:48:07 UTC 2020 - Neal Gompa <[email protected]> + +- Update to 15 + + metadata: Fix setting up tilde version in RPM + + templates: Generate files entry with no-tilde + + inspector: Add support for multiple features + + metadata: Support "renamed" dependencies + + Use `cargo install --no-track` with cargo 1.41 + + metadata: support versions like X.*.* + + Fix up Cargo.toml.orig error message that started to appear with Rust 1.43.0 +- Remove downstream patch + + cargo-install.patch + +------------------------------------------------------------------- --- /work/SRC/openSUSE:Factory/rust-packaging/rust-srpm-macros.changes 2019-12-05 17:33:48.269452719 +0100 +++ /work/SRC/openSUSE:Factory/.rust-packaging.new.2738/rust-srpm-macros.changes 2020-05-26 17:20:31.844130934 +0200 @@ -1,0 +2,12 @@ +Fri May 22 13:48:07 UTC 2020 - Neal Gompa <[email protected]> + +- Update to 15 + + metadata: Fix setting up tilde version in RPM + + templates: Generate files entry with no-tilde + + inspector: Add support for multiple features + + metadata: Support "renamed" dependencies + + Use `cargo install --no-track` with cargo 1.41 + + metadata: support versions like X.*.* + + Fix up Cargo.toml.orig error message that started to appear with Rust 1.43.0 + +------------------------------------------------------------------- Old: ---- cargo-install.patch rust2rpm-11.tar.xz New: ---- rust2rpm-15.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rust-packaging.spec ++++++ --- /var/tmp/diff_new_pack.eMyjra/_old 2020-05-26 17:20:32.560132474 +0200 +++ /var/tmp/diff_new_pack.eMyjra/_new 2020-05-26 17:20:32.564132482 +0200 @@ -4,7 +4,7 @@ # Copyright (c) 2020 SUSE LLC # Copyright (c) 2017 Red Hat, Inc., Raleigh, North Carolina, United States of America. # Copyright (c) 2017, 2019 Igor Gnatenko <[email protected]>. -# Copyright (c) 2019 Neal Gompa <[email protected]>. +# Copyright (c) 2020 Neal Gompa <[email protected]>. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -22,14 +22,13 @@ %bcond_without check Name: rust-packaging -Version: 11 +Version: 15 Release: 0 Summary: RPM macros for building Rust packages on various architectures License: MIT Group: Development/Languages/Rust URL: https://pagure.io/fedora-rust/rust2rpm Source0: https://releases.pagure.org/fedora-rust/rust2rpm/rust2rpm-%{version}.tar.xz -Patch0: cargo-install.patch BuildArch: noarch ExclusiveArch: %{rust_arches} noarch ++++++ rust-srpm-macros.spec ++++++ --- /var/tmp/diff_new_pack.eMyjra/_old 2020-05-26 17:20:32.584132525 +0200 +++ /var/tmp/diff_new_pack.eMyjra/_new 2020-05-26 17:20:32.588132534 +0200 @@ -4,7 +4,7 @@ # Copyright (c) 2020 SUSE LLC # Copyright (c) 2017 Red Hat, Inc., Raleigh, North Carolina, United States of America. # Copyright (c) 2017, 2019 Igor Gnatenko <[email protected]>. -# Copyright (c) 2019 Neal Gompa <[email protected]>. +# Copyright (c) 2020 Neal Gompa <[email protected]>. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,7 +20,7 @@ Name: rust-srpm-macros -Version: 11 +Version: 15 Release: 0 Summary: RPM macros for building Rust source packages License: MIT ++++++ rust2rpm-11.tar.xz -> rust2rpm-15.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rust2rpm-11/data/cargo.attr new/rust2rpm-15/data/cargo.attr --- old/rust2rpm-11/data/cargo.attr 2019-12-04 07:56:50.000000000 +0100 +++ new/rust2rpm-15/data/cargo.attr 2020-05-22 15:54:31.000000000 +0200 @@ -1,3 +1,3 @@ -%__cargo_provides %{_bindir}/cargo-inspector --provides --feature=%{__cargo_feature_from_name -n %{name}} -%__cargo_requires %{_bindir}/cargo-inspector --requires --feature=%{__cargo_feature_from_name -n %{name}} +%__cargo_provides %{_bindir}/cargo-inspector --provides --features=%{__cargo_feature_from_name -n %{name}} +%__cargo_requires %{_bindir}/cargo-inspector --requires --features=%{__cargo_feature_from_name -n %{name}} %__cargo_path ^%{cargo_registry}/[^/]+/Cargo\\.toml$ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rust2rpm-11/data/macros.cargo new/rust2rpm-15/data/macros.cargo --- old/rust2rpm-11/data/macros.cargo 2019-12-04 07:56:50.000000000 +0100 +++ new/rust2rpm-15/data/macros.cargo 2020-05-22 15:54:31.000000000 +0200 @@ -90,10 +90,10 @@ # so that cargo doesn't fail resolving dependencies: \ # https://github.com/rust-lang/cargo/pull/6729 \ %{__awk} -i inplace -v INPLACE_SUFFIX=.deps '/^\\\[((.+\\\.)?((dev|build)-)?dependencies|features)/{f=1;next} /^\\\[/{f=0}; !f' Cargo.toml \ - %{__cargo} package -l | grep -w -v Cargo.lock | xargs -d '\\\n' %{__cp} --parents -a -t $REG_DIR \ + %{__cargo} package -l | grep -w -E -v 'Cargo.(lock|toml.orig)' | xargs -d '\\\n' %{__cp} --parents -a -t $REG_DIR \ %{__mv} Cargo.toml{.deps,} \ %{__cp} -a Cargo.toml $REG_DIR/Cargo.toml \ - %{__rm} -f $REG_DIR/Cargo.toml.{orig,deps} \ + %{__rm} -f $REG_DIR/Cargo.toml.deps \ echo '{"files":{},"package":""}' > $REG_DIR/.cargo-checksum.json \ fi \ %if ! %__cargo_skip_build \ @@ -101,11 +101,11 @@ %{shrink:\ %{__cargo} install \ %{__cargo_common_opts} \ + --no-track \ --path . \ %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \ %* \ } \ - %{__rm} %{buildroot}%{_prefix}/.crates.toml \ fi \ %endif \ ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rust2rpm-11/rust2rpm/__init__.py new/rust2rpm-15/rust2rpm/__init__.py --- old/rust2rpm-11/rust2rpm/__init__.py 2019-12-04 07:56:50.000000000 +0100 +++ new/rust2rpm-15/rust2rpm/__init__.py 2020-05-22 15:54:31.000000000 +0200 @@ -1,4 +1,4 @@ from .metadata import * from . import licensing -__version__ = '11' +__version__ = '15' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rust2rpm-11/rust2rpm/inspector.py new/rust2rpm-15/rust2rpm/inspector.py --- old/rust2rpm-11/rust2rpm/inspector.py 2019-12-04 07:56:50.000000000 +0100 +++ new/rust2rpm-15/rust2rpm/inspector.py 2020-05-22 15:54:31.000000000 +0200 @@ -9,6 +9,7 @@ group = parser.add_mutually_exclusive_group(required=True) group.add_argument("-n", "--name", action="store_true", help="Print name") group.add_argument("-v", "--version", action="store_true", help="Print version") + group.add_argument("-rv", "--rpm-version", action="store_true", help="Print version (in RPM format)") group.add_argument("-t", "--target-kinds", action="store_true", help="Print target kinds") group.add_argument("-l", "--list-features", action="store_true", help="Print features") group.add_argument("-P", "--provides", action="store_true", help="Print Provides") @@ -17,14 +18,15 @@ group.add_argument("-TR", "--test-requires", action="store_true", help="Print TestRequires") fgroup = parser.add_mutually_exclusive_group() fgroup.add_argument("-a", "--all-features", action="store_true", help="Activate all features") - fgroup.add_argument("-f", "--feature", default="default", help="Feature to work on") + fgroup.add_argument("-f", "--features", default="default", help="Feature(s) to work on (comma-separated)") parser.add_argument("file", nargs="*", help="Path(s) to Cargo.toml") args = parser.parse_args() files = args.file or sys.stdin.readlines() - if not args.feature: - args.feature = None + features = set() + for f in args.features.split(","): + features.add(f or None) def print_deps(deps): if len(deps) > 0: @@ -36,6 +38,8 @@ if args.name: print(md.name) if args.version: + print(md._version) + if args.rpm_version: print(md.version) if args.target_kinds: print("\n".join(set(tgt.kind for tgt in md.targets))) @@ -43,20 +47,23 @@ for f in sorted(f for f in md.dependencies if f is not None): print(f) if args.provides: - print(md.provides(args.feature)) + for f in features: + print(md.provides(f)) if args.requires: # Someone should own /usr/share/cargo/registry print("cargo") if args.all_features: print_deps(md.all_dependencies) else: - print_deps(md.requires(args.feature)) + for f in features: + print_deps(md.requires(f)) if args.build_requires: print("rust-packaging") if args.all_features: print_deps(md.all_dependencies) else: - print_deps(md.requires(args.feature, resolve=True)) + for f in features: + print_deps(md.requires(f, resolve=True)) if args.test_requires: print_deps(md.dev_dependencies) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rust2rpm-11/rust2rpm/metadata.py new/rust2rpm-15/rust2rpm/metadata.py --- old/rust2rpm-11/rust2rpm/metadata.py 2019-12-04 07:56:50.000000000 +0100 +++ new/rust2rpm-15/rust2rpm/metadata.py 2020-05-22 15:54:31.000000000 +0200 @@ -44,7 +44,7 @@ f'specification: {requirement}') match = re.match( - r'^(?:([\d.]*\*))$|^(?:(<|<=|=|==|>=|>||!=|\^|~|~=)(\d.*))$', + r'^(?:([\d.\*]*\*))$|^(?:(<|<=|=|==|>=|>||!=|\^|~|~=)(\d.*))$', requirement) if not match: raise ValueError(f'Invalid requirement ' @@ -219,11 +219,9 @@ class Metadata: def __init__(self, name, version): self.name = name - self._version = version - version_normalized = CargoSemVer.unparse_version( - CargoSemVer.coerce( - CargoSemVer.parse_version(self._version))) - self.version = version_normalized + coerced_version = CargoSemVer.coerce(CargoSemVer.parse_version(version)) + self._version = CargoSemVer.unparse_version(coerced_version) + self.version = CargoSemVer.unparse_version(coerced_version, sep="~") self.license = None self.license_file = None self.readme = None @@ -288,14 +286,17 @@ for dep in md["dependencies"]: if dep["kind"] == "dev": continue - deps_by_name[dep["name"]].append(Dependency.from_json(dep)) + deps_by_name[dep["rename"] or dep["name"]].append(Dependency.from_json(dep)) deps_by_feature = {} + local_features = set(md["features"]) | set( + d["rename"] for d in md["dependencies"] if d["rename"] is not None + ) for feature, f_deps in md["features"].items(): features = {None} deps = set() for dep in f_deps: - if dep in md["features"]: + if dep in local_features: features.add(dep) else: pkg, _, f = dep.partition("/") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rust2rpm-11/rust2rpm/templates/main.spec new/rust2rpm-15/rust2rpm/templates/main.spec --- old/rust2rpm-11/rust2rpm/templates/main.spec 2019-12-04 07:56:50.000000000 +0100 +++ new/rust2rpm-15/rust2rpm/templates/main.spec 2020-05-22 15:54:31.000000000 +0200 @@ -170,9 +170,9 @@ {% if md.readme is not none %} %doc {{ md.readme }} {% endif %} -%{cargo_registry}/%{crate}-%{version}/ +%{cargo_registry}/%{crate}-%{version_no_tilde}/ {% else %} -%ghost %{cargo_registry}/%{crate}-%{version}/Cargo.toml +%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml {% endif %} {% endfor %} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rust2rpm-11/test.py new/rust2rpm-15/test.py --- old/rust2rpm-11/test.py 2019-12-04 07:56:50.000000000 +0100 +++ new/rust2rpm-15/test.py 2020-05-22 15:54:31.000000000 +0200 @@ -31,8 +31,10 @@ "crate(test) >= 0.0.0"), ("1.*", "(crate(test) >= 1.0.0 with crate(test) < 2.0.0)"), - ("1.2*", + ("1.2.*", "(crate(test) >= 1.2.0 with crate(test) < 1.3.0)"), + ("1.*.*", + "(crate(test) >= 1.0.0 with crate(test) < 2.0.0)"), (">= 1.2.0", "crate(test) >= 1.2.0"), ("> 1", @@ -100,6 +102,7 @@ ('*', ('*', (None, None, None, None, None))), ('0.*', ('*', (0, None, None, None, None))), ('0.1.*', ('*', (0, 1, None, None, None))), + ('0.*.*', ('*', (0, None, None, None, None))), ('<0', ('<', (0, None, None, None, None))), ('<0.1', ('<', (0, 1, None, None, None))), ('<0.1.2', ('<', (0, 1, 2, None, None))),
