Update to 1.5.0

- Drop rust-cradle dependency
- Exclude unwanted files

Incorrect shebang in %{crate_instdir}/justfile was causing a broken
dependency on the devel subpackage. Excluding the file fixed that.
This commit is contained in:
Aleksei Bavshin 2022-09-29 21:55:53 -07:00
parent 3a2b1841af
commit 9578078ca5
No known key found for this signature in database
GPG Key ID: 4F071603387A382A
5 changed files with 144 additions and 25 deletions

4
.gitignore vendored
View File

@ -1 +1,3 @@
/just-0.9.8.crate
/*.src.rpm
/results_*/
/just-1.5.0.crate

View File

@ -0,0 +1,69 @@
diff --git a/tests/choose.rs b/tests/choose.rs
index 6444f2a..a81e124 100644
--- a/tests/choose.rs
+++ b/tests/choose.rs
@@ -140,7 +140,13 @@ fn status_error() {
"exit-2": "#!/usr/bin/env bash\nexit 2\n",
};
- ("chmod", "+x", tmp.path().join("exit-2")).run();
+ let output = Command::new("chmod")
+ .arg("+x")
+ .arg(tmp.path().join("exit-2"))
+ .output()
+ .unwrap();
+
+ assert!(output.status.success());
let path = env::join_paths(
iter::once(tmp.path().to_owned()).chain(env::split_paths(&env::var_os("PATH").unwrap())),
diff --git a/tests/edit.rs b/tests/edit.rs
index c7d72c7..40c82c2 100644
--- a/tests/edit.rs
+++ b/tests/edit.rs
@@ -64,7 +64,13 @@ fn status_error() {
"exit-2": "#!/usr/bin/env bash\nexit 2\n",
};
- ("chmod", "+x", tmp.path().join("exit-2")).run();
+ let output = Command::new("chmod")
+ .arg("+x")
+ .arg(tmp.path().join("exit-2"))
+ .output()
+ .unwrap();
+
+ assert!(output.status.success());
let path = env::join_paths(
iter::once(tmp.path().to_owned()).chain(env::split_paths(&env::var_os("PATH").unwrap())),
diff --git a/tests/fmt.rs b/tests/fmt.rs
index e4c4687..ccf7f5d 100644
--- a/tests/fmt.rs
+++ b/tests/fmt.rs
@@ -107,7 +107,13 @@ fn write_error() {
let justfile_path = test.justfile_path();
- ("chmod", "400", &justfile_path).run();
+ let output = Command::new("chmod")
+ .arg("400")
+ .arg(&justfile_path)
+ .output()
+ .unwrap();
+
+ assert!(output.status.success());
let _tempdir = test.run();
diff --git a/tests/lib.rs b/tests/lib.rs
index 9867e3d..2f47d90 100644
--- a/tests/lib.rs
+++ b/tests/lib.rs
@@ -2,7 +2,6 @@ pub(crate) use {
crate::{
assert_stdout::assert_stdout, assert_success::assert_success, tempdir::tempdir, test::Test,
},
- cradle::input::Input,
executable_path::executable_path,
just::unindent,
libc::{EXIT_FAILURE, EXIT_SUCCESS},

28
just-fix-metadata.diff Normal file
View File

@ -0,0 +1,28 @@
--- just-1.5.0/Cargo.toml 1970-01-01T00:00:01+00:00
+++ just-1.5.0/Cargo.toml 2022-09-30T00:37:34.996094+00:00
@@ -15,9 +15,15 @@
version = "1.5.0"
authors = ["Casey Rodarmor <casey@rodarmor.com>"]
exclude = [
+ "/Vagrantfile",
+ "/bin",
"/book",
+ "/completions",
+ "/extras",
"/icon.png",
+ "/justfile",
"/screenshot.png",
+ "/snapcraft.yaml",
"/www",
]
autotests = false
@@ -133,9 +139,6 @@
version = "1.0.0"
features = ["v4"]
-[dev-dependencies.cradle]
-version = "0.2.0"
-
[dev-dependencies.executable-path]
version = "1.0.0"

View File

@ -1,31 +1,32 @@
# Generated by rust2rpm 17
# Generated by rust2rpm 22
%bcond_without check
%global crate just
Name: rust-%{crate}
Version: 0.9.8
Name: rust-just
Version: 1.5.0
Release: %autorelease
Summary: A command runner
Summary: Just a command runner
# Upstream license specification: CC0-1.0
License: CC0
License: CC0-1.0
URL: https://crates.io/crates/just
Source: %{crates_source}
# Initial patched metadata
# - Exclude unwanted files
# - Drop cradle dependency, the crate cannot be packaged due to CC0 license
Patch0: just-fix-metadata.diff
# Remove all uses of cradle
Patch1: just-1.5.0-no-cradle.patch
ExclusiveArch: %{rust_arches}
%if %{__cargo_skip_build}
BuildArch: noarch
%endif
BuildRequires: rust-packaging
BuildRequires: rust-packaging >= 21
%global _description %{expand:
just is a handy way to save and run project-specific commands.}
%description %{_description}
%if ! %{__cargo_skip_build}
%package -n %{crate}
Summary: %{summary}
@ -33,14 +34,17 @@ Summary: %{summary}
%files -n %{crate}
%license LICENSE
%doc README.adoc examples
%doc GRAMMAR.md CHANGELOG.md CONTRIBUTING.md
%doc CHANGELOG.md
%doc CONTRIBUTING.md
%doc GRAMMAR.md
%doc README.md
%doc README.中文.md
%doc crates-io-readme.md
%{_bindir}/just
%{_mandir}/man1/just.1*
%{_datadir}/bash-completion
%{_datadir}/fish/
%{_datadir}/zsh/site-functions
%endif
%package devel
Summary: %{summary}
@ -48,14 +52,18 @@ BuildArch: noarch
%description devel %{_description}
This package contains library source intended for building other packages
which use "%{crate}" crate.
This package contains library source intended for building other packages which
use the "%{crate}" crate.
%files devel
%license LICENSE
%doc crates-io-readme.md
%doc GRAMMAR.md CHANGELOG.md CONTRIBUTING.md
%{cargo_registry}/%{crate}-%{version_no_tilde}/
%license %{crate_instdir}/LICENSE
%doc %{crate_instdir}/CHANGELOG.md
%doc %{crate_instdir}/CONTRIBUTING.md
%doc %{crate_instdir}/GRAMMAR.md
%doc %{crate_instdir}/README.md
%doc %{crate_instdir}/README.中文.md
%doc %{crate_instdir}/crates-io-readme.md
%{crate_instdir}/
%package -n %{name}+default-devel
Summary: %{summary}
@ -63,11 +71,23 @@ BuildArch: noarch
%description -n %{name}+default-devel %{_description}
This package contains library source intended for building other packages
which use "default" feature of "%{crate}" crate.
This package contains library source intended for building other packages which
use the "default" feature of the "%{crate}" crate.
%files -n %{name}+default-devel
%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml
%ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+help4help2man-devel
Summary: %{summary}
BuildArch: noarch
%description -n %{name}+help4help2man-devel %{_description}
This package contains library source intended for building other packages which
use the "help4help2man" feature of the "%{crate}" crate.
%files -n %{name}+help4help2man-devel
%ghost %{crate_instdir}/Cargo.toml
%prep
%autosetup -n %{crate}-%{version_no_tilde} -p1

View File

@ -1 +1 @@
SHA512 (just-0.9.8.crate) = 46cb9da586f9b226d3632cb102dd3033778630b0501b65e27a8286dc0d8cd8862b4f2be0e2c43a1722c89a889519c885cd9057d3d73758cf7e68a977d9bb4505
SHA512 (just-1.5.0.crate) = 500b75bf4d7f2958ff98173de40f8930b98291da09fef1e142606b41b65f73190cb7873e58181f2e0efee20b61fafd55c48a4df88d82e180100186109a18e8c2