mirror of
https://github.com/Jguer/yay
synced 2024-10-02 22:33:47 +00:00
chore(pacman): remove pacman 5 support
This commit is contained in:
parent
c9e63fff0d
commit
61e38ad2fc
1
Makefile
1
Makefile
|
@ -24,7 +24,6 @@ POFILES := $(addprefix $(LOCALEDIR)/,$(addsuffix .po,$(LANGS)))
|
|||
MOFILES := $(POFILES:.po=.mo)
|
||||
|
||||
FLAGS ?= -trimpath -mod=readonly -modcacherw
|
||||
FLAGS += $(shell pacman -T 'pacman>6' && echo "-tags six")
|
||||
EXTRA_FLAGS ?= -buildmode=pie
|
||||
LDFLAGS := -X "main.yayVersion=${VERSION}" -X "main.localePath=${SYSTEMLOCALEPATH}" -linkmode=external
|
||||
|
||||
|
|
6
go.mod
6
go.mod
|
@ -2,15 +2,15 @@ module github.com/Jguer/yay/v10
|
|||
|
||||
require (
|
||||
github.com/Jguer/aur v1.0.0
|
||||
github.com/Jguer/go-alpm/v2 v2.0.5
|
||||
github.com/Jguer/go-alpm/v2 v2.0.6
|
||||
github.com/Morganamilo/go-pacmanconf v0.0.0-20210502114700-cff030e927a5
|
||||
github.com/Morganamilo/go-srcinfo v1.0.0
|
||||
github.com/bradleyjkemp/cupaloy v2.3.0+incompatible
|
||||
github.com/leonelquinteros/gotext v1.5.0
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/stretchr/testify v1.7.0
|
||||
golang.org/x/sys v0.0.0-20210608053332-aa57babbf139
|
||||
golang.org/x/term v0.0.0-20210503060354-a79de5458b56
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c
|
||||
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b
|
||||
golang.org/x/text v0.3.6 // indirect
|
||||
gopkg.in/h2non/gock.v1 v1.0.15
|
||||
)
|
||||
|
|
7
go.sum
7
go.sum
|
@ -8,6 +8,8 @@ github.com/Jguer/aur v1.0.0 h1:/1oCUucvFGA5kq1vA50UstQoj5hkRQuAKYp/pyBgOz0=
|
|||
github.com/Jguer/aur v1.0.0/go.mod h1:1/SQjhWahmk2xKcmAm6XO1zGqK8HgYw3xlJM6a7845E=
|
||||
github.com/Jguer/go-alpm/v2 v2.0.5 h1:1TZxkvCIfTOhjhxGy/Z1FNSeuY9DXBKF5qxUoj0IZ0A=
|
||||
github.com/Jguer/go-alpm/v2 v2.0.5/go.mod h1:zU4iKCtNkDARfj5BrKJXYAQ5nIjtZbySfa0paboSmTQ=
|
||||
github.com/Jguer/go-alpm/v2 v2.0.6 h1:VLavW5qFk/TJRHT3Gg7ClDukU4MNWdfkWM9yLxVkYyQ=
|
||||
github.com/Jguer/go-alpm/v2 v2.0.6/go.mod h1:zU4iKCtNkDARfj5BrKJXYAQ5nIjtZbySfa0paboSmTQ=
|
||||
github.com/Morganamilo/go-pacmanconf v0.0.0-20210502114700-cff030e927a5 h1:TMscPjkb1ThXN32LuFY5bEYIcXZx3YlwzhS1GxNpn/c=
|
||||
github.com/Morganamilo/go-pacmanconf v0.0.0-20210502114700-cff030e927a5/go.mod h1:Hk55m330jNiwxRodIlMCvw5iEyoRUCIY64W1p9D+tHc=
|
||||
github.com/Morganamilo/go-srcinfo v1.0.0 h1:Wh4nEF+HJWo+29hnxM18Q2hi+DUf0GejS13+Wg+dzmI=
|
||||
|
@ -48,8 +50,13 @@ golang.org/x/sys v0.0.0-20210511113859-b0526f3d8744 h1:yhBbb4IRs2HS9PPlAg6DMC6mU
|
|||
golang.org/x/sys v0.0.0-20210511113859-b0526f3d8744/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210608053332-aa57babbf139 h1:C+AwYEtBp/VQwoLntUmQ/yx3MS9vmZaKNdw5eOpoQe8=
|
||||
golang.org/x/sys v0.0.0-20210608053332-aa57babbf139/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I=
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20210503060354-a79de5458b56 h1:b8jxX3zqjpqb2LklXPzKSGJhzyxCOZSz8ncv8Nv+y7w=
|
||||
golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY=
|
||||
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b h1:9zKuko04nR4gjZ4+DNjHqRlAJqbJETHwiNKDqTfOjfE=
|
||||
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
|
|
|
@ -482,3 +482,27 @@ func (ae *AlpmExecutor) Repos() (repos []string) {
|
|||
})
|
||||
return
|
||||
}
|
||||
|
||||
func alpmSetArchitecture(alpmHandle *alpm.Handle, arch []string) error {
|
||||
return alpmHandle.SetArchitectures(arch)
|
||||
}
|
||||
|
||||
func (ae *AlpmExecutor) AlpmArchitectures() ([]string, error) {
|
||||
architectures, err := ae.handle.GetArchitectures()
|
||||
|
||||
return architectures.Slice(), err
|
||||
}
|
||||
|
||||
func alpmSetLogCallback(alpmHandle *alpm.Handle, cb func(alpm.LogLevel, string)) {
|
||||
alpmHandle.SetLogCallback(func(ctx interface{}, lvl alpm.LogLevel, msg string) {
|
||||
cbo := ctx.(func(alpm.LogLevel, string))
|
||||
cbo(lvl, msg)
|
||||
}, cb)
|
||||
}
|
||||
|
||||
func alpmSetQuestionCallback(alpmHandle *alpm.Handle, cb func(alpm.QuestionAny)) {
|
||||
alpmHandle.SetQuestionCallback(func(ctx interface{}, q alpm.QuestionAny) {
|
||||
cbo := ctx.(func(alpm.QuestionAny))
|
||||
cbo(q)
|
||||
}, cb)
|
||||
}
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
// +build !six
|
||||
|
||||
package ialpm
|
||||
|
||||
import (
|
||||
alpm "github.com/Jguer/go-alpm/v2"
|
||||
)
|
||||
|
||||
func alpmSetArchitecture(alpmHandle *alpm.Handle, arch []string) error {
|
||||
return alpmHandle.SetArch(arch[0])
|
||||
}
|
||||
|
||||
func (ae *AlpmExecutor) AlpmArchitectures() ([]string, error) {
|
||||
arch, err := ae.handle.Arch()
|
||||
|
||||
return []string{arch}, err
|
||||
}
|
||||
|
||||
func alpmSetLogCallback(alpmHandle *alpm.Handle, cb func(alpm.LogLevel, string)) {
|
||||
alpmHandle.SetLogCallback(cb)
|
||||
}
|
||||
|
||||
func alpmSetQuestionCallback(alpmHandle *alpm.Handle, cb func(alpm.QuestionAny)) {
|
||||
alpmHandle.SetQuestionCallback(cb)
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
// +build !six
|
||||
|
||||
package ialpm
|
||||
|
||||
import (
|
||||
alpm "github.com/Jguer/go-alpm/v2"
|
||||
)
|
||||
|
||||
func alpmTestGetArch(h *alpm.Handle) ([]string, error) {
|
||||
arch, err := h.Arch()
|
||||
|
||||
return []string{arch}, err
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
// +build six
|
||||
|
||||
package ialpm
|
||||
|
||||
import (
|
||||
alpm "github.com/Jguer/go-alpm/v2"
|
||||
)
|
||||
|
||||
func alpmSetArchitecture(alpmHandle *alpm.Handle, arch []string) error {
|
||||
return alpmHandle.SetArchitectures(arch)
|
||||
}
|
||||
|
||||
func (ae *AlpmExecutor) AlpmArchitectures() ([]string, error) {
|
||||
architectures, err := ae.handle.GetArchitectures()
|
||||
|
||||
return architectures.Slice(), err
|
||||
}
|
||||
|
||||
func alpmSetLogCallback(alpmHandle *alpm.Handle, cb func(alpm.LogLevel, string)) {
|
||||
alpmHandle.SetLogCallback(func(ctx interface{}, lvl alpm.LogLevel, msg string) {
|
||||
cb := ctx.(func(alpm.LogLevel, string))
|
||||
cb(lvl, msg)
|
||||
}, cb)
|
||||
}
|
||||
|
||||
func alpmSetQuestionCallback(alpmHandle *alpm.Handle, cb func(alpm.QuestionAny)) {
|
||||
alpmHandle.SetQuestionCallback(func(ctx interface{}, q alpm.QuestionAny) {
|
||||
cb := ctx.(func(alpm.QuestionAny))
|
||||
cb(q)
|
||||
}, cb)
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
// +build six
|
||||
|
||||
package ialpm
|
||||
|
||||
import (
|
||||
alpm "github.com/Jguer/go-alpm/v2"
|
||||
)
|
||||
|
||||
func alpmTestGetArch(h *alpm.Handle) ([]string, error) {
|
||||
architectures, err := h.GetArchitectures()
|
||||
|
||||
return architectures.Slice(), err
|
||||
}
|
|
@ -3,6 +3,7 @@ package ialpm
|
|||
import (
|
||||
"testing"
|
||||
|
||||
alpm "github.com/Jguer/go-alpm/v2"
|
||||
"github.com/Morganamilo/go-pacmanconf"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
@ -99,3 +100,9 @@ func TestAlpmExecutor(t *testing.T) {
|
|||
assert.Nil(t, err)
|
||||
assert.Equal(t, true, check)
|
||||
}
|
||||
|
||||
func alpmTestGetArch(h *alpm.Handle) ([]string, error) {
|
||||
architectures, err := h.GetArchitectures()
|
||||
|
||||
return architectures.Slice(), err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue