Add specs for dyalpm package query and batch explicit marking
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: ValidatePackages uses dyalpm library with batch AUR fallback
|
||||
The ValidatePackages method SHALL accept a slice of package names, query them in batch using dyalpm, then batch query AUR for any not found in pacman databases.
|
||||
|
||||
#### Scenario: All packages found in local database
|
||||
- **WHEN** ValidatePackages is called with packages that all exist in local pacman database
|
||||
- **THEN** returns a slice of PackageInfo with Exists=true, InAUR=false for each
|
||||
|
||||
#### Scenario: Some packages found in sync database
|
||||
- **WHEN** ValidatePackages is called with packages where some are only in sync databases
|
||||
- **THEN** returns PackageInfo with Exists=true, InAUR=false for found packages
|
||||
|
||||
#### Scenario: Some packages found in AUR
|
||||
- **WHEN** ValidatePackages is called and some packages are not in pacman databases
|
||||
- **THEN** those packages are batched to single AUR HTTP request, returns PackageInfo with InAUR=true
|
||||
|
||||
#### Scenario: Packages not found anywhere
|
||||
- **WHEN** ValidatePackages is called and some packages not found in pacman or AUR
|
||||
- **THEN** returns PackageInfo with Exists=false, InAUR=false for those packages
|
||||
|
||||
### Requirement: Unified package cache
|
||||
The Pac struct SHALL maintain a single cache map that stores all package query results (both pacman and AUR), replacing the separate aurCache.
|
||||
|
||||
#### Scenario: Package already cached
|
||||
- **WHEN** ValidatePackages is called for a package already queried in current job
|
||||
- **THEN** cached result returned without any dyalpm or AUR calls
|
||||
|
||||
#### Scenario: New Pac instance
|
||||
- **WHEN** New() creates a new Pac instance
|
||||
- **THEN** cache is empty (fresh job)
|
||||
|
||||
### Requirement: Single batch AUR call
|
||||
The AUR HTTP API SHALL be called once with all package names not found in pacman databases.
|
||||
|
||||
#### Scenario: Multiple packages not in pacman
|
||||
- **WHEN** 3 packages not found in local or sync databases
|
||||
- **THEN** single AUR HTTP request with all 3 in arg[] params
|
||||
- **AND** results cached for all 3
|
||||
|
||||
### Requirement: Fallback to process spawn if dyalpm unavailable
|
||||
If dyalpm library is not available at runtime, ValidatePackages SHALL fall back to spawning pacman -Qip/-Sip processes in batch.
|
||||
|
||||
#### Scenario: dyalpm unavailable
|
||||
- **WHEN** dyalpm initialization fails
|
||||
- **THEN** uses pacman -Qip for local, -Sip for sync, AUR HTTP batch as fallback
|
||||
- **AND** behavior is identical to using dyalpm
|
||||
Reference in New Issue
Block a user