mirror of
https://github.com/Jguer/yay
synced 2024-10-31 04:12:51 +00:00
Respect --ignore and --ignoregroup flags
And enable version colouring on repo ignore and devel ignore
This commit is contained in:
parent
e86e39a21d
commit
74196306fa
2 changed files with 15 additions and 2 deletions
11
cmd.go
11
cmd.go
|
@ -188,6 +188,17 @@ func initAlpm() (err error) {
|
||||||
alpmConf.Architecture = value
|
alpmConf.Architecture = value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
value, _, exists = cmdArgs.getArg("ignore")
|
||||||
|
if exists {
|
||||||
|
alpmConf.IgnorePkg = append(alpmConf.IgnorePkg, strings.Split(value, ",")...)
|
||||||
|
}
|
||||||
|
|
||||||
|
value, _, exists = cmdArgs.getArg("ignoregroup")
|
||||||
|
if exists {
|
||||||
|
alpmConf.IgnoreGroup = append(alpmConf.IgnoreGroup, strings.Split(value, ",")...)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//TODO
|
//TODO
|
||||||
//current system does not allow duplicate arguments
|
//current system does not allow duplicate arguments
|
||||||
//but pacman allows multiple cachdirs to be passed
|
//but pacman allows multiple cachdirs to be passed
|
||||||
|
|
|
@ -140,8 +140,9 @@ func upDevel(remote []alpm.Package, packageC chan upgrade, done chan bool) {
|
||||||
}
|
}
|
||||||
if found {
|
if found {
|
||||||
if pkg.ShouldIgnore() {
|
if pkg.ShouldIgnore() {
|
||||||
|
left, right := getVersionDiff(pkg.Version(), "latest-commit")
|
||||||
fmt.Print(magenta("Warning: "))
|
fmt.Print(magenta("Warning: "))
|
||||||
fmt.Printf("%s ignoring package upgrade (%s => %s)\n", cyan(pkg.Name()), pkg.Version(), "git")
|
fmt.Printf("%s ignoring package upgrade (%s => %s)\n", cyan(pkg.Name()), left, right)
|
||||||
} else {
|
} else {
|
||||||
packageC <- upgrade{pkg.Name(), "devel", pkg.Version(), "latest-commit"}
|
packageC <- upgrade{pkg.Name(), "devel", pkg.Version(), "latest-commit"}
|
||||||
}
|
}
|
||||||
|
@ -229,8 +230,9 @@ func upRepo(local []alpm.Package) (upSlice, error) {
|
||||||
newPkg := pkg.NewVersion(dbList)
|
newPkg := pkg.NewVersion(dbList)
|
||||||
if newPkg != nil {
|
if newPkg != nil {
|
||||||
if pkg.ShouldIgnore() {
|
if pkg.ShouldIgnore() {
|
||||||
|
left, right := getVersionDiff(pkg.Version(), newPkg.Version())
|
||||||
fmt.Print(magenta("Warning: "))
|
fmt.Print(magenta("Warning: "))
|
||||||
fmt.Printf("%s ignoring package upgrade (%s => %s)\n", pkg.Name(), pkg.Version(), newPkg.Version())
|
fmt.Printf("%s ignoring package upgrade (%s => %s)\n", cyan(pkg.Name()), left, right)
|
||||||
} else {
|
} else {
|
||||||
slice = append(slice, upgrade{pkg.Name(), newPkg.DB().Name(), pkg.Version(), newPkg.Version()})
|
slice = append(slice, upgrade{pkg.Name(), newPkg.DB().Name(), pkg.Version(), newPkg.Version()})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue