[build-path-prefix-map-spec] 25/50: rs: Output the error message before exiting 1

Ximin Luo infinity0 at debian.org
Fri Mar 10 15:17:20 UTC 2017


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository build-path-prefix-map-spec.

commit 908ad8536f6608ec225078b553a13f1b2af065d2
Author: Ximin Luo <infinity0 at debian.org>
Date:   Tue Jan 31 21:11:45 2017 +0100

    rs: Output the error message before exiting 1
---
 consume/pecsplit.rs | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/consume/pecsplit.rs b/consume/pecsplit.rs
index b1ada34..0c57390 100644
--- a/consume/pecsplit.rs
+++ b/consume/pecsplit.rs
@@ -70,12 +70,14 @@ fn map_prefix(path: PathBuf, pm: &Vec<(PathBuf, PathBuf)>) -> PathBuf {
 
 fn main() {
   use std::env;
-  use std::io::{Write, stdout};
+  use std::io::{Write, stdout, stderr};
 
   let pm = decode(env::var_os("BUILD_PATH_PREFIX_MAP"))
-    .unwrap_or_else(|_| std::process::exit(1));
+    .unwrap_or_else(|msg| {
+      writeln!(stderr(), "{}", msg).unwrap();
+      std::process::exit(1)
+    });
 
-  //use std::io::Write;
   //writeln!(&mut std::io::stderr(), "pm = {:?}", pm).unwrap();
   for arg in env::args_os().skip(1) {
     let path = map_prefix(PathBuf::from(arg), &pm);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/build-path-prefix-map-spec.git



More information about the Reproducible-commits mailing list