bug 714347 - pymake sort function should remove duplicates. r=khuey
authorTed Mielczarek <ted.mielczarek@gmail.com>
Tue, 03 Jan 2012 12:54:21 -0500
changeset 83733 787e8f478ba51a57e183fde58534a2c23d02f4fe
parent 83732 07104d3a5c66c7eabc76350750314657131d6971
child 83734 c56d11e05feb181418c308766dd93f13733e413d
push id21785
push userkhuey@mozilla.com
push dateWed, 04 Jan 2012 15:40:27 +0000
treeherdermozilla-central@58326f271ab7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs714347
milestone12.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 714347 - pymake sort function should remove duplicates. r=khuey
build/pymake/pymake/functions.py
build/pymake/tests/sort.mk
--- a/build/pymake/pymake/functions.py
+++ b/build/pymake/pymake/functions.py
@@ -188,19 +188,18 @@ class FilteroutFunction(Function):
 class SortFunction(Function):
     name = 'sort'
     minargs = 1
     maxargs = 1
 
     __slots__ = Function.__slots__
 
     def resolve(self, makefile, variables, fd, setting):
-        d = list(self._arguments[0].resolvesplit(makefile, variables, setting))
-        d.sort()
-        util.joiniter(fd, d)
+        d = set(self._arguments[0].resolvesplit(makefile, variables, setting))
+        util.joiniter(fd, sorted(d))
 
 class WordFunction(Function):
     name = 'word'
     minargs = 2
     maxargs = 2
 
     __slots__ = Function.__slots__
 
new file mode 100644
--- /dev/null
+++ b/build/pymake/tests/sort.mk
@@ -0,0 +1,4 @@
+# sort should remove duplicates
+all:
+	@test "$(sort x a y b z c a z b x c y)" = "a b c x y z"
+	@echo "TEST-PASS"