summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2010-12-04 12:07:19 -0500
committerColin Walters <walters@verbum.org>2010-12-04 12:12:08 -0500
commit00ddbcf3dbb22b122744adaf023c23f6aa639e21 (patch)
tree4197cc5e0d6e05a2652cf25c6f81f32c3c9f28fe
parent30154473ad124a25139f182007211ceb00cd50f8 (diff)
downloadhomegit-MOVED-TO-GNOME-00ddbcf3dbb22b122744adaf023c23f6aa639e21.zip
homegit-MOVED-TO-GNOME-00ddbcf3dbb22b122744adaf023c23f6aa639e21.tar.gz
homegit-MOVED-TO-GNOME-00ddbcf3dbb22b122744adaf023c23f6aa639e21.tar.xz
metabuild: nice ionice build processes by default
-rwxr-xr-xbin/metabuild11
1 files changed, 9 insertions, 2 deletions
diff --git a/bin/metabuild b/bin/metabuild
index 4a27cb7..9e303a2 100755
--- a/bin/metabuild
+++ b/bin/metabuild
@@ -39,10 +39,13 @@ if os.path.isdir('/lib64'):
else:
libdir=os.path.join(root, 'lib')
+# "Constants" (well, some are derived from the environment)
+subprocess_nice_args = ['nice', 'ionice', '-c', '3', '-t']
default_make_parallel = ['-j', '%d' % (cpu_count() * 6, )]
user_specified_jobs = False
configargs = ['--prefix=' + root, '--libdir=' + libdir]
makeargs = ['make']
+
for arg in sys.argv[1:]:
if arg.startswith('--'):
configargs.append(arg)
@@ -117,8 +120,12 @@ def global_failure_handler():
tail.finish(loop, lambda: sys.exit(1))
class BuildProcess(object):
- def __init__(self, args, cwd=None):
- self.args = args
+ def __init__(self, args, cwd=None, nice=True):
+ if nice:
+ self.args = list(subprocess_nice_args)
+ self.args.extend(args)
+ else:
+ self.args = args
self.pid = None
self.next_callback = None