[rhinstaller/anaconda/pulls/423 f23-branch] Improve install space required estimation (#1224048)

jkonecny12 installerbot-noreply at redhat.com
Mon Oct 26 12:17:09 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
> +        # add another 10% as safeguard
> +        total_space = Size(size) * 1.1
> +        log.debug("Size %s files %s", Size(size), files_nm)
> +        log.debug("Bonus size %s B", bonus_size)
> +        log.debug("Complete size required %s", total_space)

1) packages != files -- but I can change it to "Size: %s number of files: %s" or similar
2) Good point, will be changed
3) True, I somehow missed it when I changed complete_space variable to total_space. Will be changed.

-- 
To view this pull request on github, visit https://github.com/rhinstaller/anaconda/pull/423#discussion_r42985680


More information about the anaconda-patches mailing list