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

Commit b6175820 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Add better error message to build from bluetooth_packetgen" am: 7cb24c7e am: 53aab24b

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1915511

Change-Id: Ie2319cea26c2345fbc9644e62c61a3f242cc06f9
parents b9fca0f5 53aab24b
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())