aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <thibault.saunier@osg.samsung.com>2016-10-04 17:16:24 -0300
committerThibault Saunier <thibault.saunier@osg.samsung.com>2016-10-14 11:25:16 +0200
commitfcaf319e49aaaf548a814977c4c5e864fa5a4f77 (patch)
tree32af167444ba4d80f97917225c3e30427f6667ed
parent7e2390f3558d05b3168dc57f2c2fe923b8ed12af (diff)
downloadmeson-fcaf319e49aaaf548a814977c4c5e864fa5a4f77.zip
meson-fcaf319e49aaaf548a814977c4c5e864fa5a4f77.tar.gz
meson-fcaf319e49aaaf548a814977c4c5e864fa5a4f77.tar.bz2
interpreter: Add a way to copy and environment object
It is really usefull when you have common variables defined for all tests and then need to set some extra ones for each test
-rw-r--r--mesonbuild/interpreter.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index 2a7ad6e..28f56c8 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -27,6 +27,7 @@ import os, sys, subprocess, shutil, uuid, re
from functools import wraps
import importlib
+import copy
run_depr_printed = False
@@ -188,6 +189,7 @@ class EnvironmentVariablesHolder(InterpreterObject):
self.methods.update({'set': self.set_method,
'append': self.append_method,
'prepend' : self.prepend_method,
+ 'copy' : self.copy_method,
})
@stringArgs
@@ -210,6 +212,9 @@ class EnvironmentVariablesHolder(InterpreterObject):
def prepend_method(self, args, kwargs):
self.add_var(self.held_object.prepend, args, kwargs)
+ def copy_method(self, args, kwargs):
+ return copy.deepcopy(self)
+
class ConfigurationDataHolder(InterpreterObject):
def __init__(self):