From eb087fd2915d1942906ef9bdc96c82908ffbb3d4 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Mon, 26 Jan 2015 21:16:44 +0300 Subject: [PATCH] When generating index files, make udeb forced false for "source" architecture. #180 Otherwise two index files are generated (source arch, "udeb" true/false) which end up sharing same final filename, and empty one might overwrite "real" one. --- deb/index_files.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/deb/index_files.go b/deb/index_files.go index a1eb0015..962c988b 100644 --- a/deb/index_files.go +++ b/deb/index_files.go @@ -150,7 +150,10 @@ func newIndexFiles(publishedStorage aptly.PublishedStorage, basePath, tempDir, s } func (files *indexFiles) PackageIndex(component, arch string, udeb bool) *indexFile { - key := fmt.Sprintf("pi-%s-%s-%s", component, arch, udeb) + if arch == "source" { + udeb = false + } + key := fmt.Sprintf("pi-%s-%s-%v", component, arch, udeb) file, ok := files.indexes[key] if !ok { var relativePath string @@ -180,7 +183,10 @@ func (files *indexFiles) PackageIndex(component, arch string, udeb bool) *indexF } func (files *indexFiles) ReleaseIndex(component, arch string, udeb bool) *indexFile { - key := fmt.Sprintf("ri-%s-%s-%s", component, arch, udeb) + if arch == "source" { + udeb = false + } + key := fmt.Sprintf("ri-%s-%s-%v", component, arch, udeb) file, ok := files.indexes[key] if !ok { var relativePath string