Compare commits
2 Commits
076f90bbd7
...
2f81f7c605
Author | SHA1 | Date | |
---|---|---|---|
2f81f7c605 | |||
bb05a8d38b |
7
build.go
7
build.go
@ -254,6 +254,13 @@ func buildPackage(ctx context.Context, script string, mgr manager.Manager) ([]st
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
if instVer, ok := installed[vars.Name]; ok {
|
||||
log.Warn("This package is already installed").
|
||||
Str("name", vars.Name).
|
||||
Str("version", instVer).
|
||||
Send()
|
||||
}
|
||||
|
||||
var buildDeps []string
|
||||
for _, pkgName := range vars.BuildDepends {
|
||||
if _, ok := installed[pkgName]; !ok {
|
||||
|
2
go.mod
2
go.mod
@ -18,7 +18,7 @@ require (
|
||||
github.com/pelletier/go-toml/v2 v2.0.6
|
||||
github.com/twitchtv/twirp v8.1.3+incompatible
|
||||
github.com/urfave/cli/v2 v2.23.7
|
||||
go.arsenm.dev/logger v0.0.0-20230104225304-d706171ea6df
|
||||
go.arsenm.dev/logger v0.0.0-20230126004036-a8cbbe3b6fe6
|
||||
go.arsenm.dev/translate v0.0.0-20230113025904-5ad1ec0ed296
|
||||
golang.org/x/exp v0.0.0-20220916125017-b168a2c6b86b
|
||||
golang.org/x/sys v0.3.0
|
||||
|
4
go.sum
4
go.sum
@ -254,8 +254,8 @@ github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 h1:bAn7/zixMGCfxrRT
|
||||
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8=
|
||||
gitlab.com/digitalxero/go-conventional-commit v1.0.7 h1:8/dO6WWG+98PMhlZowt/YjuiKhqhGlOCwlIV8SqqGh8=
|
||||
gitlab.com/digitalxero/go-conventional-commit v1.0.7/go.mod h1:05Xc2BFsSyC5tKhK0y+P3bs0AwUtNuTp+mTpbCU/DZ0=
|
||||
go.arsenm.dev/logger v0.0.0-20230104225304-d706171ea6df h1:8mBHvEe7BJmpOeKSMA5YLqrGo9dCpePocTeR0C1+/2w=
|
||||
go.arsenm.dev/logger v0.0.0-20230104225304-d706171ea6df/go.mod h1:RV2qydKDdoyaRkhAq8JEGvojR8eJ6bjq5WnSIlH7gYw=
|
||||
go.arsenm.dev/logger v0.0.0-20230126004036-a8cbbe3b6fe6 h1:p5EkGdoRX4ddMJcYQzRPTHk8oVyMv0q8agaAbPr/oak=
|
||||
go.arsenm.dev/logger v0.0.0-20230126004036-a8cbbe3b6fe6/go.mod h1:Sg0thD0AZwMib+fD+YFOgmTWwEOqPbMjSSmWef6mEog=
|
||||
go.arsenm.dev/translate v0.0.0-20230113025904-5ad1ec0ed296 h1:uOJuOOn/sPe4YX9MD98tCoeLQTopIk17dJt0fwCeJrk=
|
||||
go.arsenm.dev/translate v0.0.0-20230113025904-5ad1ec0ed296/go.mod h1:+rZV+tkYEPgZyP0OWBH477vWNwxN3pcAcukcjzgQjco=
|
||||
golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
|
@ -112,15 +112,8 @@ func (a *APK) UpgradeAll(opts *Opts) error {
|
||||
}
|
||||
|
||||
func (a *APK) ListInstalled(opts *Opts) (map[string]string, error) {
|
||||
opts = ensureOpts(opts)
|
||||
out := map[string]string{}
|
||||
|
||||
var cmd *exec.Cmd
|
||||
if opts.AsRoot {
|
||||
cmd = exec.Command(getRootCmd(a.rootCmd), "apk", "list", "-I")
|
||||
} else {
|
||||
cmd = exec.Command("apk", "list", "-I")
|
||||
}
|
||||
cmd := exec.Command("apk", "list", "-I")
|
||||
|
||||
stdout, err := cmd.StdoutPipe()
|
||||
if err != nil {
|
||||
|
@ -104,15 +104,8 @@ func (a *APT) UpgradeAll(opts *Opts) error {
|
||||
}
|
||||
|
||||
func (a *APT) ListInstalled(opts *Opts) (map[string]string, error) {
|
||||
opts = ensureOpts(opts)
|
||||
out := map[string]string{}
|
||||
|
||||
var cmd *exec.Cmd
|
||||
if opts.AsRoot {
|
||||
cmd = exec.Command(getRootCmd(a.rootCmd), "dpkg-query", "-f", "${Package}\u200b${Version}\\n", "-W")
|
||||
} else {
|
||||
cmd = exec.Command("dpkg-query", "-f", "${Package}\u200b${Version}\\n", "-W")
|
||||
}
|
||||
cmd := exec.Command("dpkg-query", "-f", "${Package}\u200b${Version}\\n", "-W")
|
||||
|
||||
stdout, err := cmd.StdoutPipe()
|
||||
if err != nil {
|
||||
|
@ -111,15 +111,8 @@ func (d *DNF) UpgradeAll(opts *Opts) error {
|
||||
}
|
||||
|
||||
func (d *DNF) ListInstalled(opts *Opts) (map[string]string, error) {
|
||||
opts = ensureOpts(opts)
|
||||
out := map[string]string{}
|
||||
|
||||
var cmd *exec.Cmd
|
||||
if opts.AsRoot {
|
||||
cmd = exec.Command(getRootCmd(d.rootCmd), "rpm", "-qa", "--queryformat", "%{NAME}\u200b%|EPOCH?{%{EPOCH}:}:{}|%{VERSION}-%{RELEASE}\\n")
|
||||
} else {
|
||||
cmd = exec.Command("rpm", "-qa", "--queryformat", "%{NAME}\u200b%|EPOCH?{%{EPOCH}:}:{}|%{VERSION}-%{RELEASE}\\n")
|
||||
}
|
||||
cmd := exec.Command("rpm", "-qa", "--queryformat", "%{NAME}\u200b%|EPOCH?{%{EPOCH}:}:{}|%{VERSION}-%{RELEASE}\\n")
|
||||
|
||||
stdout, err := cmd.StdoutPipe()
|
||||
if err != nil {
|
||||
|
@ -111,15 +111,8 @@ func (p *Pacman) UpgradeAll(opts *Opts) error {
|
||||
}
|
||||
|
||||
func (p *Pacman) ListInstalled(opts *Opts) (map[string]string, error) {
|
||||
opts = ensureOpts(opts)
|
||||
out := map[string]string{}
|
||||
|
||||
var cmd *exec.Cmd
|
||||
if opts.AsRoot {
|
||||
cmd = exec.Command(getRootCmd(p.rootCmd), "pacman", "-Q")
|
||||
} else {
|
||||
cmd = exec.Command("pacman", "-Q")
|
||||
}
|
||||
cmd := exec.Command("pacman", "-Q")
|
||||
|
||||
stdout, err := cmd.StdoutPipe()
|
||||
if err != nil {
|
||||
|
@ -111,15 +111,8 @@ func (y *YUM) UpgradeAll(opts *Opts) error {
|
||||
}
|
||||
|
||||
func (y *YUM) ListInstalled(opts *Opts) (map[string]string, error) {
|
||||
opts = ensureOpts(opts)
|
||||
out := map[string]string{}
|
||||
|
||||
var cmd *exec.Cmd
|
||||
if opts.AsRoot {
|
||||
cmd = exec.Command(getRootCmd(y.rootCmd), "rpm", "-qa", "--queryformat", "%{NAME}\u200b%|EPOCH?{%{EPOCH}:}:{}|%{VERSION}-%{RELEASE}\\n")
|
||||
} else {
|
||||
cmd = exec.Command("rpm", "-qa", "--queryformat", "%{NAME}\u200b%|EPOCH?{%{EPOCH}:}:{}|%{VERSION}-%{RELEASE}\\n")
|
||||
}
|
||||
cmd := exec.Command("rpm", "-qa", "--queryformat", "%{NAME}\u200b%|EPOCH?{%{EPOCH}:}:{}|%{VERSION}-%{RELEASE}\\n")
|
||||
|
||||
stdout, err := cmd.StdoutPipe()
|
||||
if err != nil {
|
||||
|
@ -111,15 +111,8 @@ func (z *Zypper) UpgradeAll(opts *Opts) error {
|
||||
}
|
||||
|
||||
func (z *Zypper) ListInstalled(opts *Opts) (map[string]string, error) {
|
||||
opts = ensureOpts(opts)
|
||||
out := map[string]string{}
|
||||
|
||||
var cmd *exec.Cmd
|
||||
if opts.AsRoot {
|
||||
cmd = exec.Command(getRootCmd(z.rootCmd), "rpm", "-qa", "--queryformat", "%{NAME}\u200b%|EPOCH?{%{EPOCH}:}:{}|%{VERSION}-%{RELEASE}\\n")
|
||||
} else {
|
||||
cmd = exec.Command("rpm", "-qa", "--queryformat", "%{NAME}\u200b%|EPOCH?{%{EPOCH}:}:{}|%{VERSION}-%{RELEASE}\\n")
|
||||
}
|
||||
cmd := exec.Command("rpm", "-qa", "--queryformat", "%{NAME}\u200b%|EPOCH?{%{EPOCH}:}:{}|%{VERSION}-%{RELEASE}\\n")
|
||||
|
||||
stdout, err := cmd.StdoutPipe()
|
||||
if err != nil {
|
||||
|
@ -94,6 +94,10 @@ value = 'Executing version()'
|
||||
id = 436644691
|
||||
value = 'Executing build()'
|
||||
|
||||
[[translation]]
|
||||
id = 1393316459
|
||||
value = 'This package is already installed'
|
||||
|
||||
[[translation]]
|
||||
id = 1579384326
|
||||
value = 'name'
|
||||
|
@ -90,6 +90,10 @@ value = 'Функция package() необходима'
|
||||
id = 4006393493
|
||||
value = 'Массив checksums должен быть той же длины, что и sources'
|
||||
|
||||
[[translation]]
|
||||
id = 1393316459
|
||||
value = 'Этот пакет уже установлен'
|
||||
|
||||
[[translation]]
|
||||
id = 1579384326
|
||||
value = 'название'
|
||||
|
Loading…
Reference in New Issue
Block a user