Skip to content

Commit

Permalink
fix lint complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
neolynx committed Mar 6, 2024
1 parent d64c427 commit 9d68151
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
3 changes: 3 additions & 0 deletions aptly/const.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package aptly

var DistributionFocal = "focal"
2 changes: 1 addition & 1 deletion deb/index_files.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func (files *indexFiles) PackageIndex(component, arch string, udeb bool, install
if udeb {
relativePath = filepath.Join(component, "debian-installer", fmt.Sprintf("binary-%s", arch), "Packages")
} else if installer {
if distribution == "focal" {
if distribution == aptly.DistributionFocal {
relativePath = filepath.Join(component, fmt.Sprintf("installer-%s", arch), "current", "legacy-images", "SHA256SUMS")

Check warning on line 268 in deb/index_files.go

View check run for this annotation

Codecov / codecov/patch

deb/index_files.go#L268

Added line #L268 was not covered by tests
} else {
relativePath = filepath.Join(component, fmt.Sprintf("installer-%s", arch), "current", "images", "SHA256SUMS")
Expand Down
2 changes: 1 addition & 1 deletion deb/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func NewInstallerPackageFromControlFile(input Stanza, repo *RemoteRepo, componen
}

var relPath string
if repo.Distribution == "focal" {
if repo.Distribution == aptly.DistributionFocal {
relPath = filepath.Join("dists", repo.Distribution, component, fmt.Sprintf("%s-%s", p.Name, architecture), "current", "legacy-images")

Check warning on line 194 in deb/package.go

View check run for this annotation

Codecov / codecov/patch

deb/package.go#L194

Added line #L194 was not covered by tests
} else {
relPath = filepath.Join("dists", repo.Distribution, component, fmt.Sprintf("%s-%s", p.Name, architecture), "current", "images")
Expand Down
2 changes: 1 addition & 1 deletion deb/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ func (p *PublishedRepo) Publish(packagePool aptly.PackagePool, publishedStorageP
}
relPath = filepath.Join("pool", component, poolDir)
} else {
if p.Distribution == "focal" {
if p.Distribution == aptly.DistributionFocal {
relPath = filepath.Join("dists", p.Distribution, component, fmt.Sprintf("%s-%s", pkg.Name, arch), "current", "legacy-images")

Check warning on line 669 in deb/publish.go

View check run for this annotation

Codecov / codecov/patch

deb/publish.go#L669

Added line #L669 was not covered by tests
} else {
relPath = filepath.Join("dists", p.Distribution, component, fmt.Sprintf("%s-%s", pkg.Name, arch), "current", "images")
Expand Down
5 changes: 2 additions & 3 deletions deb/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,10 @@ func (repo *RemoteRepo) UdebPath(component string, architecture string) string {
// InstallerPath returns path of Packages files for given component and
// architecture
func (repo *RemoteRepo) InstallerPath(component string, architecture string) string {
if repo.Distribution == "focal" {
if repo.Distribution == aptly.DistributionFocal {
return fmt.Sprintf("%s/installer-%s/current/legacy-images/SHA256SUMS", component, architecture)
} else {
return fmt.Sprintf("%s/installer-%s/current/images/SHA256SUMS", component, architecture)
}

Check warning on line 264 in deb/remote.go

View check run for this annotation

Codecov / codecov/patch

deb/remote.go#L263-L264

Added lines #L263 - L264 were not covered by tests
return fmt.Sprintf("%s/installer-%s/current/images/SHA256SUMS", component, architecture)
}

// PackageURL returns URL of package file relative to repository root
Expand Down

0 comments on commit 9d68151

Please sign in to comment.