mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-07 22:20:24 +00:00
Fix rebase
This commit is contained in:
+2
-2
@@ -68,9 +68,9 @@ func aptlyMirrorListTxt(cmd *commander.Command, args []string) error {
|
|||||||
func aptlyMirrorListJson(cmd *commander.Command, args []string) error {
|
func aptlyMirrorListJson(cmd *commander.Command, args []string) error {
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
repos := make([]*deb.RemoteRepo, context.CollectionFactory().RemoteRepoCollection().Len())
|
repos := make([]*deb.RemoteRepo, context.NewCollectionFactory().RemoteRepoCollection().Len())
|
||||||
i := 0
|
i := 0
|
||||||
context.CollectionFactory().RemoteRepoCollection().ForEach(func(repo *deb.RemoteRepo) error {
|
context.NewCollectionFactory().RemoteRepoCollection().ForEach(func(repo *deb.RemoteRepo) error {
|
||||||
repos[i] = repo
|
repos[i] = repo
|
||||||
i++
|
i++
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
+3
-3
@@ -98,12 +98,12 @@ func aptlyMirrorShowJson(cmd *commander.Command, args []string) error {
|
|||||||
|
|
||||||
name := args[0]
|
name := args[0]
|
||||||
|
|
||||||
repo, err := context.CollectionFactory().RemoteRepoCollection().ByName(name)
|
repo, err := context.NewCollectionFactory().RemoteRepoCollection().ByName(name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to show: %s", err)
|
return fmt.Errorf("unable to show: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = context.CollectionFactory().RemoteRepoCollection().LoadComplete(repo)
|
err = context.NewCollectionFactory().RemoteRepoCollection().LoadComplete(repo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to show: %s", err)
|
return fmt.Errorf("unable to show: %s", err)
|
||||||
}
|
}
|
||||||
@@ -113,7 +113,7 @@ func aptlyMirrorShowJson(cmd *commander.Command, args []string) error {
|
|||||||
if withPackages {
|
if withPackages {
|
||||||
if repo.RefList() != nil {
|
if repo.RefList() != nil {
|
||||||
var list *deb.PackageList
|
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.PrepareIndex()
|
||||||
list.ForEachIndexed(func(p *deb.Package) error {
|
list.ForEachIndexed(func(p *deb.Package) error {
|
||||||
|
|||||||
+3
-3
@@ -77,10 +77,10 @@ func aptlyPublishListTxt(cmd *commander.Command, args []string) error {
|
|||||||
func aptlyPublishListJson(cmd *commander.Command, args []string) error {
|
func aptlyPublishListJson(cmd *commander.Command, args []string) error {
|
||||||
var err 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 {
|
err = context.NewCollectionFactory().PublishedRepoCollection().ForEach(func(repo *deb.PublishedRepo) error {
|
||||||
e := context.CollectionFactory().PublishedRepoCollection().LoadComplete(repo, context.CollectionFactory())
|
e := context.NewCollectionFactory().PublishedRepoCollection().LoadComplete(repo, context.NewCollectionFactory())
|
||||||
if e != nil {
|
if e != nil {
|
||||||
return e
|
return e
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -88,12 +88,12 @@ func aptlyPublishShowJson(cmd *commander.Command, args []string) error {
|
|||||||
|
|
||||||
storage, prefix := deb.ParsePrefix(param)
|
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 {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to show: %s", err)
|
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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -74,10 +74,10 @@ func aptlyRepoListTxt(cmd *commander.Command, args []string) error {
|
|||||||
func aptlyRepoListJson(cmd *commander.Command, args []string) error {
|
func aptlyRepoListJson(cmd *commander.Command, args []string) error {
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
repos := make([]*deb.LocalRepo, context.CollectionFactory().LocalRepoCollection().Len())
|
repos := make([]*deb.LocalRepo, context.NewCollectionFactory().LocalRepoCollection().Len())
|
||||||
i := 0
|
i := 0
|
||||||
context.CollectionFactory().LocalRepoCollection().ForEach(func(repo *deb.LocalRepo) error {
|
context.NewCollectionFactory().LocalRepoCollection().ForEach(func(repo *deb.LocalRepo) error {
|
||||||
e := context.CollectionFactory().LocalRepoCollection().LoadComplete(repo)
|
e := context.NewCollectionFactory().LocalRepoCollection().LoadComplete(repo)
|
||||||
if e != nil {
|
if e != nil {
|
||||||
return e
|
return e
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -63,12 +63,12 @@ func aptlyRepoShowJson(cmd *commander.Command, args []string) error {
|
|||||||
|
|
||||||
name := args[0]
|
name := args[0]
|
||||||
|
|
||||||
repo, err := context.CollectionFactory().LocalRepoCollection().ByName(name)
|
repo, err := context.NewCollectionFactory().LocalRepoCollection().ByName(name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to show: %s", err)
|
return fmt.Errorf("unable to show: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = context.CollectionFactory().LocalRepoCollection().LoadComplete(repo)
|
err = context.NewCollectionFactory().LocalRepoCollection().LoadComplete(repo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to show: %s", err)
|
return fmt.Errorf("unable to show: %s", err)
|
||||||
}
|
}
|
||||||
@@ -79,7 +79,7 @@ func aptlyRepoShowJson(cmd *commander.Command, args []string) error {
|
|||||||
if withPackages {
|
if withPackages {
|
||||||
if repo.RefList() != nil {
|
if repo.RefList() != nil {
|
||||||
var list *deb.PackageList
|
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 {
|
if err == nil {
|
||||||
packageList = list.FullNames()
|
packageList = list.FullNames()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ func aptlySnapshotListJson(cmd *commander.Command, args []string) error {
|
|||||||
|
|
||||||
sortMethodString := cmd.Flag.Lookup("sort").Value.Get().(string)
|
sortMethodString := cmd.Flag.Lookup("sort").Value.Get().(string)
|
||||||
|
|
||||||
collection := context.CollectionFactory().SnapshotCollection()
|
collection := context.NewCollectionFactory().SnapshotCollection()
|
||||||
|
|
||||||
jsonSnapshots := make([]*deb.Snapshot, collection.Len())
|
jsonSnapshots := make([]*deb.Snapshot, collection.Len())
|
||||||
i := 0
|
i := 0
|
||||||
|
|||||||
@@ -90,12 +90,12 @@ func aptlySnapshotShowJson(cmd *commander.Command, args []string) error {
|
|||||||
|
|
||||||
name := args[0]
|
name := args[0]
|
||||||
|
|
||||||
snapshot, err := context.CollectionFactory().SnapshotCollection().ByName(name)
|
snapshot, err := context.NewCollectionFactory().SnapshotCollection().ByName(name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to show: %s", err)
|
return fmt.Errorf("unable to show: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = context.CollectionFactory().SnapshotCollection().LoadComplete(snapshot)
|
err = context.NewCollectionFactory().SnapshotCollection().LoadComplete(snapshot)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to show: %s", err)
|
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 {
|
for _, sourceID := range snapshot.SourceIDs {
|
||||||
if snapshot.SourceKind == deb.SourceSnapshot {
|
if snapshot.SourceKind == deb.SourceSnapshot {
|
||||||
var source *deb.Snapshot
|
var source *deb.Snapshot
|
||||||
source, err = context.CollectionFactory().SnapshotCollection().ByUUID(sourceID)
|
source, err = context.NewCollectionFactory().SnapshotCollection().ByUUID(sourceID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
snapshot.Snapshots = append(snapshot.Snapshots, source)
|
snapshot.Snapshots = append(snapshot.Snapshots, source)
|
||||||
} else if snapshot.SourceKind == deb.SourceLocalRepo {
|
} else if snapshot.SourceKind == deb.SourceLocalRepo {
|
||||||
var source *deb.LocalRepo
|
var source *deb.LocalRepo
|
||||||
source, err = context.CollectionFactory().LocalRepoCollection().ByUUID(sourceID)
|
source, err = context.NewCollectionFactory().LocalRepoCollection().ByUUID(sourceID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
snapshot.LocalRepos = append(snapshot.LocalRepos, source)
|
snapshot.LocalRepos = append(snapshot.LocalRepos, source)
|
||||||
} else if snapshot.SourceKind == deb.SourceRemoteRepo {
|
} else if snapshot.SourceKind == deb.SourceRemoteRepo {
|
||||||
var source *deb.RemoteRepo
|
var source *deb.RemoteRepo
|
||||||
source, err = context.CollectionFactory().RemoteRepoCollection().ByUUID(sourceID)
|
source, err = context.NewCollectionFactory().RemoteRepoCollection().ByUUID(sourceID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
@@ -133,7 +133,7 @@ func aptlySnapshotShowJson(cmd *commander.Command, args []string) error {
|
|||||||
if withPackages {
|
if withPackages {
|
||||||
if snapshot.RefList() != nil {
|
if snapshot.RefList() != nil {
|
||||||
var list *deb.PackageList
|
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.PrepareIndex()
|
||||||
list.ForEachIndexed(func(p *deb.Package) error {
|
list.ForEachIndexed(func(p *deb.Package) error {
|
||||||
|
|||||||
Reference in New Issue
Block a user