Fixups after renaming debian -> deb. #21

This commit is contained in:
Andrey Smirnov
2014-04-07 21:19:38 +04:00
parent fd662c9275
commit ff045f9a48
50 changed files with 123 additions and 123 deletions

View File

@@ -1,6 +1,6 @@
GOVERSION=$(shell go version | awk '{print $$3;}')
PACKAGES=database debian files http utils
ALL_PACKAGES=aptly cmd console database debian files http utils
PACKAGES=database deb files http utils
ALL_PACKAGES=aptly cmd console database deb files http utils
BINPATH=$(abspath ./_vendor/bin)
GOM_ENVIRONMENT=-test
PYTHON?=python

View File

@@ -4,7 +4,7 @@ package cmd
import (
"fmt"
"github.com/smira/aptly/aptly"
"github.com/smira/aptly/debian"
"github.com/smira/aptly/deb"
"github.com/smira/commander"
"github.com/smira/flag"
"os"
@@ -12,7 +12,7 @@ import (
)
// ListPackagesRefList shows list of packages in PackageRefList
func ListPackagesRefList(reflist *debian.PackageRefList) (err error) {
func ListPackagesRefList(reflist *deb.PackageRefList) (err error) {
fmt.Printf("Packages:\n")
if reflist == nil {

View File

@@ -5,7 +5,7 @@ import (
"github.com/smira/aptly/aptly"
"github.com/smira/aptly/console"
"github.com/smira/aptly/database"
"github.com/smira/aptly/debian"
"github.com/smira/aptly/deb"
"github.com/smira/aptly/files"
"github.com/smira/aptly/http"
"github.com/smira/aptly/utils"
@@ -28,7 +28,7 @@ type AptlyContext struct {
database database.Storage
packagePool aptly.PackagePool
publishedStorage aptly.PublishedStorage
collectionFactory *debian.CollectionFactory
collectionFactory *deb.CollectionFactory
dependencyOptions int
architecturesList []string
// Debug features
@@ -91,16 +91,16 @@ func (context *AptlyContext) DependencyOptions() int {
if context.dependencyOptions == -1 {
context.dependencyOptions = 0
if context.Config().DepFollowSuggests || context.flags.Lookup("dep-follow-suggests").Value.Get().(bool) {
context.dependencyOptions |= debian.DepFollowSuggests
context.dependencyOptions |= deb.DepFollowSuggests
}
if context.Config().DepFollowRecommends || context.flags.Lookup("dep-follow-recommends").Value.Get().(bool) {
context.dependencyOptions |= debian.DepFollowRecommends
context.dependencyOptions |= deb.DepFollowRecommends
}
if context.Config().DepFollowAllVariants || context.flags.Lookup("dep-follow-all-variants").Value.Get().(bool) {
context.dependencyOptions |= debian.DepFollowAllVariants
context.dependencyOptions |= deb.DepFollowAllVariants
}
if context.Config().DepFollowSource || context.flags.Lookup("dep-follow-source").Value.Get().(bool) {
context.dependencyOptions |= debian.DepFollowSource
context.dependencyOptions |= deb.DepFollowSource
}
}
@@ -153,13 +153,13 @@ func (context *AptlyContext) Database() (database.Storage, error) {
return context.database, nil
}
func (context *AptlyContext) CollectionFactory() *debian.CollectionFactory {
func (context *AptlyContext) CollectionFactory() *deb.CollectionFactory {
if context.collectionFactory == nil {
db, err := context.Database()
if err != nil {
Fatal(err)
}
context.collectionFactory = debian.NewCollectionFactory(db)
context.collectionFactory = deb.NewCollectionFactory(db)
}
return context.collectionFactory

View File

@@ -2,7 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/aptly/debian"
"github.com/smira/aptly/deb"
"github.com/smira/aptly/utils"
"github.com/smira/commander"
"sort"
@@ -18,10 +18,10 @@ func aptlyDbCleanup(cmd *commander.Command, args []string) error {
}
// collect information about references packages...
existingPackageRefs := debian.NewPackageRefList()
existingPackageRefs := deb.NewPackageRefList()
context.Progress().Printf("Loading mirrors, local repos and snapshots...\n")
err = context.CollectionFactory().RemoteRepoCollection().ForEach(func(repo *debian.RemoteRepo) error {
err = context.CollectionFactory().RemoteRepoCollection().ForEach(func(repo *deb.RemoteRepo) error {
err := context.CollectionFactory().RemoteRepoCollection().LoadComplete(repo)
if err != nil {
return err
@@ -35,7 +35,7 @@ func aptlyDbCleanup(cmd *commander.Command, args []string) error {
return err
}
err = context.CollectionFactory().LocalRepoCollection().ForEach(func(repo *debian.LocalRepo) error {
err = context.CollectionFactory().LocalRepoCollection().ForEach(func(repo *deb.LocalRepo) error {
err := context.CollectionFactory().LocalRepoCollection().LoadComplete(repo)
if err != nil {
return err
@@ -49,7 +49,7 @@ func aptlyDbCleanup(cmd *commander.Command, args []string) error {
return err
}
err = context.CollectionFactory().SnapshotCollection().ForEach(func(snapshot *debian.Snapshot) error {
err = context.CollectionFactory().SnapshotCollection().ForEach(func(snapshot *deb.Snapshot) error {
err := context.CollectionFactory().SnapshotCollection().LoadComplete(snapshot)
if err != nil {
return err

View File

@@ -4,7 +4,7 @@ import (
"bytes"
"code.google.com/p/gographviz"
"fmt"
"github.com/smira/aptly/debian"
"github.com/smira/aptly/deb"
"github.com/smira/commander"
"io"
"io/ioutil"
@@ -28,7 +28,7 @@ func aptlyGraph(cmd *commander.Command, args []string) error {
fmt.Printf("Loading mirrors...\n")
err = context.CollectionFactory().RemoteRepoCollection().ForEach(func(repo *debian.RemoteRepo) error {
err = context.CollectionFactory().RemoteRepoCollection().ForEach(func(repo *deb.RemoteRepo) error {
err := context.CollectionFactory().RemoteRepoCollection().LoadComplete(repo)
if err != nil {
return err
@@ -52,7 +52,7 @@ func aptlyGraph(cmd *commander.Command, args []string) error {
fmt.Printf("Loading local repos...\n")
err = context.CollectionFactory().LocalRepoCollection().ForEach(func(repo *debian.LocalRepo) error {
err = context.CollectionFactory().LocalRepoCollection().ForEach(func(repo *deb.LocalRepo) error {
err := context.CollectionFactory().LocalRepoCollection().LoadComplete(repo)
if err != nil {
return err
@@ -75,12 +75,12 @@ func aptlyGraph(cmd *commander.Command, args []string) error {
fmt.Printf("Loading snapshots...\n")
context.CollectionFactory().SnapshotCollection().ForEach(func(snapshot *debian.Snapshot) error {
context.CollectionFactory().SnapshotCollection().ForEach(func(snapshot *deb.Snapshot) error {
existingNodes[snapshot.UUID] = true
return nil
})
err = context.CollectionFactory().SnapshotCollection().ForEach(func(snapshot *debian.Snapshot) error {
err = context.CollectionFactory().SnapshotCollection().ForEach(func(snapshot *deb.Snapshot) error {
err := context.CollectionFactory().SnapshotCollection().LoadComplete(snapshot)
if err != nil {
return err
@@ -115,7 +115,7 @@ func aptlyGraph(cmd *commander.Command, args []string) error {
fmt.Printf("Loading published repos...\n")
context.CollectionFactory().PublishedRepoCollection().ForEach(func(repo *debian.PublishedRepo) error {
context.CollectionFactory().PublishedRepoCollection().ForEach(func(repo *deb.PublishedRepo) error {
graph.AddNode("aptly", graphvizEscape(repo.UUID), map[string]string{
"shape": "Mrecord",
"style": "filled",

View File

@@ -2,7 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/aptly/debian"
"github.com/smira/aptly/deb"
"github.com/smira/commander"
"github.com/smira/flag"
"strings"
@@ -24,7 +24,7 @@ func aptlyMirrorCreate(cmd *commander.Command, args []string) error {
mirrorName = args[0]
if len(args) == 2 {
archiveURL, distribution, components, err = debian.ParsePPA(args[1], context.Config())
archiveURL, distribution, components, err = deb.ParsePPA(args[1], context.Config())
if err != nil {
return err
}
@@ -32,7 +32,7 @@ func aptlyMirrorCreate(cmd *commander.Command, args []string) error {
archiveURL, distribution, components = args[1], args[2], args[3:]
}
repo, err := debian.NewRemoteRepo(mirrorName, archiveURL, distribution, components, context.ArchitecturesList(), downloadSources)
repo, err := deb.NewRemoteRepo(mirrorName, archiveURL, distribution, components, context.ArchitecturesList(), downloadSources)
if err != nil {
return fmt.Errorf("unable to create mirror: %s", err)
}

View File

@@ -2,7 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/aptly/debian"
"github.com/smira/aptly/deb"
"github.com/smira/commander"
"sort"
)
@@ -18,7 +18,7 @@ func aptlyMirrorList(cmd *commander.Command, args []string) error {
fmt.Printf("List of mirrors:\n")
repos := make([]string, context.CollectionFactory().RemoteRepoCollection().Len())
i := 0
context.CollectionFactory().RemoteRepoCollection().ForEach(func(repo *debian.RemoteRepo) error {
context.CollectionFactory().RemoteRepoCollection().ForEach(func(repo *deb.RemoteRepo) error {
repos[i] = repo.String()
i++
return nil

View File

@@ -2,7 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/aptly/debian"
"github.com/smira/aptly/deb"
"github.com/smira/commander"
"sort"
)
@@ -21,7 +21,7 @@ func aptlyPublishList(cmd *commander.Command, args []string) error {
published := make([]string, 0, context.CollectionFactory().PublishedRepoCollection().Len())
err = context.CollectionFactory().PublishedRepoCollection().ForEach(func(repo *debian.PublishedRepo) error {
err = context.CollectionFactory().PublishedRepoCollection().ForEach(func(repo *deb.PublishedRepo) error {
err := context.CollectionFactory().PublishedRepoCollection().LoadComplete(repo, context.CollectionFactory())
if err != nil {
return err

View File

@@ -2,7 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/aptly/debian"
"github.com/smira/aptly/deb"
"github.com/smira/aptly/utils"
"github.com/smira/commander"
"github.com/smira/flag"
@@ -63,7 +63,7 @@ func aptlyPublishSnapshotOrRepo(cmd *commander.Command, args []string) error {
component := context.flags.Lookup("component").Value.String()
distribution := context.flags.Lookup("distribution").Value.String()
published, err := debian.NewPublishedRepo(prefix, distribution, component, context.ArchitecturesList(), source, context.CollectionFactory())
published, err := deb.NewPublishedRepo(prefix, distribution, component, context.ArchitecturesList(), source, context.CollectionFactory())
if err != nil {
return fmt.Errorf("unable to publish: %s", err)
}

View File

@@ -2,7 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/aptly/debian"
"github.com/smira/aptly/deb"
"github.com/smira/aptly/utils"
"github.com/smira/commander"
"github.com/smira/flag"
@@ -35,7 +35,7 @@ func aptlyRepoAdd(cmd *commander.Command, args []string) error {
context.Progress().Printf("Loading packages...\n")
list, err := debian.NewPackageListFromRefList(repo.RefList(), context.CollectionFactory().PackageCollection(), context.Progress())
list, err := deb.NewPackageListFromRefList(repo.RefList(), context.CollectionFactory().PackageCollection(), context.Progress())
if err != nil {
return fmt.Errorf("unable to load packages: %s", err)
}
@@ -78,25 +78,25 @@ func aptlyRepoAdd(cmd *commander.Command, args []string) error {
for _, file := range packageFiles {
var (
stanza debian.Stanza
p *debian.Package
stanza deb.Stanza
p *deb.Package
)
candidateProcessedFiles := []string{}
isSourcePackage := strings.HasSuffix(file, ".dsc")
if isSourcePackage {
stanza, err = debian.GetControlFileFromDsc(file, verifier)
stanza, err = deb.GetControlFileFromDsc(file, verifier)
if err == nil {
stanza["Package"] = stanza["Source"]
delete(stanza, "Source")
p, err = debian.NewSourcePackageFromControlFile(stanza)
p, err = deb.NewSourcePackageFromControlFile(stanza)
}
} else {
stanza, err = debian.GetControlFileFromDeb(file)
p = debian.NewPackageFromControlFile(stanza)
stanza, err = deb.GetControlFileFromDeb(file)
p = deb.NewPackageFromControlFile(stanza)
}
if err != nil {
context.Progress().ColoredPrintf("@y[!]@| @!Unable to read file %s: %s@|", file, err)
@@ -110,9 +110,9 @@ func aptlyRepoAdd(cmd *commander.Command, args []string) error {
}
if isSourcePackage {
p.UpdateFiles(append(p.Files(), debian.PackageFile{Filename: filepath.Base(file), Checksums: checksums}))
p.UpdateFiles(append(p.Files(), deb.PackageFile{Filename: filepath.Base(file), Checksums: checksums}))
} else {
p.UpdateFiles([]debian.PackageFile{debian.PackageFile{Filename: filepath.Base(file), Checksums: checksums}})
p.UpdateFiles([]deb.PackageFile{deb.PackageFile{Filename: filepath.Base(file), Checksums: checksums}})
}
err = context.PackagePool().Import(file, checksums.MD5)
@@ -158,7 +158,7 @@ func aptlyRepoAdd(cmd *commander.Command, args []string) error {
processedFiles = append(processedFiles, candidateProcessedFiles...)
}
repo.UpdateRefList(debian.NewPackageRefListFromPackageList(list))
repo.UpdateRefList(deb.NewPackageRefListFromPackageList(list))
err = context.CollectionFactory().LocalRepoCollection().Update(repo)
if err != nil {

View File

@@ -2,7 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/aptly/debian"
"github.com/smira/aptly/deb"
"github.com/smira/commander"
"github.com/smira/flag"
)
@@ -14,7 +14,7 @@ func aptlyRepoCreate(cmd *commander.Command, args []string) error {
return err
}
repo := debian.NewLocalRepo(args[0], context.flags.Lookup("comment").Value.String())
repo := deb.NewLocalRepo(args[0], context.flags.Lookup("comment").Value.String())
repo.DefaultDistribution = context.flags.Lookup("distribution").Value.String()
repo.DefaultComponent = context.flags.Lookup("component").Value.String()

View File

@@ -2,7 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/aptly/debian"
"github.com/smira/aptly/deb"
"github.com/smira/commander"
"sort"
)
@@ -18,7 +18,7 @@ func aptlyRepoList(cmd *commander.Command, args []string) error {
fmt.Printf("List of mirrors:\n")
repos := make([]string, context.CollectionFactory().LocalRepoCollection().Len())
i := 0
context.CollectionFactory().LocalRepoCollection().ForEach(func(repo *debian.LocalRepo) error {
context.CollectionFactory().LocalRepoCollection().ForEach(func(repo *deb.LocalRepo) error {
err := context.CollectionFactory().LocalRepoCollection().LoadComplete(repo)
if err != nil {
return err

View File

@@ -2,7 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/aptly/debian"
"github.com/smira/aptly/deb"
"github.com/smira/commander"
"github.com/smira/flag"
"sort"
@@ -28,8 +28,8 @@ func aptlyRepoMoveCopyImport(cmd *commander.Command, args []string) error {
}
var (
srcRefList *debian.PackageRefList
srcRepo *debian.LocalRepo
srcRefList *deb.PackageRefList
srcRepo *deb.LocalRepo
)
if command == "copy" || command == "move" {
@@ -49,7 +49,7 @@ func aptlyRepoMoveCopyImport(cmd *commander.Command, args []string) error {
srcRefList = srcRepo.RefList()
} else if command == "import" {
var srcRemoteRepo *debian.RemoteRepo
var srcRemoteRepo *deb.RemoteRepo
srcRemoteRepo, err = context.CollectionFactory().RemoteRepoCollection().ByName(args[0])
if err != nil {
@@ -72,12 +72,12 @@ func aptlyRepoMoveCopyImport(cmd *commander.Command, args []string) error {
context.Progress().Printf("Loading packages...\n")
dstList, err := debian.NewPackageListFromRefList(dstRepo.RefList(), context.CollectionFactory().PackageCollection(), context.Progress())
dstList, err := deb.NewPackageListFromRefList(dstRepo.RefList(), context.CollectionFactory().PackageCollection(), context.Progress())
if err != nil {
return fmt.Errorf("unable to load packages: %s", err)
}
srcList, err := debian.NewPackageListFromRefList(srcRefList, context.CollectionFactory().PackageCollection(), context.Progress())
srcList, err := deb.NewPackageListFromRefList(srcRefList, context.CollectionFactory().PackageCollection(), context.Progress())
if err != nil {
return fmt.Errorf("unable to load packages: %s", err)
}
@@ -120,7 +120,7 @@ func aptlyRepoMoveCopyImport(cmd *commander.Command, args []string) error {
verb = "imported"
}
err = toProcess.ForEach(func(p *debian.Package) error {
err = toProcess.ForEach(func(p *deb.Package) error {
err = dstList.Add(p)
if err != nil {
return err
@@ -139,7 +139,7 @@ func aptlyRepoMoveCopyImport(cmd *commander.Command, args []string) error {
if context.flags.Lookup("dry-run").Value.Get().(bool) {
context.Progress().Printf("\nChanges not saved, as dry run has been requested.\n")
} else {
dstRepo.UpdateRefList(debian.NewPackageRefListFromPackageList(dstList))
dstRepo.UpdateRefList(deb.NewPackageRefListFromPackageList(dstList))
err = context.CollectionFactory().LocalRepoCollection().Update(dstRepo)
if err != nil {
@@ -147,7 +147,7 @@ func aptlyRepoMoveCopyImport(cmd *commander.Command, args []string) error {
}
if command == "move" {
srcRepo.UpdateRefList(debian.NewPackageRefListFromPackageList(srcList))
srcRepo.UpdateRefList(deb.NewPackageRefListFromPackageList(srcList))
err = context.CollectionFactory().LocalRepoCollection().Update(srcRepo)
if err != nil {

View File

@@ -2,7 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/aptly/debian"
"github.com/smira/aptly/deb"
"github.com/smira/commander"
"github.com/smira/flag"
)
@@ -28,7 +28,7 @@ func aptlyRepoRemove(cmd *commander.Command, args []string) error {
context.Progress().Printf("Loading packages...\n")
list, err := debian.NewPackageListFromRefList(repo.RefList(), context.CollectionFactory().PackageCollection(), context.Progress())
list, err := deb.NewPackageListFromRefList(repo.RefList(), context.CollectionFactory().PackageCollection(), context.Progress())
if err != nil {
return fmt.Errorf("unable to load packages: %s", err)
}
@@ -39,7 +39,7 @@ func aptlyRepoRemove(cmd *commander.Command, args []string) error {
return fmt.Errorf("unable to remove: %s", err)
}
toRemove.ForEach(func(p *debian.Package) error {
toRemove.ForEach(func(p *deb.Package) error {
list.Remove(p)
context.Progress().ColoredPrintf("@r[-]@| %s removed", p)
return nil
@@ -48,7 +48,7 @@ func aptlyRepoRemove(cmd *commander.Command, args []string) error {
if context.flags.Lookup("dry-run").Value.Get().(bool) {
context.Progress().Printf("\nChanges not saved, as dry run has been requested.\n")
} else {
repo.UpdateRefList(debian.NewPackageRefListFromPackageList(list))
repo.UpdateRefList(deb.NewPackageRefListFromPackageList(list))
err = context.CollectionFactory().LocalRepoCollection().Update(repo)
if err != nil {

View File

@@ -2,7 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/aptly/debian"
"github.com/smira/aptly/deb"
"github.com/smira/aptly/utils"
"github.com/smira/commander"
"github.com/smira/flag"
@@ -38,9 +38,9 @@ func aptlyServe(cmd *commander.Command, args []string) error {
fmt.Printf("Serving published repositories, recommended apt sources list:\n\n")
sources := make(sort.StringSlice, 0, context.CollectionFactory().PublishedRepoCollection().Len())
published := make(map[string]*debian.PublishedRepo, context.CollectionFactory().PublishedRepoCollection().Len())
published := make(map[string]*deb.PublishedRepo, context.CollectionFactory().PublishedRepoCollection().Len())
err = context.CollectionFactory().PublishedRepoCollection().ForEach(func(repo *debian.PublishedRepo) error {
err = context.CollectionFactory().PublishedRepoCollection().ForEach(func(repo *deb.PublishedRepo) error {
err := context.CollectionFactory().PublishedRepoCollection().LoadComplete(repo, context.CollectionFactory())
if err != nil {
return err

View File

@@ -2,19 +2,19 @@ package cmd
import (
"fmt"
"github.com/smira/aptly/debian"
"github.com/smira/aptly/deb"
"github.com/smira/commander"
)
func aptlySnapshotCreate(cmd *commander.Command, args []string) error {
var (
err error
snapshot *debian.Snapshot
snapshot *deb.Snapshot
)
if len(args) == 4 && args[1] == "from" && args[2] == "mirror" {
// aptly snapshot create snap from mirror mirror
var repo *debian.RemoteRepo
var repo *deb.RemoteRepo
repoName, snapshotName := args[3], args[0]
@@ -28,13 +28,13 @@ func aptlySnapshotCreate(cmd *commander.Command, args []string) error {
return fmt.Errorf("unable to create snapshot: %s", err)
}
snapshot, err = debian.NewSnapshotFromRepository(snapshotName, repo)
snapshot, err = deb.NewSnapshotFromRepository(snapshotName, repo)
if err != nil {
return fmt.Errorf("unable to create snapshot: %s", err)
}
} else if len(args) == 4 && args[1] == "from" && args[2] == "repo" {
// aptly snapshot create snap from repo repo
var repo *debian.LocalRepo
var repo *deb.LocalRepo
localRepoName, snapshotName := args[3], args[0]
@@ -48,7 +48,7 @@ func aptlySnapshotCreate(cmd *commander.Command, args []string) error {
return fmt.Errorf("unable to create snapshot: %s", err)
}
snapshot, err = debian.NewSnapshotFromLocalRepo(snapshotName, repo)
snapshot, err = deb.NewSnapshotFromLocalRepo(snapshotName, repo)
if err != nil {
return fmt.Errorf("unable to create snapshot: %s", err)
}
@@ -56,9 +56,9 @@ func aptlySnapshotCreate(cmd *commander.Command, args []string) error {
// aptly snapshot create snap empty
snapshotName := args[0]
packageList := debian.NewPackageList()
packageList := deb.NewPackageList()
snapshot = debian.NewSnapshotFromPackageList(snapshotName, nil, packageList, "Created as empty")
snapshot = deb.NewSnapshotFromPackageList(snapshotName, nil, packageList, "Created as empty")
} else {
cmd.Usage()
return err

View File

@@ -2,7 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/aptly/debian"
"github.com/smira/aptly/deb"
"github.com/smira/commander"
"sort"
)
@@ -20,7 +20,7 @@ func aptlySnapshotList(cmd *commander.Command, args []string) error {
snapshots := make([]string, context.CollectionFactory().SnapshotCollection().Len())
i := 0
context.CollectionFactory().SnapshotCollection().ForEach(func(snapshot *debian.Snapshot) error {
context.CollectionFactory().SnapshotCollection().ForEach(func(snapshot *deb.Snapshot) error {
snapshots[i] = snapshot.String()
i++
return nil

View File

@@ -2,7 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/aptly/debian"
"github.com/smira/aptly/deb"
"github.com/smira/commander"
"strings"
)
@@ -14,7 +14,7 @@ func aptlySnapshotMerge(cmd *commander.Command, args []string) error {
return err
}
sources := make([]*debian.Snapshot, len(args)-1)
sources := make([]*deb.Snapshot, len(args)-1)
for i := 0; i < len(args)-1; i++ {
sources[i], err = context.CollectionFactory().SnapshotCollection().ByName(args[i+1])
@@ -40,7 +40,7 @@ func aptlySnapshotMerge(cmd *commander.Command, args []string) error {
}
// Create <destination> snapshot
destination := debian.NewSnapshotFromRefList(args[0], sources, result,
destination := deb.NewSnapshotFromRefList(args[0], sources, result,
fmt.Sprintf("Merged from sources: %s", strings.Join(sourceDescription, ", ")))
err = context.CollectionFactory().SnapshotCollection().Add(destination)

View File

@@ -2,7 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/aptly/debian"
"github.com/smira/aptly/deb"
"github.com/smira/commander"
"github.com/smira/flag"
"sort"
@@ -46,12 +46,12 @@ func aptlySnapshotPull(cmd *commander.Command, args []string) error {
// Convert snapshot to package list
context.Progress().Printf("Loading packages (%d)...\n", snapshot.RefList().Len()+source.RefList().Len())
packageList, err := debian.NewPackageListFromRefList(snapshot.RefList(), context.CollectionFactory().PackageCollection(), context.Progress())
packageList, err := deb.NewPackageListFromRefList(snapshot.RefList(), context.CollectionFactory().PackageCollection(), context.Progress())
if err != nil {
return fmt.Errorf("unable to load packages: %s", err)
}
sourcePackageList, err := debian.NewPackageListFromRefList(source.RefList(), context.CollectionFactory().PackageCollection(), context.Progress())
sourcePackageList, err := deb.NewPackageListFromRefList(source.RefList(), context.CollectionFactory().PackageCollection(), context.Progress())
if err != nil {
return fmt.Errorf("unable to load packages: %s", err)
}
@@ -76,9 +76,9 @@ func aptlySnapshotPull(cmd *commander.Command, args []string) error {
}
// Initial dependencies out of arguments
initialDependencies := make([]debian.Dependency, len(args)-3)
initialDependencies := make([]deb.Dependency, len(args)-3)
for i, arg := range args[3:] {
initialDependencies[i], err = debian.ParseDependency(arg)
initialDependencies[i], err = deb.ParseDependency(arg)
if err != nil {
return fmt.Errorf("unable to parse argument: %s", err)
}
@@ -86,7 +86,7 @@ func aptlySnapshotPull(cmd *commander.Command, args []string) error {
// Perform pull
for _, arch := range architecturesList {
dependencies := make([]debian.Dependency, len(initialDependencies), 128)
dependencies := make([]deb.Dependency, len(initialDependencies), 128)
for i := range dependencies {
dependencies[i] = initialDependencies[i]
dependencies[i].Architecture = arch
@@ -105,10 +105,10 @@ func aptlySnapshotPull(cmd *commander.Command, args []string) error {
if !noRemove {
// Remove all packages with the same name and architecture
for p := packageList.Search(debian.Dependency{Architecture: pkg.Architecture, Pkg: pkg.Name}); p != nil; {
for p := packageList.Search(deb.Dependency{Architecture: pkg.Architecture, Pkg: pkg.Name}); p != nil; {
packageList.Remove(p)
context.Progress().ColoredPrintf("@r[-]@| %s removed", p)
p = packageList.Search(debian.Dependency{Architecture: pkg.Architecture, Pkg: pkg.Name})
p = packageList.Search(deb.Dependency{Architecture: pkg.Architecture, Pkg: pkg.Name})
}
}
@@ -121,10 +121,10 @@ func aptlySnapshotPull(cmd *commander.Command, args []string) error {
}
// Find missing dependencies for single added package
pL := debian.NewPackageList()
pL := deb.NewPackageList()
pL.Add(pkg)
var missing []debian.Dependency
var missing []deb.Dependency
missing, err = pL.VerifyDependencies(context.DependencyOptions(), []string{arch}, packageList, nil)
if err != nil {
context.Progress().ColoredPrintf("@y[!]@| @!Error while verifying dependencies for pkg %s: %s@|", pkg, err)
@@ -151,7 +151,7 @@ func aptlySnapshotPull(cmd *commander.Command, args []string) error {
context.Progress().Printf("\nNot creating snapshot, as dry run was requested.\n")
} else {
// Create <destination> snapshot
destination := debian.NewSnapshotFromPackageList(args[2], []*debian.Snapshot{snapshot, source}, packageList,
destination := deb.NewSnapshotFromPackageList(args[2], []*deb.Snapshot{snapshot, source}, packageList,
fmt.Sprintf("Pulled into '%s' with '%s' as source, pull request was: '%s'", snapshot.Name, source.Name, strings.Join(args[3:], " ")))
err = context.CollectionFactory().SnapshotCollection().Add(destination)

View File

@@ -2,7 +2,7 @@ package cmd
import (
"fmt"
"github.com/smira/aptly/debian"
"github.com/smira/aptly/deb"
"github.com/smira/commander"
"sort"
)
@@ -14,7 +14,7 @@ func aptlySnapshotVerify(cmd *commander.Command, args []string) error {
return err
}
snapshots := make([]*debian.Snapshot, len(args))
snapshots := make([]*deb.Snapshot, len(args))
for i := range snapshots {
snapshots[i], err = context.CollectionFactory().SnapshotCollection().ByName(args[i])
if err != nil {
@@ -29,20 +29,20 @@ func aptlySnapshotVerify(cmd *commander.Command, args []string) error {
context.Progress().Printf("Loading packages...\n")
packageList, err := debian.NewPackageListFromRefList(snapshots[0].RefList(), context.CollectionFactory().PackageCollection(), context.Progress())
packageList, err := deb.NewPackageListFromRefList(snapshots[0].RefList(), context.CollectionFactory().PackageCollection(), context.Progress())
if err != nil {
fmt.Errorf("unable to load packages: %s", err)
}
sourcePackageList := debian.NewPackageList()
sourcePackageList := deb.NewPackageList()
err = sourcePackageList.Append(packageList)
if err != nil {
fmt.Errorf("unable to merge sources: %s", err)
}
var pL *debian.PackageList
var pL *deb.PackageList
for i := 1; i < len(snapshots); i++ {
pL, err = debian.NewPackageListFromRefList(snapshots[i].RefList(), context.CollectionFactory().PackageCollection(), context.Progress())
pL, err = deb.NewPackageListFromRefList(snapshots[i].RefList(), context.CollectionFactory().PackageCollection(), context.Progress())
if err != nil {
fmt.Errorf("unable to load packages: %s", err)
}

View File

@@ -1,4 +1,4 @@
package debian
package deb
import (
"github.com/smira/aptly/database"

View File

@@ -1,4 +1,4 @@
package debian
package deb
import (
"archive/tar"

View File

@@ -1,4 +1,4 @@
package debian
package deb
import (
"github.com/smira/aptly/utils"

View File

@@ -1,2 +1,2 @@
// Package debian implements Debian-specific repository handling
package debian
package deb

View File

@@ -1,4 +1,4 @@
package debian
package deb
import (
. "launchpad.net/gocheck"

View File

@@ -1,4 +1,4 @@
package debian
package deb
import (
"bufio"

View File

@@ -1,4 +1,4 @@
package debian
package deb
import (
"bufio"

View File

@@ -1,4 +1,4 @@
package debian
package deb
import (
"fmt"

View File

@@ -1,4 +1,4 @@
package debian
package deb
import (
"errors"

View File

@@ -1,4 +1,4 @@
package debian
package deb
import (
"bytes"

View File

@@ -1,4 +1,4 @@
package debian
package deb
import (
"errors"

View File

@@ -1,4 +1,4 @@
package debian
package deb
import (
"fmt"

View File

@@ -1,4 +1,4 @@
package debian
package deb
import (
"bytes"

View File

@@ -1,4 +1,4 @@
package debian
package deb
import (
"github.com/smira/aptly/database"

View File

@@ -1,4 +1,4 @@
package debian
package deb
import (
"strings"

View File

@@ -1,4 +1,4 @@
package debian
package deb
import (
"encoding/binary"

View File

@@ -1,4 +1,4 @@
package debian
package deb
import (
"github.com/smira/aptly/files"

View File

@@ -1,4 +1,4 @@
package debian
package deb
import (
"bytes"

View File

@@ -1,4 +1,4 @@
package debian
package deb
import (
"fmt"

View File

@@ -1,4 +1,4 @@
package debian
package deb
import (
"github.com/smira/aptly/utils"

View File

@@ -1,4 +1,4 @@
package debian
package deb
import (
"bufio"

View File

@@ -1,4 +1,4 @@
package debian
package deb
import (
"errors"

View File

@@ -1,4 +1,4 @@
package debian
package deb
import (
"bytes"

View File

@@ -1,4 +1,4 @@
package debian
package deb
import (
"errors"

View File

@@ -1,4 +1,4 @@
package debian
package deb
import (
"bytes"

View File

@@ -1,4 +1,4 @@
package debian
package deb
import (
"errors"

View File

@@ -1,4 +1,4 @@
package debian
package deb
import (
"bytes"

View File

@@ -1,4 +1,4 @@
package debian
package deb
import (
"errors"

View File

@@ -1,4 +1,4 @@
package debian
package deb
import (
"fmt"

View File

@@ -1,4 +1,4 @@
package debian
package deb
import (
. "launchpad.net/gocheck"