aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2017-12-20 20:29:46 +0200
committerGitHub <noreply@github.com>2017-12-20 20:29:46 +0200
commitdc39c4684121a01652518e7d348eb5ae228edc21 (patch)
tree0c30fa69bef0925349f05f5e0628aff1f97932d9
parentd4673301b88a45d6f224fca5645f1ae244a2af47 (diff)
parent1eab075c8e74f24260f0e1d8c1c1fa4f74343a21 (diff)
downloadmeson-dc39c4684121a01652518e7d348eb5ae228edc21.zip
meson-dc39c4684121a01652518e7d348eb5ae228edc21.tar.gz
meson-dc39c4684121a01652518e7d348eb5ae228edc21.tar.bz2
Merge pull request #2799 from inigomartinez/remove-duplicates
Remove duplicated values in array options
-rw-r--r--mesonbuild/coredata.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
index cf7df5e..d4a91a7 100644
--- a/mesonbuild/coredata.py
+++ b/mesonbuild/coredata.py
@@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+from . import mlog
import pickle, os, uuid
import sys
from pathlib import PurePath
@@ -148,6 +149,9 @@ class UserArrayOption(UserOption):
newvalue = ast.literal_eval(value)
else:
newvalue = [v.strip() for v in value.split(',')]
+ if len(set(newvalue)) != len(newvalue):
+ mlog.log(mlog.red('DEPRECATION:'), '''Duplicated values in an array type is deprecated.
+This will become a hard error in the future.''')
if not isinstance(newvalue, list):
raise MesonException('"{0}" should be a string array, but it is not'.format(str(newvalue)))
for i in newvalue: