Show progress when loading packages from reflist.

This commit is contained in:
Andrey Smirnov
2014-03-07 00:04:35 +04:00
parent 81dd5a398b
commit 6f86bfec72
8 changed files with 27 additions and 13 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ func aptlyRepoAdd(cmd *commander.Command, args []string) error {
context.progress.Printf("Loading packages...\n")
packageCollection := debian.NewPackageCollection(context.database)
list, err := debian.NewPackageListFromRefList(repo.RefList(), packageCollection)
list, err := debian.NewPackageListFromRefList(repo.RefList(), packageCollection, context.progress)
if err != nil {
return fmt.Errorf("unable to load packages: %s", err)
}
+2 -2
View File
@@ -75,12 +75,12 @@ func aptlyRepoMoveCopyImport(cmd *commander.Command, args []string) error {
context.progress.Printf("Loading packages...\n")
packageCollection := debian.NewPackageCollection(context.database)
dstList, err := debian.NewPackageListFromRefList(dstRepo.RefList(), packageCollection)
dstList, err := debian.NewPackageListFromRefList(dstRepo.RefList(), packageCollection, context.progress)
if err != nil {
return fmt.Errorf("unable to load packages: %s", err)
}
srcList, err := debian.NewPackageListFromRefList(srcRefList, packageCollection)
srcList, err := debian.NewPackageListFromRefList(srcRefList, packageCollection, context.progress)
if err != nil {
return fmt.Errorf("unable to load packages: %s", err)
}
+1 -1
View File
@@ -30,7 +30,7 @@ func aptlyRepoRemove(cmd *commander.Command, args []string) error {
context.progress.Printf("Loading packages...\n")
packageCollection := debian.NewPackageCollection(context.database)
list, err := debian.NewPackageListFromRefList(repo.RefList(), packageCollection)
list, err := debian.NewPackageListFromRefList(repo.RefList(), packageCollection, context.progress)
if err != nil {
return fmt.Errorf("unable to load packages: %s", err)
}
+2 -2
View File
@@ -49,12 +49,12 @@ func aptlySnapshotPull(cmd *commander.Command, args []string) error {
// Convert snapshot to package list
context.progress.Printf("Loading packages (%d)...\n", snapshot.RefList().Len()+source.RefList().Len())
packageList, err := debian.NewPackageListFromRefList(snapshot.RefList(), packageCollection)
packageList, err := debian.NewPackageListFromRefList(snapshot.RefList(), packageCollection, context.progress)
if err != nil {
return fmt.Errorf("unable to load packages: %s", err)
}
sourcePackageList, err := debian.NewPackageListFromRefList(source.RefList(), packageCollection)
sourcePackageList, err := debian.NewPackageListFromRefList(source.RefList(), packageCollection, context.progress)
if err != nil {
return fmt.Errorf("unable to load packages: %s", err)
}
+4 -2
View File
@@ -31,7 +31,9 @@ func aptlySnapshotVerify(cmd *commander.Command, args []string) error {
}
}
packageList, err := debian.NewPackageListFromRefList(snapshots[0].RefList(), packageCollection)
context.progress.Printf("Loading packages...\n")
packageList, err := debian.NewPackageListFromRefList(snapshots[0].RefList(), packageCollection, context.progress)
if err != nil {
fmt.Errorf("unable to load packages: %s", err)
}
@@ -43,7 +45,7 @@ func aptlySnapshotVerify(cmd *commander.Command, args []string) error {
}
for i := 1; i < len(snapshots); i++ {
pL, err := debian.NewPackageListFromRefList(snapshots[i].RefList(), packageCollection)
pL, err := debian.NewPackageListFromRefList(snapshots[i].RefList(), packageCollection, context.progress)
if err != nil {
fmt.Errorf("unable to load packages: %s", err)
}