diff --git a/src/meow.tf/deb-simple/apt.go b/src/meow.tf/deb-simple/apt.go index ca78344..99d1e92 100644 --- a/src/meow.tf/deb-simple/apt.go +++ b/src/meow.tf/deb-simple/apt.go @@ -119,8 +119,6 @@ func createRelease(config Conf, distro, arch string) error { for _, file := range dirList { filePath := filepath.Join(config.DistPath(distro), basePath, file.Name()) - log.Println("File path:", filePath) - fileLocalPath := filepath.Join(basePath, file.Name()) fileLocalPath = strings.Replace(fileLocalPath, "\\", "/", -1) @@ -128,7 +126,7 @@ func createRelease(config Conf, distro, arch string) error { f, err := os.Open(filePath) if err != nil { - log.Println("error opening source file: ", err) + return err } var size int64 = file.Size() diff --git a/src/meow.tf/deb-simple/packages.go b/src/meow.tf/deb-simple/packages.go index 81fc1dd..91d7afa 100644 --- a/src/meow.tf/deb-simple/packages.go +++ b/src/meow.tf/deb-simple/packages.go @@ -15,7 +15,6 @@ import ( "crypto/md5" "crypto/sha1" "crypto/sha256" - "log" "github.com/blang/semver" ) @@ -118,7 +117,6 @@ func scanRecursive(path string, m map[string]*PackageFile) error { } func newPackageFile(path, name string) (*PackageFile, error) { - log.Println("New package from", path, name) p := &PackageFile{ Name: name, Path: filepath.Join(path, name), diff --git a/src/meow.tf/deb-simple/server.go b/src/meow.tf/deb-simple/server.go index b426200..7d037e1 100644 --- a/src/meow.tf/deb-simple/server.go +++ b/src/meow.tf/deb-simple/server.go @@ -102,19 +102,7 @@ func Start() { for _, dist := range parsedConfig.DistroNames { distro := &Distro{Name: dist, Architectures: make(map[string]map[string]*PackageFile)} - for _, arch := range parsedConfig.SupportArch { - files, err := buildPackageList(parsedConfig, dist, arch) - - if err != nil { - log.Fatalln("Unable to load packages:", err) - } - - distro.Architectures[arch] = files - - log.Println("Generating packages file for", dist, arch) - createPackagesCached(parsedConfig, dist, arch, files) - createRelease(parsedConfig, dist, arch) - } + go scanInitialPackages(parsedConfig, distro) distros[dist] = distro } @@ -132,6 +120,22 @@ func Start() { } } +func scanInitialPackages(config Conf, dist *Distro) { + for _, arch := range config.SupportArch { + files, err := buildPackageList(config, dist.Name, arch) + + if err != nil { + log.Fatalln("Unable to load packages:", err) + } + + dist.Architectures[arch] = files + + log.Println("Generating packages file for", dist.Name, arch) + createPackagesCached(config, dist.Name, arch, files) + createRelease(config, dist.Name, arch) + } +} + func setupPgp(config Conf) error { if config.PGPSecretKey == "" { return nil