mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-02 04:50:49 +00:00
Allow filter to be empty for aptly * search commands
Empty filter implies "select all packages".
This commit is contained in:
@@ -72,6 +72,9 @@ type DependencyQuery struct {
|
||||
Dep Dependency
|
||||
}
|
||||
|
||||
// MatchAllQuery is query that matches all the packages
|
||||
type MatchAllQuery struct{}
|
||||
|
||||
// Matches if any of L, R matches
|
||||
func (q *OrQuery) Matches(pkg PackageLike) bool {
|
||||
return q.L.Matches(pkg) || q.R.Matches(pkg)
|
||||
@@ -275,3 +278,23 @@ func (q *PkgQuery) Query(list PackageCatalog) (result *PackageList) {
|
||||
func (q *PkgQuery) String() string {
|
||||
return fmt.Sprintf("%s_%s_%s", q.Pkg, q.Version, q.Arch)
|
||||
}
|
||||
|
||||
// Matches on specific properties
|
||||
func (q *MatchAllQuery) Matches(pkg PackageLike) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// Fast is always true for match all query
|
||||
func (q *MatchAllQuery) Fast(list PackageCatalog) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// Query looks up specific package
|
||||
func (q *MatchAllQuery) Query(list PackageCatalog) (result *PackageList) {
|
||||
return list.Scan(q)
|
||||
}
|
||||
|
||||
// String interface
|
||||
func (q *MatchAllQuery) String() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user