diff --git a/pkg/dnfjson/dnfjson.go b/pkg/dnfjson/dnfjson.go index 3640cd7536..efef35c9af 100644 --- a/pkg/dnfjson/dnfjson.go +++ b/pkg/dnfjson/dnfjson.go @@ -460,10 +460,12 @@ func (s *Solver) makeDepsolveRequest(pkgSets []rpmmd.PackageSet) (*Request, map[ if err != nil { return nil, nil, err } + args := arguments{ - Repos: dnfRepoMap, - RootDir: s.rootDir, - Transactions: transactions, + Repos: dnfRepoMap, + RootDir: s.rootDir, + Transactions: transactions, + OptionalMetadata: s.optionalMetadataForDistro(), } req := Request{ @@ -479,6 +481,20 @@ func (s *Solver) makeDepsolveRequest(pkgSets []rpmmd.PackageSet) (*Request, map[ return &req, rhsmMap, nil } +func (s *Solver) optionalMetadataForDistro() []string { + // filelist repo metadata is required when using newer versions of libdnf + // with old repositories or packages that specify dependencies on files. + // EL10+ and Fedora 40+ packaging guidelines prohibit depending on + // filepaths so filelist downloads are disabled by default and are not + // required when depsolving for those distros. Explicitly enable the option + // for older distro versions in case we are using a newer libdnf. + switch s.modulePlatformID { + case "platform:f39", "platform:el7", "platform:el8", "platform:el9": + return []string{"filelists"} + } + return nil +} + // Helper function for creating a dump request payload func (s *Solver) makeDumpRequest(repos []rpmmd.RepoConfig) (*Request, error) { dnfRepos, err := s.reposFromRPMMD(repos)