Comment 4 for bug 44286

Revision history for this message
Elliott Hughes (enh) wrote : Re: [Bug 44286] Re: 'Size' field in 'Details' tab should show KiB units

if that's true, the right fix isn't to pass APT's broken units on to the
user: the right fix is to convert kB into KiB, and display KiB. (the kB
figure's only approximate anyway. if they cared about accuracy, they'd
have given us B.)

something like this?

def kB_to_KiB(kB):
  return '%i KB' % round(float(kB)*1000.0/1024.0)

 --elliott

On Tue, September 2, 2008 19:07, Endolith wrote:
> apt/Synaptic and the Installed-Size parameter of .deb files all measure in
> decimal (1000s of bytes), so "KiB" would be wrong. "KB" is also wrong,
> though. It should be "kB".
>
> http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f
> -Installed-Size
>
>
> patch:
>
>
>
> === modified file 'GDebi/GDebi.py'
> --- GDebi/GDebi.py 2008-08-05 14:24:05 +0000
> +++ GDebi/GDebi.py 2008-09-03 02:00:11 +0000
> @@ -221,7 +221,7 @@
> self.label_maintainer.set_text(utf8(self._deb["Maintainer"]))
> self.label_priority.set_text(self._deb["Priority"])
> self.label_section.set_text(utf8(self._deb["Section"])) -
> self.label_size.set_text(self._deb["Installed-Size"] + " KB") +
> self.label_size.set_text(self._deb["Installed-Size"] + " kB")
>
> # set filelist
> buf = self.textview_filelist.get_buffer()
>
> === modified file 'GDebi/GDebiKDE.py'
> --- GDebi/GDebiKDE.py 2008-08-05 14:23:57 +0000
> +++ GDebi/GDebiKDE.py 2008-09-03 02:03:26 +0000
> @@ -257,7 +257,7 @@
> self.DetailsMaintainer.setText(utf8(self._deb["Maintainer"]))
> self.DetailsPriority.setText(self._deb["Priority"])
> self.DetailsSection.setText(utf8(self._deb["Section"])) -
> self.DetailsSize.setText(self._deb["Installed-Size"] + " KB") +
> self.DetailsSize.setText(self._deb["Installed-Size"] + " kB")
>
> # set filelist
> buf = self.IncFilesEdit
>
>
> ** Changed in: gdebi
> Status: Fix Released => Confirmed
>
>
> --
> "Size" field in "Details" tab should show KiB units
> https://bugs.launchpad.net/bugs/44286
> You received this bug notification because you are a direct subscriber
> of the bug.
>

--
Elliott Hughes, http://www.jessies.org/~enh/