Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9e14693

Browse files
committedSep 10, 2024
kibibyte, not kilobyte
1 parent 205a684 commit 9e14693

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎fssize.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ type FSSize struct {
2727
currentTab Tab
2828
files []File
2929
folders []File
30-
packages []File // path = package name, sizeBytes = estimated size in kilobytes
30+
packages []File // path = package name, sizeBytes = estimated size in kibibytes
3131
maxCount int
3232
ignoreHiddenFiles bool
3333
accumulating bool
@@ -282,14 +282,14 @@ func (fssize *FSSize) AccumulatePackages() error {
282282
panic("unexpected output from dpkg-query, more than 1 comma in output")
283283
}
284284
packageName := split[1]
285-
estimatedKilobytes, err := strconv.Atoi(split[0])
285+
estimatedKibibytes, err := strconv.Atoi(split[0])
286286
if err != nil {
287287
panic("unexpected output from dpkg-query, non-number estimated size")
288288
}
289289

290290
// The ${Installed-Size} format is in estimated KiB
291291
// https://git.dpkg.org/git/dpkg/dpkg.git/tree/man/deb-substvars.pod#n176
292-
fssize.packages = append(fssize.packages, File{path: packageName, sizeBytes: int64(estimatedKilobytes) * 1024})
292+
fssize.packages = append(fssize.packages, File{path: packageName, sizeBytes: int64(estimatedKibibytes) * 1024})
293293

294294
builder.Reset()
295295
continue

‎main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Use dpkg-query directly, something like this:
126126
127127
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -rn
128128
129-
This outputs the estimated kilobyte (KiB) size of all packages`)
129+
This outputs the estimated kibibyte (KiB) size of all packages`)
130130
}
131131

132132
os.Exit(0)

0 commit comments

Comments
 (0)
Please sign in to comment.