pmb.helpers.other.folder_size: use kilobytes (MR 2074)

busybox du doesn't support bytes or custom block sizes.
This commit is contained in:
Maxim Karasev 2021-06-24 02:50:47 +03:00 committed by Alexey Min
parent 5c1da79634
commit 31e7a0006d
No known key found for this signature in database
GPG key ID: EBF5ECFFFEE34DED
4 changed files with 6 additions and 7 deletions

View file

@ -17,10 +17,9 @@ def folder_size(args, path):
faster than doing the same task in pure Python). This result is only
approximatelly right, but good enough for pmbootstrap's use case (#760).
:returns: folder size in bytes
:returns: folder size in kilobytes
"""
output = pmb.helpers.run.root(args, ["du", "--summarize",
"--block-size=1",
output = pmb.helpers.run.root(args, ["du", "-ks",
path], output_return=True)
# Only look at last line to filter out sudo garbage (#1766)