2022-09-20 00:44:06 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import "github.com/leonelquinteros/gotext"
|
|
|
|
|
2022-12-16 18:23:44 +01:00
|
|
|
type NoPkgDestsFoundError struct {
|
|
|
|
dir string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e *NoPkgDestsFoundError) Error() string {
|
|
|
|
return gotext.Get("could not find any package archives listed in %s", e.dir)
|
|
|
|
}
|
|
|
|
|
2022-11-01 23:48:35 +01:00
|
|
|
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 {
|
2022-09-20 00:44:06 +02:00
|
|
|
name, pkgDest string
|
|
|
|
}
|
|
|
|
|
2022-11-01 23:48:35 +01:00
|
|
|
func (e *FindPkgDestError) Error() string {
|
2022-09-20 00:44:06 +02:00
|
|
|
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)
|
|
|
|
}
|
2022-11-29 13:25:36 +01:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|