View | Details | Raw Unified | Return to bug 244861
Collapse All | Expand All

(-)sysutils/rsfetch/Makefile (+1 lines)
Lines 2-7 Link Here
2
2
3
PORTNAME=	rsfetch
3
PORTNAME=	rsfetch
4
DISTVERSION=	2.0.0
4
DISTVERSION=	2.0.0
5
PORTREVISION=	1
5
CATEGORIES=	sysutils
6
CATEGORIES=	sysutils
6
7
7
MAINTAINER=	vulcan@wired.sh
8
MAINTAINER=	vulcan@wired.sh
(-)sysutils/rsfetch/files/patch-src_memory.rs (+20 lines)
Line 0 Link Here
1
--- src/memory.rs.orig	2020-03-16 13:12:22 UTC
2
+++ src/memory.rs
3
@@ -74,12 +74,15 @@ impl RAMInfo {
4
             self.used  = Some(used  / 1024_f64 / 1024_f64);
5
             self.total = Some(total / 1024_f64 / 1024_f64);
6
             return Ok(());
7
-        } else if os == &OS::FreeBSD || os == &OS::Other {
8
+        } else if os == &OS::FreeBSD || os == &OS::DragonflyBSD {
9
             let mut buffer = String::new();
10
             Command::new("sysctl").arg("-n").arg("hw.physmem")
11
                 .output().context(RAMErr)?.stdout.iter()
12
                 .for_each(|b| buffer.push(*b as char));
13
-            total = buffer.parse::<f64>().unwrap();
14
+
15
+            // remove non-integer chars from buffer
16
+            buffer = buffer.trim().replace("\n", "");
17
+            total = buffer.parse::<u64>().unwrap() as f64;
18
 
19
             let pagesize: f64;
20
             let inactive: f64;
(-)sysutils/rsfetch/files/patch-src_util.rs (+28 lines)
Line 0 Link Here
1
--- src/util.rs.orig	2020-03-16 13:14:06 UTC
2
+++ src/util.rs
3
@@ -8,6 +8,7 @@ pub enum OS {
4
     FreeBSD,
5
     OpenBSD,
6
     NetBSD,
7
+    DragonflyBSD,
8
     Other
9
 }
10
 
11
@@ -23,11 +24,12 @@ impl OSInfo { 
12
             .output()?.stdout.iter()
13
             .for_each(|b| uname.push(*b as char));
14
         let os = match uname.replace("\n", "").trim().as_ref() {
15
-            "Linux"   => OS::Linux,
16
-            "FreeBSD" => OS::FreeBSD,
17
-            "NetBSD"  => OS::NetBSD,
18
-            "OpenBSD" => OS::OpenBSD,
19
-            &_        => OS::Other,
20
+            "Linux"     => OS::Linux,
21
+            "FreeBSD"   => OS::FreeBSD,
22
+            "NetBSD"    => OS::NetBSD,
23
+            "OpenBSD"   => OS::OpenBSD,
24
+            "DragonFly" => OS::DragonflyBSD,
25
+            &_          => OS::Other,
26
         };
27
 
28
         Ok(os)

Return to bug 244861