diff --git a/pkg/alrsh/package_gen.go b/pkg/alrsh/package_gen.go index 834deb8..0fca143 100644 --- a/pkg/alrsh/package_gen.go +++ b/pkg/alrsh/package_gen.go @@ -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 . - // DO NOT EDIT MANUALLY. This file is generated. package alrsh diff --git a/upgrade.go b/upgrade.go index c242479..842c7b7 100644 --- a/upgrade.go +++ b/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 {