Sort files before import, really stop importing on file problem.

This commit is contained in:
Andrey Smirnov
2014-02-26 13:08:39 +04:00
parent e0cb43fbd3
commit 3ddf39ee58
+7 -1
View File
@@ -8,6 +8,7 @@ import (
"github.com/smira/aptly/utils"
"os"
"path/filepath"
"sort"
"strings"
)
@@ -75,6 +76,7 @@ func aptlyRepoAdd(cmd *commander.Command, args []string) error {
}
processedFiles := []string{}
sort.Strings(packageFiles)
for _, file := range packageFiles {
var (
@@ -128,11 +130,15 @@ func aptlyRepoAdd(cmd *commander.Command, args []string) error {
err = context.packagePool.Import(sourceFile, p.Files[i].Checksums.MD5)
if err != nil {
context.progress.ColoredPrintf("@y[!]@| @!Unable to import file %s into pool: %s@|", sourceFile, err)
continue
break
}
processedFiles = append(processedFiles, sourceFile)
}
if err != nil {
// some files haven't been imported
continue
}
err = packageCollection.Update(p)
if err != nil {