oma_utils/
lib.rs

1pub use os_release::OsRelease;
2
3#[cfg(feature = "dbus")]
4pub mod dbus;
5#[cfg(feature = "dbus")]
6pub use zbus;
7
8#[cfg(feature = "dpkg")]
9pub mod dpkg;
10#[cfg(feature = "human-bytes")]
11pub mod human_bytes;
12#[cfg(feature = "url-no-escape")]
13pub mod url_no_escape;
14
15#[inline]
16pub fn is_termux() -> bool {
17    std::env::var("TERMUX_VERSION").is_ok_and(|v| !v.is_empty())
18}
19
20#[inline]
21pub fn concat_url(url: &str, path: &str) -> String {
22    format!(
23        "{}/{}",
24        url.trim_end_matches('/'),
25        path.trim_start_matches('/')
26    )
27}