pacsea 0.8.2

A fast, friendly TUI for browsing and installing Arch and AUR packages with built-in news and security scanning
Documentation
//! Network and system data retrieval module split into submodules.

/// Security advisories fetching.
mod advisories;
/// AUR package voting via SSH.
mod aur_vote;
/// AUR comments fetching.
mod comments;
/// Package details fetching.
mod details;
/// News feed fetching.
mod feeds;
/// Arch Linux news fetching.
pub mod news;
/// PKGBUILD content fetching.
mod pkgbuild;
/// Package search functionality.
mod search;
/// Arch Linux status page monitoring.
pub mod status;

/// What: Result type alias for sources module errors.
///
/// Inputs: None (type alias).
///
/// Output: Result type with boxed error trait object.
///
/// Details: Standard error type for network and parsing operations in the sources module.
type Result<T> = std::result::Result<T, Box<dyn std::error::Error + Send + Sync>>;

pub use advisories::fetch_security_advisories;
pub use aur_vote::{
    AurPackageVoteState, AurVoteContext, AurVoteError, AurVoteOutcome, VoteAction, aur_vote,
    aur_vote_state, is_vote_state_unsupported_error,
};
pub use comments::fetch_aur_comments;
pub use details::fetch_details;
pub use feeds::{
    NewsFeedContext, check_circuit_breaker, extract_endpoint_pattern,
    extract_retry_after_from_error, fetch_continuation_items, fetch_news_feed,
    get_aur_json_changes, get_official_json_changes, increase_archlinux_backoff,
    load_official_json_cache, official_json_cache_path, optimize_max_age_for_startup,
    rate_limit_archlinux, record_circuit_breaker_outcome, reset_archlinux_backoff,
    take_network_error,
};
pub use news::{fetch_arch_news, fetch_news_content, parse_news_html};
pub use pkgbuild::fetch_pkgbuild_fast;
pub use search::fetch_all_with_errors;
pub use status::fetch_arch_status_text;

#[cfg(not(target_os = "windows"))]
#[cfg(test)]
static TEST_MUTEX: std::sync::OnceLock<std::sync::Mutex<()>> = std::sync::OnceLock::new();

#[cfg(not(target_os = "windows"))]
#[cfg(test)]
/// What: Provide a shared mutex to serialize tests that mutate PATH or curl shims.
///
/// Input: None.
/// Output: `&'static Mutex<()>` guard to synchronize tests touching global state.
///
/// Details: Lazily initializes a global `Mutex` via `OnceLock` for cross-test coordination.
pub(crate) fn test_mutex() -> &'static std::sync::Mutex<()> {
    TEST_MUTEX.get_or_init(|| std::sync::Mutex::new(()))
}