SHA256
Compare commits
| Author | SHA256 | Date | |
|---|---|---|---|
|
|
e13806ce05 | ||
|
|
37c4d64bee |
No files matched your search
Generated
+1
-1
@@ -152,7 +152,7 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
||||
|
||||
[[package]]
|
||||
name = "hive-up"
|
||||
version = "0.2.3"
|
||||
version = "0.2.5"
|
||||
dependencies = [
|
||||
"clap",
|
||||
"nix",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "hive-up"
|
||||
version = "0.2.3"
|
||||
version = "0.2.5"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
|
||||
+11
-1
@@ -38,6 +38,7 @@ const BOOT_UKI_IMAGE_NAME: &str = "\\EFI\\boot\\linux-kira-lts.efi";
|
||||
const BOOT_UKI_IMAGE_NAME_BACK: &str = "\\EFI\\boot\\linux-kira-lts-back.efi";
|
||||
|
||||
const PAC_LOCK_FILE: &str = "/var/lib/hive-up/pac-lock";
|
||||
const PAC_LOCK_DIR: &str = "/var/lib/hive-up";
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct CommandFailed {
|
||||
@@ -299,6 +300,15 @@ pub fn clean_snaps(snaps_conf: &SnapshotsConfig) -> Result<(), ExecCommandError>
|
||||
pub fn pac_start(hive_config: &HiveConfig) -> Result<(), ExecCommandError> {
|
||||
use std::path::Path;
|
||||
|
||||
// checking is PAC_LOCK_DIR ("/var/lib/hive-up") exist
|
||||
// and creating it if it does not.
|
||||
let pack_lock_dir_path = Path::new(PAC_LOCK_DIR);
|
||||
if !pack_lock_dir_path.exists() {
|
||||
println!("Warning! {} directory do not exist. Creating...", PAC_LOCK_DIR);
|
||||
fs::create_dir_all(pack_lock_dir_path)?;
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
// if snapshots is configured
|
||||
if let Some(snaps_conf) = &hive_config.snapshots {
|
||||
if snaps_conf.enable.unwrap_or(false) {
|
||||
@@ -338,7 +348,7 @@ pub fn pac_finish() -> Result<(), ExecCommandError> {
|
||||
// Check if lock file exist
|
||||
let pack_lock_path = Path::new(PAC_LOCK_FILE);
|
||||
if pack_lock_path.exists() {
|
||||
println!("Remowing pac-lock...");
|
||||
println!("Removing pac-lock...");
|
||||
fs::remove_file(pack_lock_path)?;
|
||||
} else {
|
||||
println!("Warning! Pac Lock file does not exist...");
|
||||
|
||||
+2
-2
@@ -98,7 +98,7 @@ enum Pac {
|
||||
Start,
|
||||
/// This supposed to be called by pacman hook before transaction.
|
||||
/// Right now only thing it does is removes /var/lib/hive-up/pac-lock file
|
||||
Finis,
|
||||
Finish,
|
||||
}
|
||||
|
||||
#[derive(Subcommand, Debug)]
|
||||
@@ -167,7 +167,7 @@ fn main() -> Result<(), HiveUpError> {
|
||||
println!("Ok.");
|
||||
},
|
||||
Pac::Start => hive_system::pac_start(&bzz_config)?,
|
||||
Pac::Finis => hive_system::pac_finish()?
|
||||
Pac::Finish => hive_system::pac_finish()?
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user