()
| 30 | } |
| 31 | |
| 32 | func (p *Package) ValidateInstallsOnSystem() (bool, error) { |
| 33 | u, err := p.urlForInstall() |
| 34 | if err != nil { |
| 35 | return false, err |
| 36 | } |
| 37 | info, _ := nix.Search(u) |
| 38 | if len(info) == 0 { |
| 39 | return false, nil |
| 40 | } |
| 41 | if out, err := nix.Eval(u); err != nil && |
| 42 | strings.Contains(string(out), "is not available on the requested hostPlatform") { |
| 43 | return false, nil |
| 44 | } |
| 45 | // There's other stuff that may cause this evaluation to fail, but we don't |
| 46 | // want to handle all of them here. (e.g. unfree packages) |
| 47 | return true, nil |
| 48 | } |
nothing calls this directly
no test coverage detected