Allow to add a new component to a published repo

This commit modifies the behavior of the publish switch method in the way, that also new components can be added to an already published repository. It is no longer necessary to drop and recreate the whole publish.

Signed-off-by: Christoph Fiehe <c.fiehe@eurodata.de>
This commit is contained in:
Christoph Fiehe
2024-09-20 13:58:12 +02:00
committed by André Roth
parent eaa363eb82
commit 4195ad90bc
5 changed files with 22 additions and 17 deletions

View File

@@ -5,7 +5,6 @@ import (
"strings"
"github.com/aptly-dev/aptly/deb"
"github.com/aptly-dev/aptly/utils"
"github.com/smira/commander"
"github.com/smira/flag"
)
@@ -65,10 +64,6 @@ func aptlyPublishSwitch(cmd *commander.Command, args []string) error {
}
for i, component := range components {
if !utils.StrSliceHasItem(publishedComponents, component) {
return fmt.Errorf("unable to switch: component %s is not in published repository", component)
}
snapshot, err = collectionFactory.SnapshotCollection().ByName(names[i])
if err != nil {
return fmt.Errorf("unable to switch: %s", err)