The code was very hard to read because it was doing explicit lists
concatenations. Let's make the code more python by using 'yield' on
the interesting items, and hide the creation of the list in a decorator.
rpmautspec has some shortcomings (e.g. lack of support for multi-line
changelog entries), but those shortcomings are not very important for
rust packages. Let's just use rpmautospec by default for convenience.
Do not include subdirectories as %doc. Fix#136.
Sort license and doc files alphabetically. Fix#135.
Only include doc files from the root directory. Fix#134.
If a crate has a feature with `+` in it's name,
the `%__cargo_feature_from_name` macro fails to correctly parse it.
For example, the `cxxbridge-flags` crate declares (among others)
the `c++20` feature; that is currently parsed as follows:
```lua
> string.match("cxxbridge-flags+c++20-devel", "^.+%+(.+)-devel$")
20
```
The adjusted regex matches the *first* `+` as feature name separator:
```lua
> string.match("cxxbridge-flags+c++20-devel", "^[^+]+%+(.+)-devel$")
c++20
```
The SPDX license short identifier for "GNU Lesser General Public License
v2.1 or later" is LGPL-2.1-or-later [0]. Add a SPDX to Fedora mapping.
[0]: https://spdx.org/licenses/LGPL-2.1-or-later.html
Most likely there are some missing checks for None and the program may
segfault, but this can be fixed in future.
Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
+ /usr/bin/env CARGO_HOME=.cargo RUSTC_BOOTSTRAP=1 /opt/rust/bin/cargo package -l
+ grep -w -v Cargo.lock
+ xargs -d '\n' /bin/cp --parents -a -t /user/rpmbuild/BUILDROOT/rust-term_size-0.3.0-1.i2n.x86_64/datastore/dev/rust/cargo/registry/term_size-0.3.0
warning: No (git) VCS found for `/datastore/rpmbuild/BUILD/term_size-0.3.0`
/bin/cp: cannot stat 'Cargo.toml.orig': No such file or directory
Signed-off-by: Igor Raits <ignatenkobrain@fedoraproject.org>
In cargo 1.41, `cargo install` adds a new `.crates2.json` file in the
install root for tracking version upgrades. This would be another file
that `%cargo_install` should remove afterward, but there is also a new
`--no-track` option which disables such metadata files altogether.
This update should be coordinated with the Rust toolchain update in the
distro, e.g. with rust-packaging `Requires: cargo >= 1.41`. The new
option will be rejected as an unstable option on earlier versions.
For example,
```toml
[dependencies]
open-ssl = { version="0.10", package = "openssl", optional = true }
[features]
openssl = ["actix-tls/openssl", "awc/openssl", "open-ssl"]
```
would end up previously with just +openssl subpackage with dependency on
crate(openssl). Now we create +open-ssl subpackage with dependency on
crate(openssl) and +openssl subpackage with dependencies on
crate(actix-tls/openssl), crate(awc/openssl) and +open-ssl subpackage.
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
This is not full fix, unfortunately since it breaks cargo-inspect. Paths
on the file system are still with `-`.
This reverts commit cfd3150663.
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
And set Fedora's default behavior is to enable DynamicBuildRequires.
All Fedora crates use dynamic BuildRequires and are built only in
Rawhide and is unlikely that anybody is building hundreds of crates
outside of Fedora infrastructure.
Closes: https://pagure.io/fedora-rust/rust2rpm/issue/97
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
It is simply impossible to fight against people putting
#![deny(warnings)] into the code…
Closes: https://pagure.io/fedora-rust/rust2rpm/issue/98
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>