mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-04 05:10:40 +00:00
Sort files before import, really stop importing on file problem.
This commit is contained in:
+7
-1
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user