Skip to content

Commit

Permalink
dnfjson: detect missing dnfjson late (in run)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvo5 authored and achilleas-k committed Jan 12, 2024
1 parent a0c13e1 commit 6645f6f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/dnfjson/dnfjson.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ func findDepsolveDnf() string {
func NewBaseSolver(cacheDir string) *BaseSolver {
return &BaseSolver{
cache: newRPMCache(cacheDir, 1024*1024*1024), // 1 GiB
dnfJsonCmd: []string{findDepsolveDnf()},
resultCache: NewDNFCache(60 * time.Second),
}
}
Expand Down Expand Up @@ -636,6 +635,9 @@ func ParseError(data []byte) Error {
}

func run(dnfJsonCmd []string, req *Request) ([]byte, error) {
if len(dnfJsonCmd) == 0 {
dnfJsonCmd = []string{findDepsolveDnf()}
}
if len(dnfJsonCmd) == 0 {
return nil, fmt.Errorf("osbuild-depsolve-dnf command undefined")
}
Expand Down

0 comments on commit 6645f6f

Please sign in to comment.