|
@@ -2,6 +2,8 @@ import argparse
|
|
import math
|
|
import math
|
|
import os
|
|
import os
|
|
|
|
|
|
|
|
+from borgstore.store import ItemInfo
|
|
|
|
+
|
|
from ._common import with_repository, Highlander
|
|
from ._common import with_repository, Highlander
|
|
from ..constants import * # NOQA
|
|
from ..constants import * # NOQA
|
|
from ..helpers import parse_file_size, format_file_size
|
|
from ..helpers import parse_file_size, format_file_size
|
|
@@ -29,6 +31,7 @@ class RepoSpaceMixIn:
|
|
infos = repository.store_list("config")
|
|
infos = repository.store_list("config")
|
|
size = 0
|
|
size = 0
|
|
for info in infos:
|
|
for info in infos:
|
|
|
|
+ info = ItemInfo(*info) # RPC does not give namedtuple
|
|
if info.name.startswith("space-reserve."):
|
|
if info.name.startswith("space-reserve."):
|
|
size += info.size
|
|
size += info.size
|
|
repository.store_delete(f"config/{info.name}")
|
|
repository.store_delete(f"config/{info.name}")
|
|
@@ -39,6 +42,7 @@ class RepoSpaceMixIn:
|
|
infos = repository.store_list("config")
|
|
infos = repository.store_list("config")
|
|
size = 0
|
|
size = 0
|
|
for info in infos:
|
|
for info in infos:
|
|
|
|
+ info = ItemInfo(*info) # RPC does not give namedtuple
|
|
if info.name.startswith("space-reserve."):
|
|
if info.name.startswith("space-reserve."):
|
|
size += info.size
|
|
size += info.size
|
|
print(f"There is {format_file_size(size, iec=False)} reserved space in this repository.")
|
|
print(f"There is {format_file_size(size, iec=False)} reserved space in this repository.")
|