mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-29 04:16:07 +00:00
Showing download sources argument in mirror show and mirror list.
This commit is contained in:
@@ -138,6 +138,11 @@ func aptlyMirrorShow(cmd *commander.Command, args []string) error {
|
|||||||
fmt.Printf("Distribution: %s\n", repo.Distribution)
|
fmt.Printf("Distribution: %s\n", repo.Distribution)
|
||||||
fmt.Printf("Components: %s\n", strings.Join(repo.Components, ", "))
|
fmt.Printf("Components: %s\n", strings.Join(repo.Components, ", "))
|
||||||
fmt.Printf("Architectures: %s\n", strings.Join(repo.Architectures, ", "))
|
fmt.Printf("Architectures: %s\n", strings.Join(repo.Architectures, ", "))
|
||||||
|
downloadSources := "no"
|
||||||
|
if repo.DownloadSources {
|
||||||
|
downloadSources = "yes"
|
||||||
|
}
|
||||||
|
fmt.Printf("Download Sources: %s\n", downloadSources)
|
||||||
if repo.LastDownloadDate.IsZero() {
|
if repo.LastDownloadDate.IsZero() {
|
||||||
fmt.Printf("Last update: never\n")
|
fmt.Printf("Last update: never\n")
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Vendored
+9
-1
@@ -86,7 +86,15 @@ func (repo *RemoteRepo) prepare() error {
|
|||||||
|
|
||||||
// String interface
|
// String interface
|
||||||
func (repo *RemoteRepo) String() string {
|
func (repo *RemoteRepo) String() string {
|
||||||
return fmt.Sprintf("[%s]: %s %s", repo.Name, repo.ArchiveRoot, repo.Distribution)
|
srcFlag := ""
|
||||||
|
if repo.DownloadSources {
|
||||||
|
srcFlag = " [src]"
|
||||||
|
}
|
||||||
|
distribution := repo.Distribution
|
||||||
|
if distribution == "" {
|
||||||
|
distribution = "./"
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("[%s]: %s %s%s", repo.Name, repo.ArchiveRoot, distribution, srcFlag)
|
||||||
}
|
}
|
||||||
|
|
||||||
// IsFlat determines if repository is flat
|
// IsFlat determines if repository is flat
|
||||||
|
|||||||
Vendored
+10
@@ -103,6 +103,16 @@ func (s *RemoteRepoSuite) TestFlatCreation(c *C) {
|
|||||||
c.Check(err, ErrorMatches, "components aren't supported for flat repos")
|
c.Check(err, ErrorMatches, "components aren't supported for flat repos")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *RemoteRepoSuite) TestString(c *C) {
|
||||||
|
c.Check(s.repo.String(), Equals, "[yandex]: http://mirror.yandex.ru/debian/ squeeze")
|
||||||
|
c.Check(s.flat.String(), Equals, "[exp42]: http://repos.express42.com/virool/precise/ ./")
|
||||||
|
|
||||||
|
s.repo.DownloadSources = true
|
||||||
|
s.flat.DownloadSources = true
|
||||||
|
c.Check(s.repo.String(), Equals, "[yandex]: http://mirror.yandex.ru/debian/ squeeze [src]")
|
||||||
|
c.Check(s.flat.String(), Equals, "[exp42]: http://repos.express42.com/virool/precise/ ./ [src]")
|
||||||
|
}
|
||||||
|
|
||||||
func (s *RemoteRepoSuite) TestNumPackages(c *C) {
|
func (s *RemoteRepoSuite) TestNumPackages(c *C) {
|
||||||
c.Check(s.repo.NumPackages(), Equals, 0)
|
c.Check(s.repo.NumPackages(), Equals, 0)
|
||||||
s.repo.packageRefs = s.reflist
|
s.repo.packageRefs = s.reflist
|
||||||
|
|||||||
Reference in New Issue
Block a user