Use "pack file" instead of "data file" (#2885)

- changed variable names, especially changed DataFile into PackFile
- changed in some comments
- always use "pack file" in docu
This commit is contained in:
aawsome
2020-08-16 11:16:38 +02:00
committed by GitHub
parent 643bbbe156
commit 0fed6a8dfc
45 changed files with 126 additions and 126 deletions
+1 -1
View File
@@ -149,7 +149,7 @@ func runCat(gopts GlobalOptions, args []string) error {
switch tpe {
case "pack":
h := restic.Handle{Type: restic.DataFile, Name: id.String()}
h := restic.Handle{Type: restic.PackFile, Name: id.String()}
buf, err := backend.LoadAll(gopts.ctx, nil, repo.Backend(), h)
if err != nil {
return err
+2 -2
View File
@@ -84,8 +84,8 @@ type Blob struct {
func printPacks(repo *repository.Repository, wr io.Writer) error {
return repo.List(context.TODO(), restic.DataFile, func(id restic.ID, size int64) error {
h := restic.Handle{Type: restic.DataFile, Name: id.String()}
return repo.List(context.TODO(), restic.PackFile, func(id restic.ID, size int64) error {
h := restic.Handle{Type: restic.PackFile, Name: id.String()}
blobs, err := pack.List(repo.Key(), restic.ReaderAt(repo.Backend(), h), size)
if err != nil {
+1 -1
View File
@@ -417,7 +417,7 @@ func (f *Finder) packsToBlobs(ctx context.Context, packs []string) error {
packsFound := 0
debug.Log("Looking for packs...")
err := f.repo.List(ctx, restic.DataFile, func(id restic.ID, size int64) error {
err := f.repo.List(ctx, restic.PackFile, func(id restic.ID, size int64) error {
if allPacksFound {
return nil
}
+1 -1
View File
@@ -50,7 +50,7 @@ func runList(cmd *cobra.Command, opts GlobalOptions, args []string) error {
var t restic.FileType
switch args[0] {
case "packs":
t = restic.DataFile
t = restic.PackFile
case "index":
t = restic.IndexFile
case "snapshots":
+2 -2
View File
@@ -128,7 +128,7 @@ func pruneRepository(gopts GlobalOptions, repo restic.Repository) error {
}
Verbosef("counting files in repo\n")
err = repo.List(ctx, restic.DataFile, func(restic.ID, int64) error {
err = repo.List(ctx, restic.PackFile, func(restic.ID, int64) error {
stats.packs++
return nil
})
@@ -277,7 +277,7 @@ func pruneRepository(gopts GlobalOptions, repo restic.Repository) error {
if len(removePacks) != 0 {
Verbosef("remove %d old packs\n", len(removePacks))
DeleteFiles(gopts, repo, removePacks, restic.DataFile)
DeleteFiles(gopts, repo, removePacks, restic.PackFile)
}
Verbosef("done\n")
+1 -1
View File
@@ -53,7 +53,7 @@ func rebuildIndex(ctx context.Context, repo restic.Repository, ignorePacks resti
Verbosef("counting files in repo\n")
var packs uint64
err := repo.List(ctx, restic.DataFile, func(restic.ID, int64) error {
err := repo.List(ctx, restic.PackFile, func(restic.ID, int64) error {
packs++
return nil
})
+3 -3
View File
@@ -386,12 +386,12 @@ func TestBackupSelfHealing(t *testing.T) {
}
}
// remove all data packs
rtest.OK(t, r.List(env.gopts.ctx, restic.DataFile, func(id restic.ID, size int64) error {
// remove all packs containing data blobs
rtest.OK(t, r.List(env.gopts.ctx, restic.PackFile, func(id restic.ID, size int64) error {
if treePacks.Has(id) {
return nil
}
return r.Backend().Remove(env.gopts.ctx, restic.Handle{Type: restic.DataFile, Name: id.String()})
return r.Backend().Remove(env.gopts.ctx, restic.Handle{Type: restic.PackFile, Name: id.String()})
}))
testRunRebuildIndex(t, env.gopts)