From 587086beb4ab1b996de82935f9045ac1cac939eb Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Mon, 28 Mar 2016 13:34:05 +0300 Subject: [PATCH] Misc style and simple mistakes fixes. --- deb/changes.go | 6 ++++++ deb/deb.go | 2 +- deb/import.go | 6 ++++++ deb/list.go | 2 +- deb/publish.go | 2 +- deb/remote.go | 2 +- 6 files changed, 16 insertions(+), 4 deletions(-) diff --git a/deb/changes.go b/deb/changes.go index 62eeb3b4..f1898e4b 100644 --- a/deb/changes.go +++ b/deb/changes.go @@ -256,6 +256,12 @@ func CollectChangesFiles(locations []string, reporter aptly.ResultReporter) (cha return nil }) + + if err != nil { + reporter.Warning("Unable to process %s: %s", location, err2) + failedFiles = append(failedFiles, location) + continue + } } else if strings.HasSuffix(info.Name(), ".changes") { changesFiles = append(changesFiles, location) } diff --git a/deb/deb.go b/deb/deb.go index 42b42f40..3a97468f 100644 --- a/deb/deb.go +++ b/deb/deb.go @@ -127,7 +127,7 @@ func GetContentsFromDeb(packageFile string) ([]string, error) { case "data.tar.gz": ungzip, err := gzip.NewReader(library) if err != nil { - return nil, fmt.Errorf("unable to ungzip data.tar.gz from %s: %s", packageFile,err) + return nil, fmt.Errorf("unable to ungzip data.tar.gz from %s: %s", packageFile, err) } defer ungzip.Close() tarInput = ungzip diff --git a/deb/import.go b/deb/import.go index 7ab0ddc1..08bb11b8 100644 --- a/deb/import.go +++ b/deb/import.go @@ -34,6 +34,12 @@ func CollectPackageFiles(locations []string, reporter aptly.ResultReporter) (pac return nil }) + + if err2 != nil { + reporter.Warning("Unable to process %s: %s", location, err2) + failedFiles = append(failedFiles, location) + continue + } } else { if strings.HasSuffix(info.Name(), ".deb") || strings.HasSuffix(info.Name(), ".udeb") || strings.HasSuffix(info.Name(), ".dsc") || strings.HasSuffix(info.Name(), ".ddeb") { diff --git a/deb/list.go b/deb/list.go index 3cfa3e74..14026fc7 100644 --- a/deb/list.go +++ b/deb/list.go @@ -282,7 +282,7 @@ func depSliceDeduplicate(s []Dependency) []Dependency { // VerifyDependencies looks for missing dependencies in package list. // -// Analysis would be peformed for each architecture, in specified sources +// Analysis would be performed for each architecture, in specified sources func (l *PackageList) VerifyDependencies(options int, architectures []string, sources *PackageList, progress aptly.Progress) ([]Dependency, error) { l.PrepareIndex() missing := make([]Dependency, 0, 128) diff --git a/deb/publish.go b/deb/publish.go index ba0748c9..a1e6bc1b 100644 --- a/deb/publish.go +++ b/deb/publish.go @@ -294,7 +294,7 @@ func (p *PublishedRepo) MarshalJSON() ([]byte, error) { }) } -// String returns human-readable represenation of PublishedRepo +// String returns human-readable representation of PublishedRepo func (p *PublishedRepo) String() string { var sources = []string{} diff --git a/deb/remote.go b/deb/remote.go index 52a0774c..74155b3b 100644 --- a/deb/remote.go +++ b/deb/remote.go @@ -146,7 +146,7 @@ func (repo *RemoteRepo) IsFlat() bool { return repo.Distribution == "" || (strings.HasPrefix(repo.Distribution, ".") && strings.HasSuffix(repo.Distribution, "/")) } -// NumPackages return number of packages retrived from remote repo +// NumPackages return number of packages retrieved from remote repo func (repo *RemoteRepo) NumPackages() int { if repo.packageRefs == nil { return 0