From 54e21afee74c98383bd0f33d8b336d8a6fa30843 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Fri, 20 Mar 2015 00:18:12 +0300 Subject: [PATCH] Use uploaders.json in repo include. #71 --- cmd/repo_include.go | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/cmd/repo_include.go b/cmd/repo_include.go index e54ce5c8..80205c65 100644 --- a/cmd/repo_include.go +++ b/cmd/repo_include.go @@ -44,6 +44,9 @@ func aptlyRepoInclude(cmd *commander.Command, args []string) error { uploadersFile := context.Flags().Lookup("uploaders-file").Value.Get().(string) if uploadersFile != "" { uploaders, err = deb.NewUploadersFromFile(uploadersFile) + if err != nil { + return err + } for i := range uploaders.Rules { uploaders.Rules[i].CompiledCondition, err = query.Parse(uploaders.Rules[i].Condition) @@ -77,12 +80,14 @@ func aptlyRepoInclude(cmd *commander.Command, args []string) error { continue } - if uploaders != nil && !uploaders.IsAllowed(changes) { - failedFiles = append(failedFiles, path) - reporter.Warning("changes file is not allowed accoring to uploaders config: %s, keys %#v", - changes.ChangesName, changes.SignatureKeys) - changes.Cleanup() - continue + if uploaders != nil { + if err = uploaders.IsAllowed(changes); err != nil { + failedFiles = append(failedFiles, path) + reporter.Warning("changes file skipped due to uploaders config: %s, keys %#v: %s", + changes.ChangesName, changes.SignatureKeys, err) + changes.Cleanup() + continue + } } err = changes.Prepare()