mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-07-16 12:08:04 +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"
|
"github.com/smira/aptly/utils"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -75,6 +76,7 @@ func aptlyRepoAdd(cmd *commander.Command, args []string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
processedFiles := []string{}
|
processedFiles := []string{}
|
||||||
|
sort.Strings(packageFiles)
|
||||||
|
|
||||||
for _, file := range packageFiles {
|
for _, file := range packageFiles {
|
||||||
var (
|
var (
|
||||||
@@ -128,11 +130,15 @@ func aptlyRepoAdd(cmd *commander.Command, args []string) error {
|
|||||||
err = context.packagePool.Import(sourceFile, p.Files[i].Checksums.MD5)
|
err = context.packagePool.Import(sourceFile, p.Files[i].Checksums.MD5)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
context.progress.ColoredPrintf("@y[!]@| @!Unable to import file %s into pool: %s@|", sourceFile, err)
|
context.progress.ColoredPrintf("@y[!]@| @!Unable to import file %s into pool: %s@|", sourceFile, err)
|
||||||
continue
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
processedFiles = append(processedFiles, sourceFile)
|
processedFiles = append(processedFiles, sourceFile)
|
||||||
}
|
}
|
||||||
|
if err != nil {
|
||||||
|
// some files haven't been imported
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
err = packageCollection.Update(p)
|
err = packageCollection.Update(p)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user