mirror of
https://github.com/Jguer/yay.git
synced 2024-11-06 17:17:22 +01:00
7da9f4869d
* add built package check * respect --needed for new engine * add needed check and test * add test for not built
57 lines
1.2 KiB
Go
57 lines
1.2 KiB
Go
package main
|
|
|
|
import "github.com/leonelquinteros/gotext"
|
|
|
|
type NoPkgDestsFoundError struct {
|
|
dir string
|
|
}
|
|
|
|
func (e *NoPkgDestsFoundError) Error() string {
|
|
return gotext.Get("could not find any package archives listed in %s", e.dir)
|
|
}
|
|
|
|
type SetPkgReasonError struct {
|
|
exp bool // explicit
|
|
}
|
|
|
|
func (e *SetPkgReasonError) Error() string {
|
|
reason := gotext.Get("explicit")
|
|
if !e.exp {
|
|
reason = gotext.Get("dependency")
|
|
}
|
|
|
|
return gotext.Get("error updating package install reason to %s", reason)
|
|
}
|
|
|
|
type FindPkgDestError struct {
|
|
name, pkgDest string
|
|
}
|
|
|
|
func (e *FindPkgDestError) Error() string {
|
|
return gotext.Get(
|
|
"the PKGDEST for %s is listed by makepkg but does not exist: %s",
|
|
e.name, e.pkgDest)
|
|
}
|
|
|
|
type PkgDestNotInListError struct {
|
|
name string
|
|
}
|
|
|
|
func (e *PkgDestNotInListError) Error() string {
|
|
return gotext.Get("could not find PKGDEST for: %s", e.name)
|
|
}
|
|
|
|
type FailedIgnoredPkgError struct {
|
|
pkgErrors map[string]error
|
|
}
|
|
|
|
func (e *FailedIgnoredPkgError) Error() string {
|
|
msg := gotext.Get("Failed to install the following packages. Manual intervention is required:")
|
|
|
|
for pkg, err := range e.pkgErrors {
|
|
msg += "\n" + pkg + " - " + err.Error()
|
|
}
|
|
|
|
return msg
|
|
}
|