Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c2d48c1a13 |
@@ -1,19 +1,3 @@
|
||||
// ALR - Any Linux Repository
|
||||
// Copyright (C) 2025 The ALR Authors
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
// DO NOT EDIT MANUALLY. This file is generated.
|
||||
package alrsh
|
||||
|
||||
|
||||
19
upgrade.go
19
upgrade.go
@@ -114,7 +114,7 @@ func UpgradeCmd() *cli.Command {
|
||||
}
|
||||
|
||||
if len(updates) > 0 {
|
||||
err = builder.InstallALRPackages(
|
||||
_, err = builder.InstallPkgs(
|
||||
ctx,
|
||||
&build.BuildArgs{
|
||||
Opts: &types.BuildOpts{
|
||||
@@ -124,7 +124,7 @@ func UpgradeCmd() *cli.Command {
|
||||
Info: deps.Info,
|
||||
PkgFormat_: build.GetPkgFormat(deps.Manager),
|
||||
},
|
||||
mapUptatesInfoToPackages(updates),
|
||||
mapUpdatesToPackageNames(updates),
|
||||
)
|
||||
if err != nil {
|
||||
return cliutils.FormatCliExit(gotext.Get("Error checking for updates"), err)
|
||||
@@ -138,12 +138,19 @@ func UpgradeCmd() *cli.Command {
|
||||
}
|
||||
}
|
||||
|
||||
func mapUptatesInfoToPackages(updates []UpdateInfo) []alrsh.Package {
|
||||
var pkgs []alrsh.Package
|
||||
func mapUpdatesToPackageNames(updates []UpdateInfo) []string {
|
||||
seen := make(map[string]bool)
|
||||
var pkgNames []string
|
||||
|
||||
for _, info := range updates {
|
||||
pkgs = append(pkgs, *info.Package)
|
||||
fullName := fmt.Sprintf("%s+%s", info.Package.Name, info.Package.Repository)
|
||||
if !seen[fullName] {
|
||||
seen[fullName] = true
|
||||
pkgNames = append(pkgNames, fullName)
|
||||
}
|
||||
}
|
||||
return pkgs
|
||||
|
||||
return pkgNames
|
||||
}
|
||||
|
||||
type UpdateInfo struct {
|
||||
|
||||
Reference in New Issue
Block a user