fix(new_engine): exclude menu removing new deps (#2040)
fix exclude menu removing new deps
This commit is contained in:
3 files changed
+113
-7
No files matched your search
@@ -6,6 +6,26 @@ import (
|
||||
alpm "github.com/Jguer/go-alpm/v2"
|
||||
)
|
||||
|
||||
type DependList struct {
|
||||
Depends []Depend
|
||||
}
|
||||
|
||||
func (d DependList) Slice() []alpm.Depend {
|
||||
return d.Depends
|
||||
}
|
||||
|
||||
func (d DependList) ForEach(f func(*alpm.Depend) error) error {
|
||||
for i := range d.Depends {
|
||||
dep := &d.Depends[i]
|
||||
err := f(dep)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
type Package struct {
|
||||
PBase string
|
||||
PBuildDate time.Time
|
||||
@@ -17,6 +37,7 @@ type Package struct {
|
||||
PSize int64
|
||||
PVersion string
|
||||
PReason alpm.PkgReason
|
||||
PDepends alpm.IDependList
|
||||
}
|
||||
|
||||
func (p *Package) Base() string {
|
||||
@@ -88,6 +109,9 @@ func (p *Package) Conflicts() alpm.IDependList {
|
||||
|
||||
// Depends returns the package's dependency list.
|
||||
func (p *Package) Depends() alpm.IDependList {
|
||||
if p.PDepends != nil {
|
||||
return p.PDepends
|
||||
}
|
||||
return alpm.DependList{}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user