]> git.proxmox.com Git - debcargo-conf.git/commitdiff
update pinger to 0.7.2
authorMatthias Geiger <matthias.geiger1024@tutanota.de>
Thu, 22 Dec 2022 17:16:57 +0000 (18:16 +0100)
committerMatthias Geiger <matthias.geiger1024@tutanota.de>
Thu, 22 Dec 2022 17:16:57 +0000 (18:16 +0100)
src/pinger/debian/changelog
src/pinger/debian/patches/fix-test-on-i386.diff [deleted file]
src/pinger/debian/patches/series

index df7550eeff20eb009026269b8f5ee9508592a46b..be594f3cc66a723a8426d2b92181af5aaa10e9c1 100644 (file)
@@ -1,3 +1,10 @@
+rust-pinger (0.7.2-1) UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO; urgency=medium
+
+  * Package pinger 0.7.2 from crates.io using debcargo 2.6.0
+  * Drop obsolete patch
+
+ -- Matthias Geiger <matthias.geiger1024@tutanota.de>  Thu, 22 Dec 2022 18:09:55 +0100
+
 rust-pinger (0.7.1-2) unstable; urgency=medium
 
   * Package pinger 0.7.1 from crates.io using debcargo 2.6.0
diff --git a/src/pinger/debian/patches/fix-test-on-i386.diff b/src/pinger/debian/patches/fix-test-on-i386.diff
deleted file mode 100644 (file)
index b311021..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-Description: Fix autopkgtest on i386
- This patch fixes the autopkgtest for pinger on the i386 arch
-Author: Tom Forbes  <tom@tomforb.es>
-Origin: upstream
-Applied-Upstream: e44eb9d4a50e54e89a17efc1f2e1e171392651e1
-Reviewed-by: Matthias Geiger <matthias.geiger1024@tutanota.de>
-Last-Update: 2022-12-18
----
-This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
-diff --git a/src/bsd.rs b/src/bsd.rs
-index 1113206..34d63ee 100644
---- a/src/bsd.rs
-+++ b/src/bsd.rs
-@@ -3,7 +3,7 @@ use regex::Regex;
- use std::time::Duration;
- lazy_static! {
--    static ref RE: Regex = Regex::new(r"time=(?:(?P<time>[0-9\.]+)\s+ms)").unwrap();
-+    static ref RE: Regex = Regex::new(r"time=(?:(?P<ms>[0-9]+).(?P<ns>[0-9]+)\s+ms)").unwrap();
- }
- #[derive(Default)]
-diff --git a/src/lib.rs b/src/lib.rs
-index 35b76d1..469468b 100644
---- a/src/lib.rs
-+++ b/src/lib.rs
-@@ -12,7 +12,7 @@ use crate::linux::{detect_linux_ping, LinuxPingType};
- ///         PingResult::Pong(duration, line) => println!("{:?} (line: {})", duration, line),
- ///         PingResult::Timeout(_) => println!("Timeout!"),
- ///         PingResult::Unknown(line) => println!("Unknown line: {}", line),
--///         PingResult::PingExited(_code, _stderr) => {},
-+///         PingResult::PingExited(_code, _stderr) => {}
- ///     }
- /// }
- /// ```
-@@ -109,13 +109,22 @@ pub trait Parser: Default {
-     fn extract_regex(&self, regex: &Regex, line: String) -> Option<PingResult> {
-         let cap = regex.captures(&line)?;
--        let time = cap
--            .name("time")
--            .expect("No capture group named 'time'")
-+        let ms = cap
-+            .name("ms")
-+            .expect("No capture group named 'ms'")
-             .as_str()
--            .parse::<f32>()
--            .expect("time cannot be parsed as f32");
--        let duration = Duration::from_micros((time * 1000f32) as u64);
-+            .parse::<u64>()
-+            .ok()?;
-+        let ns = match cap.name("ns") {
-+            None => 0,
-+            Some(cap) => {
-+                let matched_str = cap.as_str();
-+                let number_of_digits = matched_str.len() as u32;
-+                let fractional_ms = matched_str.parse::<u64>().ok()?;
-+                fractional_ms * (10u64.pow(6 - number_of_digits))
-+            }
-+        };
-+        let duration = Duration::from_millis(ms) + Duration::from_nanos(ns);
-         Some(PingResult::Pong(duration, line))
-     }
- }
-diff --git a/src/linux.rs b/src/linux.rs
-index 433c589..5b42769 100644
---- a/src/linux.rs
-+++ b/src/linux.rs
-@@ -86,7 +86,8 @@ impl Pinger for AlpinePinger {
- }
- lazy_static! {
--    static ref UBUNTU_RE: Regex = Regex::new(r"(?i-u)time=(?P<time>\d+(?:\.\d+)?) *ms").unwrap();
-+    static ref UBUNTU_RE: Regex =
-+        Regex::new(r"(?i-u)time=(?P<ms>\d+)(?:\.(?P<ns>\d+))? *ms").unwrap();
- }
- #[derive(Default)]
-diff --git a/src/macos.rs b/src/macos.rs
-index d33451f..ec48fa4 100644
---- a/src/macos.rs
-+++ b/src/macos.rs
-@@ -3,7 +3,7 @@ use regex::Regex;
- use std::time::Duration;
- lazy_static! {
--    static ref RE: Regex = Regex::new(r"time=(?:(?P<time>[0-9\.]+)\s+ms)").unwrap();
-+    static ref RE: Regex = Regex::new(r"time=(?:(?P<ms>[0-9]+).(?P<ns>[0-9]+)\s+ms)").unwrap();
- }
- #[derive(Default)]
-diff --git a/src/windows.rs b/src/windows.rs
-index c6dbcc0..883009a 100644
---- a/src/windows.rs
-+++ b/src/windows.rs
-@@ -9,7 +9,7 @@ use std::time::Duration;
- use winping::{Buffer, Pinger as WinPinger};
- lazy_static! {
--    static ref RE: Regex = Regex::new(r"(?ix-u)time=(?P<time>\d+(?:\.\d+)?)ms").unwrap();
-+    static ref RE: Regex = Regex::new(r"(?ix-u)time=(?P<ms>\d+)(?:\.(?P<ns>\d+))?").unwrap();
- }
- #[derive(Default)]
index 84eff62c864c178e4d9dcae9374914ddcda2f2f4..062438d179d7eed351b1f9012121eade1d07cb16 100644 (file)
@@ -1,2 +1 @@
 remove-win-deps.diff
-fix-test-on-i386.diff