Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7cb24c7e authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Add better error message to build from bluetooth_packetgen"

parents fc33612f c25f4ca1
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
//  limitations under the License.

use std::env;
use std::path::PathBuf;
use std::path::{Path, PathBuf};
use std::process::Command;

fn main() {
@@ -34,8 +34,14 @@ fn generate_packets() {
    let outputted = [out_dir.join("../../hci/hci_packets.rs")];

    // Find the packetgen tool. Expecting it at CARGO_HOME/bin
    let packetgen =
        PathBuf::from(env::var("CARGO_HOME").unwrap()).join("bin").join("bluetooth_packetgen");
    let packetgen = match env::var("CARGO_HOME") {
        Ok(dir) => PathBuf::from(dir).join("bin").join("bluetooth_packetgen"),
        Err(_) => PathBuf::from("bluetooth_packetgen"),
    };

    if !Path::new(packetgen.as_os_str()).exists() {
        panic!("Unable to locate bluetooth packet generator:{:?}", packetgen.as_os_str().to_str().unwrap());
    }

    for i in 0..input_files.len() {
        let output = Command::new(packetgen.as_os_str().to_str().unwrap())