pub async fn fetch_pkgbuild_fast(
item: &PackageItem,
) -> Result<String, Box<dyn Error + Send + Sync>>Expand description
What: Fetch PKGBUILD content for a package from AUR or official Git packaging repos.
Inputs:
item: Package whose PKGBUILD should be retrieved.
Output:
Ok(String)with PKGBUILD text when available;Erron network or lookup failure.
§Errors
- Returns
Errwhen network request fails (curl execution error) - Returns
Errwhen PKGBUILD cannot be fetched from AUR or official GitLab repositories - Returns
Errwhen rate limiting mutex is poisoned - Returns
Errwhen task spawn fails
§Panics
- Panics if the rate limiting mutex is poisoned
Details:
- First tries offline methods (yay/paru cache) for fast loading.
- Then tries network with rate limiting and timeout (10s).
- Uses curl with timeout to prevent hanging on slow servers.