From b08937c827b56092d972935777fbd67e689bb043 Mon Sep 17 00:00:00 2001 From: LeChatP Date: Fri, 13 Sep 2024 00:36:07 +0200 Subject: [PATCH] chore: Install cargo-deb and cargo-generate-rpm as packaging dependencies --- xtask/src/deploy/debian.rs | 7 ++++++- xtask/src/deploy/redhat.rs | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/xtask/src/deploy/debian.rs b/xtask/src/deploy/debian.rs index 3bd377c..7d4e8a2 100644 --- a/xtask/src/deploy/debian.rs +++ b/xtask/src/deploy/debian.rs @@ -10,7 +10,12 @@ use crate::{ use super::setup_maint_scripts; fn dependencies(os: &OsTarget, priv_bin: Option) -> Result { - install_dependencies(os, &["upx"], priv_bin).context("failed to install packaging dependencies") + install_dependencies(os, &["upx"], priv_bin).context("failed to install packaging dependencies")?; + Command::new("cargo") + .arg("install") + .arg("cargo-deb") + .status() + .context("failed to install cargo-deb") } pub fn make_deb( diff --git a/xtask/src/deploy/redhat.rs b/xtask/src/deploy/redhat.rs index 69fad59..726a70c 100644 --- a/xtask/src/deploy/redhat.rs +++ b/xtask/src/deploy/redhat.rs @@ -5,11 +5,20 @@ use crate::{ util::{detect_priv_bin, get_os, OsTarget}, }; +fn install_dependencies() -> Result<(), anyhow::Error> { + Command::new("cargo") + .arg("install") + .arg("cargo-generate-rpm") + .status()?; + Ok(()) +} + pub fn make_rpm( os: Option, profile: Profile, exe: &Option, ) -> Result<(), anyhow::Error> { + install_dependencies()?; let os = get_os(os)?; let exe: Option = exe.clone().or(detect_priv_bin());