From b186470029f281460e8040dc9c0240315e43916f Mon Sep 17 00:00:00 2001 From: Roman Stingler Date: Wed, 25 Dec 2024 01:39:48 +0100 Subject: [PATCH] replace unmaintained ansi_term with anssiterm due to https://osv.dev/vulnerability/RUSTSEC-2021-0139 closes #1294 --- Cargo.lock | 9 ++++----- Cargo.toml | 3 +-- src/config.rs | 6 +++--- src/devel.rs | 2 +- src/download.rs | 2 +- src/fmt.rs | 4 ++-- src/info.rs | 2 +- src/install.rs | 2 +- src/lib.rs | 2 +- src/news.rs | 2 +- src/repo.rs | 2 +- src/search.rs | 2 +- 12 files changed, 18 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 103fe960..5c578511 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -72,10 +72,10 @@ dependencies = [ ] [[package]] -name = "ansi_term" -version = "0.12.1" +name = "ansiterm" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +checksum = "4ab587f5395da16dd2e6939adf53dede583221b320cadfb94e02b5b7b9bf24cc" dependencies = [ "winapi", ] @@ -1479,7 +1479,7 @@ version = "2.0.4" dependencies = [ "alpm", "alpm-utils", - "ansi_term", + "ansiterm", "anyhow", "async-trait", "aur-depends", @@ -1495,7 +1495,6 @@ dependencies = [ "indicatif", "log", "nix", - "once_cell", "pacmanconf", "raur", "regex-lite", diff --git a/Cargo.toml b/Cargo.toml index 85f322f5..cbf0d683 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,7 @@ raur = "7.0.0" srcinfo = "1.2.0" -ansi_term = "0.12.1" +ansiterm = "0.12.2" anyhow = { version = "1.0.93", features = ["backtrace"] } chrono = { version = "0.4.38", default-features = false, features = ["clock"] } dirs = "5.0.1" @@ -55,7 +55,6 @@ tr = "0.1.10" unicode-width = "0.2.0" regex-lite = "0.1.6" signal-hook = "0.3.17" -once_cell = "1.20.2" bitflags = "2.6.0" toml = { version = "0.8.19", features = ["preserve_order"] } diff --git a/src/config.rs b/src/config.rs index 4b622c59..52b5b874 100644 --- a/src/config.rs +++ b/src/config.rs @@ -18,8 +18,8 @@ use std::str::FromStr; use alpm::{ AnyDownloadEvent, AnyQuestion, Depend, DownloadEvent, DownloadResult, LogLevel, Question, }; -use ansi_term::Color::{Blue, Cyan, Green, Purple, Red, Yellow}; -use ansi_term::Style; +use ansiterm::Color::{Blue, Cyan, Green, Purple, Red, Yellow}; +use ansiterm::Style; use anyhow::{anyhow, bail, ensure, Context, Error, Result}; use bitflags::bitflags; @@ -136,7 +136,7 @@ impl Colors { code: Style::new().fg(Cyan), news_date: Style::new().fg(Cyan).bold(), old_version: Style::new().fg(Red), - install_version: Style::new().fg(ansi_term::Color::Fixed(243)), + install_version: Style::new().fg(ansiterm::Color::Fixed(243)), new_version: Style::new().fg(Green), number_menu: Style::new().fg(Purple), group: Style::new().fg(Blue).bold(), diff --git a/src/devel.rs b/src/devel.rs index be556aa3..0b93c34c 100644 --- a/src/devel.rs +++ b/src/devel.rs @@ -14,7 +14,7 @@ use std::iter::FromIterator; use std::time::Duration; use alpm_utils::{DbListExt, Target}; -use ansi_term::Style; +use ansiterm::Style; use anyhow::{anyhow, bail, Context, Result}; use aur_depends::Base; use futures::future::{join_all, select_ok, FutureExt}; diff --git a/src/download.rs b/src/download.rs index 682a9023..6f8d7397 100644 --- a/src/download.rs +++ b/src/download.rs @@ -11,7 +11,7 @@ use std::result::Result as StdResult; use alpm::Version; use alpm_utils::{AsTarg, DbListExt, Targ}; -use ansi_term::Style; +use ansiterm::Style; use anyhow::{bail, ensure, Context, Result}; use aur_depends::AurBase; diff --git a/src/fmt.rs b/src/fmt.rs index 8097e308..e4befe4d 100644 --- a/src/fmt.rs +++ b/src/fmt.rs @@ -8,7 +8,7 @@ use crate::repo; use alpm::Ver; use aur_depends::{Actions, Base}; -use ansi_term::Style; +use ansiterm::Style; use chrono::{Local, TimeZone, Utc}; use tr::tr; use unicode_width::UnicodeWidthStr; @@ -107,7 +107,7 @@ pub fn print_indent>( println!(); } -use ansi_term::Color; +use ansiterm::Color; pub fn color_repo(enabled: bool, name: &str) -> String { if !enabled { diff --git a/src/info.rs b/src/info.rs index 3fb7d35d..658e021c 100644 --- a/src/info.rs +++ b/src/info.rs @@ -5,7 +5,7 @@ use crate::fmt::{date, opt, print_indent}; use crate::util::split_repo_aur_info; use alpm_utils::Targ; -use ansi_term::Style; +use ansiterm::Style; use anyhow::Error; use globset::GlobSet; diff --git a/src/install.rs b/src/install.rs index 3449c260..55c9247a 100644 --- a/src/install.rs +++ b/src/install.rs @@ -27,7 +27,7 @@ use crate::{args, exec, news, print_error, printtr, repo}; use alpm::{Alpm, Depend, Version}; use alpm_utils::depends::{satisfies, satisfies_nover, satisfies_provide, satisfies_provide_nover}; use alpm_utils::{DbListExt, Targ}; -use ansi_term::Style; +use ansiterm::Style; use anyhow::{bail, ensure, Context, Result}; use aur_depends::{Actions, Base, Conflict, DepMissing, RepoPackage}; use log::debug; diff --git a/src/lib.rs b/src/lib.rs index 503cf50e..94d3a3d8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -48,7 +48,7 @@ use std::io::Write; use std::path::PathBuf; use std::process::Command; -use ansi_term::Style; +use ansiterm::Style; use anyhow::{bail, Error, Result}; use cini::Ini; use fmt::print_target; diff --git a/src/news.rs b/src/news.rs index 8895df5b..db9335c4 100644 --- a/src/news.rs +++ b/src/news.rs @@ -3,7 +3,7 @@ use crate::fmt::print_indent; use std::str::Chars; -use ansi_term::Style; +use ansiterm::Style; use anyhow::{bail, Result}; use htmlescape::decode_html; use rss::Channel; diff --git a/src/repo.rs b/src/repo.rs index 9088d017..d178f55c 100644 --- a/src/repo.rs +++ b/src/repo.rs @@ -13,7 +13,7 @@ use std::path::{Path, PathBuf}; use std::process::Command; use alpm::{AlpmListMut, Db}; -use ansi_term::Style; +use ansiterm::Style; use anyhow::{Context, Error, Result}; use nix::unistd::{Gid, Uid, User}; use tr::tr; diff --git a/src/search.rs b/src/search.rs index 57abbdb2..8d6929fd 100644 --- a/src/search.rs +++ b/src/search.rs @@ -6,7 +6,7 @@ use crate::fmt::{color_repo, print_indent}; use crate::util::{input, NumberMenu}; use crate::{info, printtr}; -use ansi_term::Style; +use ansiterm::Style; use anyhow::{ensure, Context, Result}; use indicatif::HumanBytes; use raur::{Raur, SearchBy};