mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-05 05:20:34 +00:00
Refactor Filter options into a struct
It was already a lot of options for one method and I am going to add another one in the next commit.
This commit is contained in:
+8
-1
@@ -116,7 +116,14 @@ func aptlyRepoMoveCopyImport(cmd *commander.Command, args []string) error {
|
||||
}
|
||||
}
|
||||
|
||||
toProcess, err := srcList.FilterWithProgress(queries, withDeps, dstList, context.DependencyOptions(), architecturesList, context.Progress())
|
||||
toProcess, err := srcList.Filter(deb.FilterOptions{
|
||||
Queries: queries,
|
||||
WithDependencies: withDeps,
|
||||
Source: dstList,
|
||||
DependencyOptions: context.DependencyOptions(),
|
||||
Architectures: architecturesList,
|
||||
Progress: context.Progress(),
|
||||
})
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to %s: %s", command, err)
|
||||
}
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ func aptlyRepoRemove(cmd *commander.Command, args []string) error {
|
||||
}
|
||||
|
||||
list.PrepareIndex()
|
||||
toRemove, err := list.Filter(queries, false, nil, 0, nil)
|
||||
toRemove, err := list.Filter(deb.FilterOptions{Queries: queries})
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to remove: %s", err)
|
||||
}
|
||||
|
||||
@@ -67,7 +67,14 @@ func aptlySnapshotFilter(cmd *commander.Command, args []string) error {
|
||||
}
|
||||
|
||||
// Filter with dependencies as requested
|
||||
result, err := packageList.FilterWithProgress(queries, withDeps, nil, context.DependencyOptions(), architecturesList, context.Progress())
|
||||
result, err := packageList.Filter(deb.FilterOptions{
|
||||
Queries: queries,
|
||||
WithDependencies: withDeps,
|
||||
Source: nil,
|
||||
DependencyOptions: context.DependencyOptions(),
|
||||
Architectures: architecturesList,
|
||||
Progress: context.Progress(),
|
||||
})
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to filter: %s", err)
|
||||
}
|
||||
|
||||
@@ -97,7 +97,14 @@ func aptlySnapshotPull(cmd *commander.Command, args []string) error {
|
||||
}
|
||||
|
||||
// Filter with dependencies as requested
|
||||
result, err := sourcePackageList.FilterWithProgress(queries, !noDeps, packageList, context.DependencyOptions(), architecturesList, context.Progress())
|
||||
result, err := sourcePackageList.Filter(deb.FilterOptions{
|
||||
Queries: queries,
|
||||
WithDependencies: !noDeps,
|
||||
Source: packageList,
|
||||
DependencyOptions: context.DependencyOptions(),
|
||||
Architectures: architecturesList,
|
||||
Progress: context.Progress(),
|
||||
})
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to pull: %s", err)
|
||||
}
|
||||
|
||||
@@ -103,8 +103,13 @@ func aptlySnapshotMirrorRepoSearch(cmd *commander.Command, args []string) error
|
||||
}
|
||||
}
|
||||
|
||||
result, err := list.FilterWithProgress([]deb.PackageQuery{q}, withDeps,
|
||||
nil, context.DependencyOptions(), architecturesList, context.Progress())
|
||||
result, err := list.Filter(deb.FilterOptions{
|
||||
Queries: []deb.PackageQuery{q},
|
||||
WithDependencies: withDeps,
|
||||
DependencyOptions: context.DependencyOptions(),
|
||||
Architectures: architecturesList,
|
||||
Progress: context.Progress(),
|
||||
})
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to search: %s", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user