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"
|
"fmt"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"sort"
|
"sort"
|
||||||
|
"strings"
|
||||||
|
|
||||||
// . "github.com/mudler/luet/pkg/logger"
|
// . "github.com/mudler/luet/pkg/logger"
|
||||||
|
|
||||||
@@ -77,6 +78,8 @@ type Package interface {
|
|||||||
|
|
||||||
SetLicense(string)
|
SetLicense(string)
|
||||||
GetLicense() string
|
GetLicense() string
|
||||||
|
|
||||||
|
IsSelector() bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type Tree interface {
|
type Tree interface {
|
||||||
@@ -179,6 +182,10 @@ func (p *DefaultPackage) SetPath(s string) {
|
|||||||
p.Path = s
|
p.Path = s
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *DefaultPackage) IsSelector() bool {
|
||||||
|
return strings.ContainsAny(p.GetVersion(), "<>=")
|
||||||
|
}
|
||||||
|
|
||||||
// AddUse adds a use to a package
|
// AddUse adds a use to a package
|
||||||
func (p *DefaultPackage) AddUse(use string) {
|
func (p *DefaultPackage) AddUse(use string) {
|
||||||
for _, v := range p.UseFlags {
|
for _, v := range p.UseFlags {
|
||||||
|
Reference in New Issue
Block a user