pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/sysutils/restic



Module Name:    pkgsrc
Committed By:   wiz
Date:           Mon Jun 22 22:09:45 UTC 2026

Modified Files:
        pkgsrc/sysutils/restic: Makefile distinfo
Added Files:
        pkgsrc/sysutils/restic/patches: patch-cmd_restic_cmd__stats.go
            patch-cmd_restic_cmd__stats__test.go

Log Message:
restic: merge upstream patch

for "stats: hide progress bar for json output" to make --json
output JSON only.

Bump PKGREVISION.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 pkgsrc/sysutils/restic/Makefile
cvs rdiff -u -r1.20 -r1.21 pkgsrc/sysutils/restic/distinfo
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/sysutils/restic/patches/patch-cmd_restic_cmd__stats.go \
    pkgsrc/sysutils/restic/patches/patch-cmd_restic_cmd__stats__test.go

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/sysutils/restic/Makefile
diff -u pkgsrc/sysutils/restic/Makefile:1.76 pkgsrc/sysutils/restic/Makefile:1.77
--- pkgsrc/sysutils/restic/Makefile:1.76        Sat Jun 13 05:36:38 2026
+++ pkgsrc/sysutils/restic/Makefile     Mon Jun 22 22:09:45 2026
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.76 2026/06/13 05:36:38 adam Exp $
+# $NetBSD: Makefile,v 1.77 2026/06/22 22:09:45 wiz Exp $
 
 DISTNAME=      restic-0.19.0
+PKGREVISION=   1
 CATEGORIES=    sysutils
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=restic/}
 GITHUB_TAG=    v${PKGVERSION_NOREV}

Index: pkgsrc/sysutils/restic/distinfo
diff -u pkgsrc/sysutils/restic/distinfo:1.20 pkgsrc/sysutils/restic/distinfo:1.21
--- pkgsrc/sysutils/restic/distinfo:1.20        Sat Jun 13 05:36:38 2026
+++ pkgsrc/sysutils/restic/distinfo     Mon Jun 22 22:09:45 2026
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.20 2026/06/13 05:36:38 adam Exp $
+$NetBSD: distinfo,v 1.21 2026/06/22 22:09:45 wiz Exp $
 
 BLAKE2s (cel.dev_expr_@v_v0.25.1.mod) = c36f332c45cf24a4dd4d1a4c6ff42cd78732769e87b139ce56cd3f7c66ff685e
 SHA512 (cel.dev_expr_@v_v0.25.1.mod) = 67aecc4be51ad90133564333b4619f3195b522bcc4cec478fe37fcb7eef22a7efbfdbae97bfccd9ef1c45828116977a56a53451a037fd1ada3faa906278f4842
@@ -867,3 +867,5 @@ Size (gopkg.in_yaml.v3_@v_v3.0.1.mod) = 
 BLAKE2s (restic-0.19.0.tar.gz) = 7003d6a3c90cf101b7823a4da17c1c06ac673df4fc2663c7a26214046f001a98
 SHA512 (restic-0.19.0.tar.gz) = 914b438691591d4f12085c0c83a471672ce99fecd108754eb18ee27985fbe8d48d05af954043724a05d63fe9283ee7421de7975d2a1f5debc8b4dd047140b47c
 Size (restic-0.19.0.tar.gz) = 24158333 bytes
+SHA1 (patch-cmd_restic_cmd__stats.go) = 119ed629fa4f2be34793ad79546dfa50f6a44947
+SHA1 (patch-cmd_restic_cmd__stats__test.go) = 2eb4cc9350a2a0605983cc5091baa613c12363a7

Added files:

Index: pkgsrc/sysutils/restic/patches/patch-cmd_restic_cmd__stats.go
diff -u /dev/null pkgsrc/sysutils/restic/patches/patch-cmd_restic_cmd__stats.go:1.1
--- /dev/null   Mon Jun 22 22:09:45 2026
+++ pkgsrc/sysutils/restic/patches/patch-cmd_restic_cmd__stats.go       Mon Jun 22 22:09:45 2026
@@ -0,0 +1,44 @@
+$NetBSD: patch-cmd_restic_cmd__stats.go,v 1.1 2026/06/22 22:09:45 wiz Exp $
+
+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
Index: pkgsrc/sysutils/restic/patches/patch-cmd_restic_cmd__stats__test.go
diff -u /dev/null pkgsrc/sysutils/restic/patches/patch-cmd_restic_cmd__stats__test.go:1.1
--- /dev/null   Mon Jun 22 22:09:45 2026
+++ pkgsrc/sysutils/restic/patches/patch-cmd_restic_cmd__stats__test.go Mon Jun 22 22:09:45 2026
@@ -0,0 +1,30 @@
+$NetBSD: patch-cmd_restic_cmd__stats__test.go,v 1.1 2026/06/22 22:09:45 wiz Exp $
+
+stats: hide progress bar for json output
+https://github.com/restic/restic/pull/21871
+
+--- cmd/restic/cmd_stats_test.go.orig  2026-06-09 16:49:04.000000000 +0000
++++ cmd/restic/cmd_stats_test.go
+@@ -66,7 +66,7 @@ func TestStatsProgress(t *testing.T) {
+ func TestStatsProgress(t *testing.T) {
+       term := &ui.MockTerminal{}
+ 
+-      progress := newStatsProgress(term, 2)
++      progress := newStatsProgress(term, true, 2)
+       progress.printProgress(0*time.Second, false)
+       rtest.Equals(t, []string{"[0:00] 0.00%  0 / 2 snapshots, 0 B"}, term.Output)
+ 
+@@ -87,4 +87,13 @@ func TestStatsProgress(t *testing.T) {
+ 
+       progress.printProgress(20*time.Second, true)
+       rtest.Equals(t, []string{"[0:20] 100.00%  2 / 2 snapshots, 4 files, 5 blobs, 6 B"}, term.Output)
++}
++
++func TestStatsProgressJSON(t *testing.T) {
++      term := &ui.MockTerminal{}
++
++      progress := newStatsProgress(term, false, 2)
++      progress.printProgress(0*time.Second, false)
++      // JSON output is not available yet, so just make sure to not break normal json output
++      rtest.Equals(t, nil, term.Output)
+ }



Home | Main Index | Thread Index | Old Index