wolfpack 0.3.1

A package manager and a build tool that supports major package formats (deb, RPM, ipk, pkg, MSIX).
Documentation
use std::sync::LazyLock;

use parking_lot::Mutex;
use parking_lot::MutexGuard;

pub fn prevent_concurrency(bucket: &str) -> MutexGuard<'_, ()> {
    for (name, mutex) in BUCKETS.iter() {
        if name == &bucket {
            return mutex.lock();
        }
    }
    panic!("no such concurrency bucket: {:?}", bucket);
}

static BUCKETS: LazyLock<Vec<(&'static str, Mutex<()>)>> = LazyLock::new(|| {
    vec![
        ("freebsd-pkg", Mutex::new(())),
        ("rpm", Mutex::new(())),
        ("macos", Mutex::new(())),
        ("wine", Mutex::new(())),
        ("opkg", Mutex::new(())),
    ]
});