X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=cmd%2Fsafcm%2Fsync_sync.go;h=1328af7ca7acf6d87073c12cc8b71d36ca489e44;hb=6015bd22c34e8287b43b462facd5ad491296c8c2;hp=e84b7f416c07b84df027f017c826d8b381324d4a;hpb=f2f2bc47e8729548f3c10117f7f008b547c4afc5;p=safcm%2Fsafcm.git diff --git a/cmd/safcm/sync_sync.go b/cmd/safcm/sync_sync.go index e84b7f4..1328af7 100644 --- a/cmd/safcm/sync_sync.go +++ b/cmd/safcm/sync_sync.go @@ -44,26 +44,9 @@ func (s *Sync) hostSync(conn *rpc.Conn, detectedGroups []string) error { } // Display changes - var changes []string - if len(resp.FileChanges) > 0 { - changes = append(changes, - s.formatFileChanges(resp.FileChanges)) - } - if len(resp.PackageChanges) > 0 { - changes = append(changes, - s.formatPackageChanges(resp.PackageChanges)) - } - if len(resp.ServiceChanges) > 0 { - changes = append(changes, - s.formatServiceChanges(resp.ServiceChanges)) - } - if len(resp.CommandChanges) > 0 { - changes = append(changes, - s.formatCommandChanges(resp.CommandChanges)) - } - if len(changes) > 0 { - s.logf(safcm.LogInfo, true, "%s", - "\n"+strings.Join(changes, "\n")) + changes := s.formatChanges(resp) + if changes != "" { + s.logf(safcm.LogInfo, true, "%s", changes) } if resp.Error != "" { @@ -108,7 +91,7 @@ func (s *Sync) hostSyncReq(detectedGroups []string) ( allFiles := make(map[string]*safcm.File) allPackagesMap := make(map[string]bool) // map to deduplicate allServicesMap := make(map[string]bool) // map to deduplicate - var allCommands []string + var allCommands []*safcm.Command for _, group := range groups { // Skip non-existent group directories