mirror of
https://github.com/Jguer/yay
synced 2024-10-02 22:33:47 +00:00
Move intrange to its own module
types is pretty generic as a module name, this should be split into seperate modules.
This commit is contained in:
parent
f2579f26a3
commit
cff358d5d6
2
clean.go
2
clean.go
|
@ -6,7 +6,7 @@ import (
|
|||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/Jguer/yay/v9/pkg/stringset"
|
||||
"github.com/Jguer/yay/v9/pkg/stringset"
|
||||
)
|
||||
|
||||
// GetPkgbuild gets the pkgbuild of the package 'pkg' trying the ABS first and then the AUR trying the ABS first and then the AUR.
|
||||
|
|
4
cmd.go
4
cmd.go
|
@ -8,7 +8,7 @@ import (
|
|||
|
||||
alpm "github.com/Jguer/go-alpm"
|
||||
"github.com/Jguer/yay/v9/pkg/completion"
|
||||
"github.com/Jguer/yay/v9/pkg/types"
|
||||
"github.com/Jguer/yay/v9/pkg/intrange"
|
||||
)
|
||||
|
||||
var cmdArgs = makeArguments()
|
||||
|
@ -355,7 +355,7 @@ func displayNumberMenu(pkgS []string) (err error) {
|
|||
return fmt.Errorf("Input too long")
|
||||
}
|
||||
|
||||
include, exclude, _, otherExclude := types.ParseNumberMenu(string(numberBuf))
|
||||
include, exclude, _, otherExclude := intrange.ParseNumberMenu(string(numberBuf))
|
||||
arguments := cmdArgs.copyGlobal()
|
||||
|
||||
isInclude := len(exclude) == 0 && len(otherExclude) == 0
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"sync"
|
||||
|
||||
alpm "github.com/Jguer/go-alpm"
|
||||
"github.com/Jguer/yay/v9/pkg/stringset"
|
||||
"github.com/Jguer/yay/v9/pkg/stringset"
|
||||
)
|
||||
|
||||
func (dp *depPool) checkInnerConflict(name string, conflict string, conflicts stringset.MapStringSet) {
|
||||
|
|
|
@ -2,7 +2,7 @@ package main
|
|||
|
||||
import (
|
||||
alpm "github.com/Jguer/go-alpm"
|
||||
"github.com/Jguer/yay/v9/pkg/stringset"
|
||||
"github.com/Jguer/yay/v9/pkg/stringset"
|
||||
rpc "github.com/mikkeloscar/aur"
|
||||
)
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
"sync"
|
||||
|
||||
alpm "github.com/Jguer/go-alpm"
|
||||
"github.com/Jguer/yay/v9/pkg/stringset"
|
||||
"github.com/Jguer/yay/v9/pkg/stringset"
|
||||
rpc "github.com/mikkeloscar/aur"
|
||||
)
|
||||
|
||||
|
|
|
@ -11,8 +11,9 @@ import (
|
|||
|
||||
alpm "github.com/Jguer/go-alpm"
|
||||
"github.com/Jguer/yay/v9/pkg/completion"
|
||||
"github.com/Jguer/yay/v9/pkg/types"
|
||||
"github.com/Jguer/yay/v9/pkg/intrange"
|
||||
"github.com/Jguer/yay/v9/pkg/stringset"
|
||||
"github.com/Jguer/yay/v9/pkg/types"
|
||||
gosrc "github.com/Morganamilo/go-srcinfo"
|
||||
)
|
||||
|
||||
|
@ -584,7 +585,7 @@ func cleanNumberMenu(bases []Base, installed stringset.StringSet, hasClean bool)
|
|||
return nil, err
|
||||
}
|
||||
|
||||
cInclude, cExclude, cOtherInclude, cOtherExclude := types.ParseNumberMenu(cleanInput)
|
||||
cInclude, cExclude, cOtherInclude, cOtherExclude := intrange.ParseNumberMenu(cleanInput)
|
||||
cIsInclude := len(cExclude) == 0 && len(cOtherExclude) == 0
|
||||
|
||||
if cOtherInclude.Get("abort") || cOtherInclude.Get("ab") {
|
||||
|
@ -669,7 +670,7 @@ func editDiffNumberMenu(bases []Base, installed stringset.StringSet, diff bool)
|
|||
}
|
||||
}
|
||||
|
||||
eInclude, eExclude, eOtherInclude, eOtherExclude := types.ParseNumberMenu(editInput)
|
||||
eInclude, eExclude, eOtherInclude, eOtherExclude := intrange.ParseNumberMenu(editInput)
|
||||
eIsInclude := len(eExclude) == 0 && len(eOtherExclude) == 0
|
||||
|
||||
if eOtherInclude.Get("abort") || eOtherInclude.Get("ab") {
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/Jguer/yay/v9/pkg/stringset"
|
||||
"github.com/Jguer/yay/v9/pkg/stringset"
|
||||
rpc "github.com/mikkeloscar/aur"
|
||||
)
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package types
|
||||
package intrange
|
||||
|
||||
import (
|
||||
"strconv"
|
|
@ -1,4 +1,4 @@
|
|||
package types
|
||||
package intrange
|
||||
|
||||
import (
|
||||
"github.com/Jguer/yay/v9/pkg/stringset"
|
7
print.go
7
print.go
|
@ -12,7 +12,8 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/Jguer/yay/v9/pkg/types"
|
||||
"github.com/Jguer/yay/v9/pkg/intrange"
|
||||
|
||||
"github.com/Jguer/yay/v9/pkg/stringset"
|
||||
rpc "github.com/mikkeloscar/aur"
|
||||
)
|
||||
|
@ -178,8 +179,8 @@ func (u upSlice) print() {
|
|||
packNameLen := len(pack.StylizedNameWithRepository())
|
||||
version, _ := getVersionDiff(pack.LocalVersion, pack.RemoteVersion)
|
||||
packVersionLen := len(version)
|
||||
longestName = types.Max(packNameLen, longestName)
|
||||
longestVersion = types.Max(packVersionLen, longestVersion)
|
||||
longestName = intrange.Max(packNameLen, longestName)
|
||||
longestVersion = intrange.Max(packVersionLen, longestVersion)
|
||||
}
|
||||
|
||||
namePadding := fmt.Sprintf("%%-%ds ", longestName)
|
||||
|
|
4
query.go
4
query.go
|
@ -9,7 +9,9 @@ import (
|
|||
"time"
|
||||
|
||||
alpm "github.com/Jguer/go-alpm"
|
||||
"github.com/Jguer/yay/v9/pkg/intrange"
|
||||
"github.com/Jguer/yay/v9/pkg/types"
|
||||
|
||||
"github.com/Jguer/yay/v9/pkg/stringset"
|
||||
rpc "github.com/mikkeloscar/aur"
|
||||
)
|
||||
|
@ -519,7 +521,7 @@ func aurInfo(names []string, warnings *aurWarnings) ([]*rpc.Pkg, error) {
|
|||
}
|
||||
|
||||
for n := 0; n < len(names); n += config.RequestSplitN {
|
||||
max := types.Min(len(names), n+config.RequestSplitN)
|
||||
max := intrange.Min(len(names), n+config.RequestSplitN)
|
||||
wg.Add(1)
|
||||
go makeRequest(n, max)
|
||||
}
|
||||
|
|
|
@ -7,8 +7,10 @@ import (
|
|||
"unicode"
|
||||
|
||||
alpm "github.com/Jguer/go-alpm"
|
||||
"github.com/Jguer/yay/v9/pkg/types"
|
||||
"github.com/Jguer/yay/v9/pkg/intrange"
|
||||
|
||||
"github.com/Jguer/yay/v9/pkg/stringset"
|
||||
"github.com/Jguer/yay/v9/pkg/types"
|
||||
rpc "github.com/mikkeloscar/aur"
|
||||
)
|
||||
|
||||
|
@ -365,7 +367,7 @@ func upgradePkgs(aurUp, repoUp upSlice) (stringset.StringSet, stringset.StringSe
|
|||
//upgrade menu asks you which packages to NOT upgrade so in this case
|
||||
//include and exclude are kind of swapped
|
||||
//include, exclude, other := parseNumberMenu(string(numberBuf))
|
||||
include, exclude, otherInclude, otherExclude := types.ParseNumberMenu(numbers)
|
||||
include, exclude, otherInclude, otherExclude := intrange.ParseNumberMenu(numbers)
|
||||
|
||||
isInclude := len(exclude) == 0 && len(otherExclude) == 0
|
||||
|
||||
|
|
Loading…
Reference in a new issue