rpmmd: sort fetched package list
When dnf-json dumps the packages from the repos passed to it, it does not sort the packages. In order to properly list and search the packages, the package list is now sorted before being returned by the FetchPackageList function.
This commit is contained in:
parent
41a2ef9b9a
commit
11eb0b5226
1 changed files with 3 additions and 0 deletions
|
|
@ -86,6 +86,9 @@ func FetchPackageList(repos []RepoConfig) (PackageList, error) {
|
|||
}{repos}
|
||||
var packages PackageList
|
||||
err := runDNF("dump", arguments, &packages)
|
||||
sort.Slice(packages, func(i, j int) bool {
|
||||
return packages[i].Name < packages[j].Name
|
||||
})
|
||||
return packages, err
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue