Persisting meta information about release.

This commit is contained in:
Andrey Smirnov
2013-12-19 18:18:09 +04:00
parent 08f045d503
commit f7f4ba1691
2 changed files with 21 additions and 1 deletions
+13
View File
@@ -21,6 +21,8 @@ func aptlyMirrorList(cmd *commander.Command, args []string) {
repoCollection.ForEach(func(repo *debian.RemoteRepo) {
fmt.Printf(" * %s\n", repo)
})
fmt.Printf("\nTo get more information about repository, run `aptly mirror show <name>`.\n")
}
func aptlyMirrorCreate(cmd *commander.Command, args []string) {
@@ -74,6 +76,11 @@ func aptlyMirrorShow(cmd *commander.Command, args []string) {
fmt.Printf("Distribution: %s\n", repo.Distribution)
fmt.Printf("Components: %s\n", strings.Join(repo.Components, ", "))
fmt.Printf("Architectures: %s\n", strings.Join(repo.Architectures, ", "))
fmt.Printf("\nInformation from release file:\n")
for name, value := range repo.Meta {
fmt.Printf("%s: %s\n", name, value)
}
}
func aptlyMirrorUpdate(cmd *commander.Command, args []string) {
@@ -99,6 +106,12 @@ func aptlyMirrorUpdate(cmd *commander.Command, args []string) {
if err != nil {
log.Fatalf("Unable to update: %s", err)
}
err = repoCollection.Update(repo)
if err != nil {
log.Fatalf("Unable to update: %s", err)
}
}
func makeCmdMirrorCreate() *commander.Command {
+8 -1
View File
@@ -30,7 +30,9 @@ type RemoteRepo struct {
// List of components to fetch, if empty, then fetch all components
Components []string
// List of architectures to fetch, if empty, then fetch all architectures
Architectures []string
Architectures []string
// Meta-information about repository
Meta debc.Paragraph
archiveRootURL *url.URL
}
@@ -126,6 +128,11 @@ func (repo *RemoteRepo) Fetch(d utils.Downloader) error {
}
}
delete(para, "MD5Sum")
delete(para, "SHA1")
delete(para, "SHA256")
repo.Meta = para
return nil
}