mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-31 04:30:44 +00:00
Sort paths when generating checksums for Release/InRelease
This commit is contained in:
+15
-6
@@ -5,11 +5,6 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/smira/aptly/aptly"
|
|
||||||
"github.com/smira/aptly/database"
|
|
||||||
"github.com/smira/aptly/utils"
|
|
||||||
"github.com/smira/go-uuid/uuid"
|
|
||||||
"github.com/ugorji/go/codec"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
@@ -18,6 +13,13 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/smira/go-uuid/uuid"
|
||||||
|
"github.com/ugorji/go/codec"
|
||||||
|
|
||||||
|
"github.com/smira/aptly/aptly"
|
||||||
|
"github.com/smira/aptly/database"
|
||||||
|
"github.com/smira/aptly/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type repoSourceItem struct {
|
type repoSourceItem struct {
|
||||||
@@ -677,7 +679,14 @@ func (p *PublishedRepo) Publish(packagePool aptly.PackagePool, publishedStorageP
|
|||||||
|
|
||||||
release["Components"] = strings.Join(p.Components(), " ")
|
release["Components"] = strings.Join(p.Components(), " ")
|
||||||
|
|
||||||
for path, info := range indexes.generatedFiles {
|
sortedPaths := make([]string, 0, len(indexes.generatedFiles))
|
||||||
|
for path := range indexes.generatedFiles {
|
||||||
|
sortedPaths = append(sortedPaths, path)
|
||||||
|
}
|
||||||
|
sort.Strings(sortedPaths)
|
||||||
|
|
||||||
|
for _, path := range sortedPaths {
|
||||||
|
info := indexes.generatedFiles[path]
|
||||||
release["MD5Sum"] += fmt.Sprintf(" %s %8d %s\n", info.MD5, info.Size, path)
|
release["MD5Sum"] += fmt.Sprintf(" %s %8d %s\n", info.MD5, info.Size, path)
|
||||||
release["SHA1"] += fmt.Sprintf(" %s %8d %s\n", info.SHA1, info.Size, path)
|
release["SHA1"] += fmt.Sprintf(" %s %8d %s\n", info.SHA1, info.Size, path)
|
||||||
release["SHA256"] += fmt.Sprintf(" %s %8d %s\n", info.SHA256, info.Size, path)
|
release["SHA256"] += fmt.Sprintf(" %s %8d %s\n", info.SHA256, info.Size, path)
|
||||||
|
|||||||
Reference in New Issue
Block a user