Skip to content

Commit ffd204c

Browse files
committed
fix lint
1 parent 9c32625 commit ffd204c

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

aptly/const.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package aptly
2+
3+
var DistributionFocal = "focal"

deb/index_files.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ func (files *indexFiles) PackageIndex(component, arch string, udeb bool, install
264264
if udeb {
265265
relativePath = filepath.Join(component, "debian-installer", fmt.Sprintf("binary-%s", arch), "Packages")
266266
} else if installer {
267-
if distribution == "focal" {
267+
if distribution == aptly.DistributionFocal {
268268
relativePath = filepath.Join(component, fmt.Sprintf("installer-%s", arch), "current", "legacy-images", "SHA256SUMS")
269269
} else {
270270
relativePath = filepath.Join(component, fmt.Sprintf("installer-%s", arch), "current", "images", "SHA256SUMS")

deb/package.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ func NewInstallerPackageFromControlFile(input Stanza, repo *RemoteRepo, componen
190190
}
191191

192192
var relPath string
193-
if repo.Distribution == "focal" {
193+
if repo.Distribution == aptly.DistributionFocal {
194194
relPath = filepath.Join("dists", repo.Distribution, component, fmt.Sprintf("%s-%s", p.Name, architecture), "current", "legacy-images")
195195
} else {
196196
relPath = filepath.Join("dists", repo.Distribution, component, fmt.Sprintf("%s-%s", p.Name, architecture), "current", "images")

deb/publish.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ func (p *PublishedRepo) Publish(packagePool aptly.PackagePool, publishedStorageP
665665
}
666666
relPath = filepath.Join("pool", component, poolDir)
667667
} else {
668-
if p.Distribution == "focal" {
668+
if p.Distribution == aptly.DistributionFocal {
669669
relPath = filepath.Join("dists", p.Distribution, component, fmt.Sprintf("%s-%s", pkg.Name, arch), "current", "legacy-images")
670670
} else {
671671
relPath = filepath.Join("dists", p.Distribution, component, fmt.Sprintf("%s-%s", pkg.Name, arch), "current", "images")

deb/remote.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,10 @@ func (repo *RemoteRepo) UdebPath(component string, architecture string) string {
259259
// InstallerPath returns path of Packages files for given component and
260260
// architecture
261261
func (repo *RemoteRepo) InstallerPath(component string, architecture string) string {
262-
if repo.Distribution == "focal" {
262+
if repo.Distribution == aptly.DistributionFocal {
263263
return fmt.Sprintf("%s/installer-%s/current/legacy-images/SHA256SUMS", component, architecture)
264-
} else {
265-
return fmt.Sprintf("%s/installer-%s/current/images/SHA256SUMS", component, architecture)
266264
}
265+
return fmt.Sprintf("%s/installer-%s/current/images/SHA256SUMS", component, architecture)
267266
}
268267

269268
// PackageURL returns URL of package file relative to repository root

0 commit comments

Comments
 (0)