Bug 756808 - Fix build error due to a trailing slash in the |DIRS| makefile variable; r=AryehGregor

This commit is contained in:
Ms2ger 2012-05-20 13:12:41 +02:00
Родитель 477bb350a8
Коммит d7a07a7ae6
2 изменённых файлов: 16 добавлений и 15 удалений

Просмотреть файл

@ -1,3 +1,3 @@
DIRS += \
editing/ \
editing \
$(NULL)

Просмотреть файл

@ -46,6 +46,12 @@ def getData(confFile):
fp.close()
return repo, dest, directories
def makePath(a, b):
if not b:
# Empty directory, i.e., the repository root.
return a
return "%s/%s" % (a, b)
def copy(thissrcdir, dest, directories):
"""Copy mochitests and support files from the external HG directory to their
place in mozilla-central.
@ -55,13 +61,8 @@ def copy(thissrcdir, dest, directories):
dirtocreate = dest
subdirs, mochitests, supportfiles = parseManifestFile(dest, d)
if d:
sourcedir = "hg-%s/%s" % (dest, d)
destdir = "%s/%s" % (dest, d)
else:
# Empty directory, i.e., the repository root
sourcedir = "hg-%s" % dest
destdir = dest
sourcedir = makePath("hg-%s" % dest, d)
destdir = makePath(dest, d)
os.makedirs(destdir)
for mochitest in mochitests:
@ -76,6 +77,11 @@ def copy(thissrcdir, dest, directories):
# Empty directory, i.e., the repository root
importDirs(thissrcdir, dest, subdirs)
def makefileString(entries):
if not len(entries):
return " $(NULL)"
return "\n".join([" %s \\" % (entry, ) for entry in entries]) + "\n $(NULL)"
def printMakefile(dest, directories):
"""Create a .mk file to be included into the main Makefile.in, which lists the
directories with tests.
@ -84,8 +90,8 @@ def printMakefile(dest, directories):
path = dest + ".mk"
fp = open(path, "wb")
fp.write("DIRS += \\\n")
fp.writelines([" %s/%s \\\n" % (dest, d) for d in directories])
fp.write(" $(NULL)\n")
fp.write(makefileString([makePath(dest, d) for d in directories]))
fp.write("\n")
fp.close()
subprocess.check_call(["hg", "add", path])
@ -115,11 +121,6 @@ libs:: $$(_TESTS)
\t$$(INSTALL) $$(foreach f,$$^,"$$f") $$(DEPTH)/_tests/testing/mochitest/tests/$$(relativesrcdir)
"""
def makefileString(entries):
if not len(entries):
return " $(NULL)"
return "\n".join([" %s \\" % (entry, ) for entry in entries]) + "\n $(NULL)"
def printMakefiles(thissrcdir, dest, directories):
"""Create Makefile.in files for each directory that contains tests we import.
"""