On 20/07/2024 12:07, Jonas Smedegaard wrote:
I have tried but failed to patch git-delta to support sysinfo v0.30 and would appreciate help looking at that.
The attached patch makes the package build and makes "cargo test" pass.
diff -Nru git-delta-0.17.0/debian/changelog git-delta-0.17.0/debian/changelog --- git-delta-0.17.0/debian/changelog 2024-07-13 07:52:16.000000000 +0000 +++ git-delta-0.17.0/debian/changelog 2024-07-20 13:03:30.000000000 +0000 @@ -1,3 +1,10 @@ +git-delta (0.17.0-3.1) UNRELEASED; urgency=medium + + * Non-maintainer upload. + * Add patch for sysinfo 0.30 + + -- Peter Michael Green <plugw...@debian.org> Sat, 20 Jul 2024 13:03:30 +0000 + git-delta (0.17.0-3) unstable; urgency=medium * drop patch 2002_sysinfo, diff -Nru git-delta-0.17.0/debian/patches/1002_sysinfo.patch git-delta-0.17.0/debian/patches/1002_sysinfo.patch --- git-delta-0.17.0/debian/patches/1002_sysinfo.patch 1970-01-01 00:00:00.000000000 +0000 +++ git-delta-0.17.0/debian/patches/1002_sysinfo.patch 2024-07-20 13:03:30.000000000 +0000 @@ -0,0 +1,77 @@ +Description: Update to sysinfo 0.30 + This patch updates to sysinfo 0.30, it contains changes to accomodate + changes in sysinfo. The sysinfo crate provides a migration guide at + https://github.com/GuillaumeGomez/sysinfo/blob/master/migration_guide.md + which was used to guide these changes. + + Firstly the "Ext" traits are gone and the functions are now implemented + directly on the "System" and "Process" types. + + Secondly refresh_processes_specifics now retrives less information by + default, this was causing test_process_calling_cmdline to fail. + Explicitly requesting the "cmd" category of information fixed it. + +Author: Peter Michael Green <plugw...@debian.org> + +Index: git-delta-0.17.0/Cargo.toml +=================================================================== +--- git-delta-0.17.0.orig/Cargo.toml ++++ git-delta-0.17.0/Cargo.toml +@@ -61,7 +61,7 @@ default-features = false + features = [] + + [dependencies.sysinfo] +-version = "0.29.0" ++version = "0.30.0" + # no default features to disable the use of threads + default-features = false + features = [] +Index: git-delta-0.17.0/src/utils/process.rs +=================================================================== +--- git-delta-0.17.0.orig/src/utils/process.rs ++++ git-delta-0.17.0/src/utils/process.rs +@@ -3,7 +3,7 @@ use std::path::Path; + use std::sync::{Arc, Condvar, Mutex, MutexGuard}; + + use lazy_static::lazy_static; +-use sysinfo::{Pid, PidExt, Process, ProcessExt, ProcessRefreshKind, SystemExt}; ++use sysinfo::{Pid, Process, ProcessRefreshKind, UpdateKind}; + + pub type DeltaPid = u32; + +@@ -302,21 +302,19 @@ trait ProcActions { + fn start_time(&self) -> u64; + } + +-impl<T> ProcActions for T +-where +- T: ProcessExt, ++impl ProcActions for Process + { + fn cmd(&self) -> &[String] { +- ProcessExt::cmd(self) ++ Process::cmd(self) + } + fn parent(&self) -> Option<DeltaPid> { +- ProcessExt::parent(self).map(|p| p.as_u32()) ++ Process::parent(self).map(|p| p.as_u32()) + } + fn pid(&self) -> DeltaPid { +- ProcessExt::pid(self).as_u32() ++ Process::pid(self).as_u32() + } + fn start_time(&self) -> u64 { +- ProcessExt::start_time(self) ++ Process::start_time(self) + } + } + +@@ -433,7 +431,7 @@ impl ProcessInterface for ProcInfo { + } + fn refresh_processes(&mut self) { + self.info +- .refresh_processes_specifics(ProcessRefreshKind::new()) ++ .refresh_processes_specifics(ProcessRefreshKind::new().with_cmd(UpdateKind::Always)) + } + } + diff -Nru git-delta-0.17.0/debian/patches/series git-delta-0.17.0/debian/patches/series --- git-delta-0.17.0/debian/patches/series 2024-07-09 04:46:30.000000000 +0000 +++ git-delta-0.17.0/debian/patches/series 2024-07-20 13:03:30.000000000 +0000 @@ -1,6 +1,7 @@ 1001_git2.patch 1001_itertools.patch 1001_smol_str.patch +1002_sysinfo.patch 2001_theme.patch 2002_anstyle-parse.patch 2002_bytelines.patch