mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-08 22:30:41 +00:00
Publishing source packages index.
This commit is contained in:
Vendored
+11
-3
@@ -10,6 +10,7 @@ import (
|
|||||||
"github.com/ugorji/go/codec"
|
"github.com/ugorji/go/codec"
|
||||||
"log"
|
"log"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
@@ -120,11 +121,18 @@ func (p *PublishedRepo) Publish(repo *Repository, packageCollection *PackageColl
|
|||||||
return fmt.Errorf("unable to figure out list of architectures, please supply explicit list")
|
return fmt.Errorf("unable to figure out list of architectures, please supply explicit list")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sort.Strings(p.Architectures)
|
||||||
|
|
||||||
generatedFiles := map[string]utils.ChecksumInfo{}
|
generatedFiles := map[string]utils.ChecksumInfo{}
|
||||||
|
|
||||||
// For all architectures, generate release file
|
// For all architectures, generate release file
|
||||||
for _, arch := range p.Architectures {
|
for _, arch := range p.Architectures {
|
||||||
relativePath := filepath.Join(p.Component, fmt.Sprintf("binary-%s", arch), "Packages")
|
var relativePath string
|
||||||
|
if arch == "source" {
|
||||||
|
relativePath = filepath.Join(p.Component, "source", "Sources")
|
||||||
|
} else {
|
||||||
|
relativePath = filepath.Join(p.Component, fmt.Sprintf("binary-%s", arch), "Packages")
|
||||||
|
}
|
||||||
err = repo.MkDir(filepath.Dir(filepath.Join(basePath, relativePath)))
|
err = repo.MkDir(filepath.Dir(filepath.Join(basePath, relativePath)))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -159,7 +167,7 @@ func (p *PublishedRepo) Publish(repo *Repository, packageCollection *PackageColl
|
|||||||
})
|
})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to creates process packages: %s", err)
|
return fmt.Errorf("unable to process packages: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = bufWriter.Flush()
|
err = bufWriter.Flush()
|
||||||
@@ -200,7 +208,7 @@ func (p *PublishedRepo) Publish(repo *Repository, packageCollection *PackageColl
|
|||||||
release["Codename"] = p.Distribution
|
release["Codename"] = p.Distribution
|
||||||
release["Date"] = time.Now().UTC().Format("Mon, 2 Jan 2006 15:04:05 MST")
|
release["Date"] = time.Now().UTC().Format("Mon, 2 Jan 2006 15:04:05 MST")
|
||||||
release["Components"] = p.Component
|
release["Components"] = p.Component
|
||||||
release["Architectures"] = strings.Join(p.Architectures, " ")
|
release["Architectures"] = strings.Join(utils.StrSlicesSubstract(p.Architectures, []string{"source"}), " ")
|
||||||
release["Description"] = " Generated by aptly\n"
|
release["Description"] = " Generated by aptly\n"
|
||||||
release["MD5Sum"] = "\n"
|
release["MD5Sum"] = "\n"
|
||||||
release["SHA1"] = "\n"
|
release["SHA1"] = "\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user