summaryrefslogtreecommitdiff
path: root/x11-misc/i3status-rust/files/i3status-rust-0.35.0-gitless.patch
blob: edf552aa6ed4336965edfd15aea61941089a589c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Statically provide the release commit hash and date by replacing the
placeholder values within the ebuild.

Author: Lucio Sauer <watermanpaint@posteo.net>
--- a/build.rs
+++ b/build.rs
@@ -1,16 +1,8 @@
 use std::process::Command;
 
 fn main() {
-    let hash = Command::new("git")
-        .args(["rev-parse", "--short", "HEAD"])
-        .env("GIT_CONFIG_GLOBAL", "/dev/null")
-        .output()
-        .map(|o| String::from_utf8(o.stdout).unwrap());
-    let date = Command::new("git")
-        .args(["log", "--pretty=format:'%ad'", "-n1", "--date=short"])
-        .env("GIT_CONFIG_GLOBAL", "/dev/null")
-        .output()
-        .map(|o| String::from_utf8(o.stdout).unwrap());
+    let hash: Result<&str, &str> = Ok("%COMMIT%");
+    let date: Result<&str, &str> = Ok("%DATE%");
     if let Ok(hash) = hash
         && let Ok(date) = date
     {