mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
sb: Monitor the build disk usage. Report the usage, total and various sizes
- Track the size of a build of a package in a build set to determine the maximum amout of disk space used. This can be used as a guide to documenting how much space a user needs to set aside to build a specific set of tools. - The `%clean` stage of a build is now split into a separate script. I do not think this is an issue because I could not find any `%clean` sections in any build configs we have. In time support for the `%clean` section will be removed, the package builder cleans up. Closes #3516
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#
|
||||
# RTEMS Tools Project (http://www.rtems.org/)
|
||||
# Copyright 2010-2016 Chris Johns (chrisj@rtems.org)
|
||||
# Copyright 2010-2018 Chris Johns (chrisj@rtems.org)
|
||||
# All rights reserved.
|
||||
#
|
||||
# This file is part of the RTEMS Tools package in 'rtems-tools'.
|
||||
@@ -73,6 +73,7 @@ class package:
|
||||
self.config = config
|
||||
self.directives = {}
|
||||
self.infos = {}
|
||||
self.sizes = {}
|
||||
|
||||
def __str__(self):
|
||||
|
||||
@@ -218,6 +219,16 @@ class package:
|
||||
def disabled(self):
|
||||
return len(self.name()) == 0
|
||||
|
||||
def set_size(self, what, path_):
|
||||
if what not in self.sizes:
|
||||
self.sizes[what] = 0
|
||||
self.sizes[what] += path.get_size(path_)
|
||||
|
||||
def get_size(self, what):
|
||||
if what in self.sizes:
|
||||
return self.sizes[what]
|
||||
return 0
|
||||
|
||||
class file:
|
||||
"""Parse a config file."""
|
||||
|
||||
|
Reference in New Issue
Block a user