Fix rebase

This commit is contained in:
Lorenzo Bolla
2021-11-02 10:49:13 +01:00
parent 8c94973cf9
commit fb8b05e7fd
8 changed files with 23 additions and 23 deletions

View File

@@ -68,9 +68,9 @@ func aptlyMirrorListTxt(cmd *commander.Command, args []string) error {
func aptlyMirrorListJson(cmd *commander.Command, args []string) error {
var err error
repos := make([]*deb.RemoteRepo, context.CollectionFactory().RemoteRepoCollection().Len())
repos := make([]*deb.RemoteRepo, context.NewCollectionFactory().RemoteRepoCollection().Len())
i := 0
context.CollectionFactory().RemoteRepoCollection().ForEach(func(repo *deb.RemoteRepo) error {
context.NewCollectionFactory().RemoteRepoCollection().ForEach(func(repo *deb.RemoteRepo) error {
repos[i] = repo
i++
return nil

View File

@@ -98,12 +98,12 @@ func aptlyMirrorShowJson(cmd *commander.Command, args []string) error {
name := args[0]
repo, err := context.CollectionFactory().RemoteRepoCollection().ByName(name)
repo, err := context.NewCollectionFactory().RemoteRepoCollection().ByName(name)
if err != nil {
return fmt.Errorf("unable to show: %s", err)
}
err = context.CollectionFactory().RemoteRepoCollection().LoadComplete(repo)
err = context.NewCollectionFactory().RemoteRepoCollection().LoadComplete(repo)
if err != nil {
return fmt.Errorf("unable to show: %s", err)
}
@@ -113,7 +113,7 @@ func aptlyMirrorShowJson(cmd *commander.Command, args []string) error {
if withPackages {
if repo.RefList() != nil {
var list *deb.PackageList
list, err = deb.NewPackageListFromRefList(repo.RefList(), context.CollectionFactory().PackageCollection(), context.Progress())
list, err = deb.NewPackageListFromRefList(repo.RefList(), context.NewCollectionFactory().PackageCollection(), context.Progress())
list.PrepareIndex()
list.ForEachIndexed(func(p *deb.Package) error {

View File

@@ -77,10 +77,10 @@ func aptlyPublishListTxt(cmd *commander.Command, args []string) error {
func aptlyPublishListJson(cmd *commander.Command, args []string) error {
var err error
repos := make([]*deb.PublishedRepo, 0, context.CollectionFactory().PublishedRepoCollection().Len())
repos := make([]*deb.PublishedRepo, 0, context.NewCollectionFactory().PublishedRepoCollection().Len())
err = context.CollectionFactory().PublishedRepoCollection().ForEach(func(repo *deb.PublishedRepo) error {
e := context.CollectionFactory().PublishedRepoCollection().LoadComplete(repo, context.CollectionFactory())
err = context.NewCollectionFactory().PublishedRepoCollection().ForEach(func(repo *deb.PublishedRepo) error {
e := context.NewCollectionFactory().PublishedRepoCollection().LoadComplete(repo, context.NewCollectionFactory())
if e != nil {
return e
}

View File

@@ -88,12 +88,12 @@ func aptlyPublishShowJson(cmd *commander.Command, args []string) error {
storage, prefix := deb.ParsePrefix(param)
repo, err := context.CollectionFactory().PublishedRepoCollection().ByStoragePrefixDistribution(storage, prefix, distribution)
repo, err := context.NewCollectionFactory().PublishedRepoCollection().ByStoragePrefixDistribution(storage, prefix, distribution)
if err != nil {
return fmt.Errorf("unable to show: %s", err)
}
err = context.CollectionFactory().PublishedRepoCollection().LoadComplete(repo, context.CollectionFactory())
err = context.NewCollectionFactory().PublishedRepoCollection().LoadComplete(repo, context.NewCollectionFactory())
if err != nil {
return err
}

View File

@@ -74,10 +74,10 @@ func aptlyRepoListTxt(cmd *commander.Command, args []string) error {
func aptlyRepoListJson(cmd *commander.Command, args []string) error {
var err error
repos := make([]*deb.LocalRepo, context.CollectionFactory().LocalRepoCollection().Len())
repos := make([]*deb.LocalRepo, context.NewCollectionFactory().LocalRepoCollection().Len())
i := 0
context.CollectionFactory().LocalRepoCollection().ForEach(func(repo *deb.LocalRepo) error {
e := context.CollectionFactory().LocalRepoCollection().LoadComplete(repo)
context.NewCollectionFactory().LocalRepoCollection().ForEach(func(repo *deb.LocalRepo) error {
e := context.NewCollectionFactory().LocalRepoCollection().LoadComplete(repo)
if e != nil {
return e
}

View File

@@ -63,12 +63,12 @@ func aptlyRepoShowJson(cmd *commander.Command, args []string) error {
name := args[0]
repo, err := context.CollectionFactory().LocalRepoCollection().ByName(name)
repo, err := context.NewCollectionFactory().LocalRepoCollection().ByName(name)
if err != nil {
return fmt.Errorf("unable to show: %s", err)
}
err = context.CollectionFactory().LocalRepoCollection().LoadComplete(repo)
err = context.NewCollectionFactory().LocalRepoCollection().LoadComplete(repo)
if err != nil {
return fmt.Errorf("unable to show: %s", err)
}
@@ -79,7 +79,7 @@ func aptlyRepoShowJson(cmd *commander.Command, args []string) error {
if withPackages {
if repo.RefList() != nil {
var list *deb.PackageList
list, err = deb.NewPackageListFromRefList(repo.RefList(), context.CollectionFactory().PackageCollection(), context.Progress())
list, err = deb.NewPackageListFromRefList(repo.RefList(), context.NewCollectionFactory().PackageCollection(), context.Progress())
if err == nil {
packageList = list.FullNames()
}

View File

@@ -64,7 +64,7 @@ func aptlySnapshotListJson(cmd *commander.Command, args []string) error {
sortMethodString := cmd.Flag.Lookup("sort").Value.Get().(string)
collection := context.CollectionFactory().SnapshotCollection()
collection := context.NewCollectionFactory().SnapshotCollection()
jsonSnapshots := make([]*deb.Snapshot, collection.Len())
i := 0

View File

@@ -90,12 +90,12 @@ func aptlySnapshotShowJson(cmd *commander.Command, args []string) error {
name := args[0]
snapshot, err := context.CollectionFactory().SnapshotCollection().ByName(name)
snapshot, err := context.NewCollectionFactory().SnapshotCollection().ByName(name)
if err != nil {
return fmt.Errorf("unable to show: %s", err)
}
err = context.CollectionFactory().SnapshotCollection().LoadComplete(snapshot)
err = context.NewCollectionFactory().SnapshotCollection().LoadComplete(snapshot)
if err != nil {
return fmt.Errorf("unable to show: %s", err)
}
@@ -105,21 +105,21 @@ func aptlySnapshotShowJson(cmd *commander.Command, args []string) error {
for _, sourceID := range snapshot.SourceIDs {
if snapshot.SourceKind == deb.SourceSnapshot {
var source *deb.Snapshot
source, err = context.CollectionFactory().SnapshotCollection().ByUUID(sourceID)
source, err = context.NewCollectionFactory().SnapshotCollection().ByUUID(sourceID)
if err != nil {
continue
}
snapshot.Snapshots = append(snapshot.Snapshots, source)
} else if snapshot.SourceKind == deb.SourceLocalRepo {
var source *deb.LocalRepo
source, err = context.CollectionFactory().LocalRepoCollection().ByUUID(sourceID)
source, err = context.NewCollectionFactory().LocalRepoCollection().ByUUID(sourceID)
if err != nil {
continue
}
snapshot.LocalRepos = append(snapshot.LocalRepos, source)
} else if snapshot.SourceKind == deb.SourceRemoteRepo {
var source *deb.RemoteRepo
source, err = context.CollectionFactory().RemoteRepoCollection().ByUUID(sourceID)
source, err = context.NewCollectionFactory().RemoteRepoCollection().ByUUID(sourceID)
if err != nil {
continue
}
@@ -133,7 +133,7 @@ func aptlySnapshotShowJson(cmd *commander.Command, args []string) error {
if withPackages {
if snapshot.RefList() != nil {
var list *deb.PackageList
list, err = deb.NewPackageListFromRefList(snapshot.RefList(), context.CollectionFactory().PackageCollection(), context.Progress())
list, err = deb.NewPackageListFromRefList(snapshot.RefList(), context.NewCollectionFactory().PackageCollection(), context.Progress())
list.PrepareIndex()
list.ForEachIndexed(func(p *deb.Package) error {