mirror of
https://github.com/mudler/luet.git
synced 2025-09-18 16:32:16 +00:00
Add IsSelector() to Package
It indicates if the package is a selector, by checking if versions contains constraints signs (<>=)
This commit is contained in:
committed by
Ettore Di Giacinto
parent
38cef9444c
commit
0627b03121
@@ -21,6 +21,7 @@ import (
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
// . "github.com/mudler/luet/pkg/logger"
|
||||
|
||||
@@ -77,6 +78,8 @@ type Package interface {
|
||||
|
||||
SetLicense(string)
|
||||
GetLicense() string
|
||||
|
||||
IsSelector() bool
|
||||
}
|
||||
|
||||
type Tree interface {
|
||||
@@ -179,6 +182,10 @@ func (p *DefaultPackage) SetPath(s string) {
|
||||
p.Path = s
|
||||
}
|
||||
|
||||
func (p *DefaultPackage) IsSelector() bool {
|
||||
return strings.ContainsAny(p.GetVersion(), "<>=")
|
||||
}
|
||||
|
||||
// AddUse adds a use to a package
|
||||
func (p *DefaultPackage) AddUse(use string) {
|
||||
for _, v := range p.UseFlags {
|
||||
|
Reference in New Issue
Block a user