diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2021-04-06 10:24:10 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2021-04-06 10:24:10 +0200 |
commit | 9251445a5ac5315dca3921b7e77ce4a37cd42497 (patch) | |
tree | 7dd591fd2074aadf04d77f8a3a9eed2dcf40c41a | |
parent | 4c26f98c6de843d9c35ba8a5ec1a3ba3d066b99d (diff) | |
parent | 45b0ed8f61241a558a0f55bc253cd82291645254 (diff) |
Merge branch 'builds'
-rw-r--r-- | .builds/debian.yml | 24 | ||||
-rw-r--r-- | .builds/msrv.yml | 17 | ||||
-rw-r--r-- | .travis.yml | 20 | ||||
-rw-r--r-- | Cargo.toml | 1 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | librepology/README.md | 2 | ||||
-rw-r--r-- | librepology/src/v1/stdinapi.rs | 2 | ||||
-rw-r--r-- | src/frontend/mod.rs | 2 | ||||
-rw-r--r-- | src/frontend/table.rs | 8 | ||||
-rw-r--r-- | src/main.rs | 12 |
10 files changed, 57 insertions, 33 deletions
diff --git a/.builds/debian.yml b/.builds/debian.yml new file mode 100644 index 0000000..11c6d58 --- /dev/null +++ b/.builds/debian.yml @@ -0,0 +1,24 @@ +image: debian/buster +sources: + - https://git.sr.ht/~matthiasbeyer/repolocli +packages: + - libssl-dev + - openssl + - pkg-config +tasks: + - install: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.50.0 + - build: | + cd repolocli + PATH="$HOME/.cargo/bin:$PATH" cargo build --all --all-features + - test: | + cd repolocli + PATH="$HOME/.cargo/bin:$PATH" cargo test --all --all-features + - clippy: | + cd repolocli + PATH="$HOME/.cargo/bin:$PATH" rustup component add clippy + PATH="$HOME/.cargo/bin:$PATH" cargo clippy --all --all-targets --all-features -- -D warnings +triggers: + - action: email + condition: always + to: mail@beyermatthias.de + diff --git a/.builds/msrv.yml b/.builds/msrv.yml new file mode 100644 index 0000000..1094081 --- /dev/null +++ b/.builds/msrv.yml @@ -0,0 +1,17 @@ +image: debian/buster +sources: + - https://git.sr.ht/~matthiasbeyer/repolocli +packages: + - libssl-dev + - openssl + - pkg-config +tasks: + - install: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.42.0 + - build: | + cd repolocli + PATH="$HOME/.cargo/bin:$PATH" cargo check --all --all-features --tests +triggers: + - action: email + condition: always + to: mail@beyermatthias.de + diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index da8fd14..0000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -language: rust -sudo: false - -rust: - - 1.32.0 - - 1.33.0 - - stable - - beta - - nightly - -matrix: - allow_failures: - - rust: nightly - -cache: cargo - -script: - - cargo build --all-features --verbose -j 1 - - cargo test --all-features --verbose -j 1 - @@ -11,7 +11,6 @@ readme = "./README.md" keywords = ["cli", "repology"] categories = ["command-line-interface", "command-line-utilities"] license = "GPL-2.0-only" -license-file = "./LICENSE" [badges] maintenance = { status = "actively-developed" } @@ -5,6 +5,8 @@ This repository is a WIP project to bring repology to the commandline. There's a library under `./librepology/` and a commandline interface for viewing repology data. +MSRV: 1.42.0 + ## License Library: MPL 2.0 diff --git a/librepology/README.md b/librepology/README.md index a65a668..c515f2d 100644 --- a/librepology/README.md +++ b/librepology/README.md @@ -2,6 +2,8 @@ Library for accessing the public API of repology.org. +MSRV: 1.42.0 + ## License The code in this directory (and all subdirectories) is _not_ licensed as diff --git a/librepology/src/v1/stdinapi.rs b/librepology/src/v1/stdinapi.rs index 8ee26a4..61bc093 100644 --- a/librepology/src/v1/stdinapi.rs +++ b/librepology/src/v1/stdinapi.rs @@ -55,7 +55,7 @@ impl Api for StdinWrapper { } -fn read_to_string(input: &mut Read) -> Result<String> { +fn read_to_string(input: &mut dyn Read) -> Result<String> { let mut buffer = String::new(); let read = input.read_to_string(&mut buffer)?; trace!("Read {} bytes from stdin", read); diff --git a/src/frontend/mod.rs b/src/frontend/mod.rs index 3bb912c..bcce43a 100644 --- a/src/frontend/mod.rs +++ b/src/frontend/mod.rs @@ -22,7 +22,7 @@ pub mod json; pub mod table; /// Helper function for building a new Frontend object based on the commandline parameters -pub fn new_frontend(app: &ArgMatches, _config: &Configuration) -> Result<Box<Frontend>> { +pub fn new_frontend(app: &ArgMatches, _config: &Configuration) -> Result<Box<dyn Frontend>> { match app.value_of("output") { None | Some("lines") => { debug!("No output specified, using default"); diff --git a/src/frontend/table.rs b/src/frontend/table.rs index 35c867c..2bef1b8 100644 --- a/src/frontend/table.rs +++ b/src/frontend/table.rs @@ -93,10 +93,10 @@ impl Frontend for TableFrontend { .filter(|p| filter_repos.contains(p.repo())) .for_each(|upstream_package| { table.add_row(row![ - package.name().deref().clone(), - package.version().deref().clone(), - upstream_package.repo().deref().clone(), - upstream_package.version().deref().clone(), + package.name().clone(), + package.version().clone(), + upstream_package.repo().clone(), + upstream_package.version().clone(), ]); }); } diff --git a/src/main.rs b/src/main.rs index a45ebb7..eea89f4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -92,7 +92,7 @@ fn deserialize_package_list(s: String, filepath: &str) -> Result<Vec<ComparePack Ok(v) }, - other => Err(format_err!("Unknown file extension: {}", other))?, + other => Err(format_err!("Unknown file extension: {}", other)), } } @@ -128,20 +128,20 @@ fn app() -> Result<()> { let blacklist_filter = |repo: &Repo| -> bool { if config.blacklist().contains(repo) { trace!("In Blacklist: {:?} -> false", repo); - return false; + false } else { trace!("Not in Blacklist: {:?} -> true", repo); - return true; + true } }; let whitelist_filter = |repo: &Repo| -> bool { if config.whitelist().contains(repo) { trace!("In Whitelist: {:?} -> true", repo); - return true; + true } else { trace!("Not in Whitelist: {:?} -> false", repo); - return false; + false } }; @@ -220,7 +220,7 @@ fn app() -> Result<()> { (other, _mtch) => { app.is_present("input_stdin") - .as_result((), Error::from(format_err!("Input not from stdin"))) + .as_result((), format_err!("Input not from stdin")) .and_then(|_| { // Ugly, but works: // If we have "--stdin" on CLI, we have a CLI/Stdin backend, which means that we can query |