head 1.1; access; symbols; locks; strict; comment @# @; 1.1 date 2026.06.22.22.09.45; author wiz; state Exp; branches; next ; commitid mSBg6of2luKvmQKG; desc @@ 1.1 log @restic: merge upstream patch for "stats: hide progress bar for json output" to make --json output JSON only. Bump PKGREVISION. @ text @$NetBSD$ stats: hide progress bar for json output https://github.com/restic/restic/pull/21871 --- cmd/restic/cmd_stats.go.orig 2026-06-09 16:49:04.000000000 +0000 +++ cmd/restic/cmd_stats.go @@@@ -141,7 +141,7 @@@@ func runStats(ctx context.Context, opts StatsOptions, snapshots = append(snapshots, sn) } - statsProgress := newStatsProgress(term, uint64(len(snapshots))) + statsProgress := newStatsProgress(term, !gopts.JSON, uint64(len(snapshots))) updater := progress.NewUpdater(ui.CalculateProgressInterval(!gopts.Quiet, gopts.JSON, term.CanUpdateStatus()), func(runtime time.Duration, final bool) { statsProgress.printProgress(runtime, final) @@@@ -375,6 +375,7 @@@@ type statsProgress struct { term ui.Terminal m sync.Mutex snapshotCount uint64 + show bool processedSnapshotCount uint64 processedFileCount uint64 @@@@ -382,14 +383,18 @@@@ type statsProgress struct { processedSize uint64 } -func newStatsProgress(term ui.Terminal, snapshotCount uint64) *statsProgress { +func newStatsProgress(term ui.Terminal, show bool, snapshotCount uint64) *statsProgress { return &statsProgress{ term: term, + show: show, snapshotCount: snapshotCount, } } func (s *statsProgress) printProgress(runtime time.Duration, final bool) { + if !s.show { + return + } s.m.Lock() progressBase := s.processedSnapshotCount @