Clone only one specific commit on libafl_qemu build.rs

This commit is contained in:
Andrea Fioraldi 2022-01-07 11:53:34 +01:00
parent 6274ad4594
commit 181160d80b

View File

@ -100,7 +100,36 @@ fn main() {
"cargo:warning=Qemu not found, cloning with git ({})...",
QEMU_REVISION
);
fs::create_dir_all(&qemu_path).unwrap();
Command::new("git")
.current_dir(&qemu_path)
.arg("init")
.status()
.unwrap();
Command::new("git")
.current_dir(&qemu_path)
.arg("remote")
.arg("add")
.arg("origin")
.arg(QEMU_URL)
.status()
.unwrap();
Command::new("git")
.current_dir(&qemu_path)
.arg("fetch")
.arg("--depth")
.arg("1")
.arg("origin")
.arg(QEMU_REVISION)
.status()
.unwrap();
Command::new("git")
.current_dir(&qemu_path)
.arg("checkout")
.arg("FETCH_HEAD")
.status()
.unwrap();
/*Command::new("git")
.current_dir(&out_dir_path)
.arg("clone")
.arg(QEMU_URL)
@ -111,7 +140,7 @@ fn main() {
.arg("checkout")
.arg(QEMU_REVISION)
.status()
.unwrap();
.unwrap();*/
fs::write(&qemu_rev, QEMU_REVISION).unwrap();
}