[rhinstaller/anaconda/pulls/423 f23-branch] Improve install space required estimation (#1224048)
vpodzime
installerbot-noreply at redhat.com
Mon Oct 26 08:47:04 UTC 2015
> @@ -567,11 +570,23 @@ def _spaceRequired(self):
> if transaction is None:
> return Size("3000 MB")
>
> - size = sum(tsi.installed.installsize for tsi in transaction)
> - # add 35% to account for the fact that the above method is laughably
> - # inaccurate:
> - size *= 1.35
> - return Size(size)
> + size = 0
> + files_nm = 0
> + for tsi in transaction:
> + # space taken by all files installed by the packages
> + size += tsi.installed.installsize
> + # number of files installed on the system
> + files_nm += len(tsi.installed.files)
> + # add required space which depends on block size and rpm database taken space estimation
> + # 6144 = 4K(max default fragment size) + 2K(rpm db could be taken for a header file)
> + bonus_size = files_nm * 6144
> + size = size + bonus_size
And ``size`` should be an instance of ``Size`` here.
--
To view this pull request on github, visit https://github.com/rhinstaller/anaconda/pull/423#discussion_r42969227
More information about the anaconda-patches
mailing list