From de72dea1cbf3d4687d6f22a3472cd38c2a3d72ac Mon Sep 17 00:00:00 2001 From: "ted.mielczarek%gmail.com" Date: Tue, 15 Apr 2008 10:31:41 +0000 Subject: [PATCH] bug 428518 - source server, final round. patch by Lukas Blakk . r=me, a=beltzner --- toolkit/crashreporter/tools/symbolstore.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/toolkit/crashreporter/tools/symbolstore.py b/toolkit/crashreporter/tools/symbolstore.py index c5e849fd3ae..8a9a639ce57 100755 --- a/toolkit/crashreporter/tools/symbolstore.py +++ b/toolkit/crashreporter/tools/symbolstore.py @@ -314,9 +314,9 @@ def SourceIndex(fileStream, outputPath, cvs_root): # Create the srcsrv data block that indexes the pdb file result = True pdbStreamFile = open(outputPath, "w") - pdbStreamFile.write('''SRCSRV: ini ------------------------------------------------\r\nVERSION=1\r\nSRCSRV: variables ------------------------------------------\r\nCVS_EXTRACT_CMD=%fnchdir%(%CVS_WORKINGDIR%)cvs.exe -d %fnvar%(%var2%) checkout -r %var4% %var3%\r\nCVS_EXTRACT_TARGET=%targ%\%var2%\%fnbksl%(%var3%)\%fnfile%(%var1%)\r\nCVS_WORKING_DIR=%targ%\r\nMYSERVER=''') + pdbStreamFile.write('''SRCSRV: ini ------------------------------------------------\r\nVERSION=1\r\nSRCSRV: variables ------------------------------------------\r\nCVS_EXTRACT_CMD=%fnchdir%(%targ%)cvs.exe -d %fnvar%(%var2%) checkout -r %var4% -d %var4% -N %var3%\r\nMYSERVER=''') pdbStreamFile.write(cvs_root) - pdbStreamFile.write('''\r\nSRCSRVTRG=%targ%\%fnbksl%(%var3%)\r\nSRCSRVCMD=%CVS_EXTRACT_CMD%\r\nSRCSRV: source files ---------------------------------------\r\n''') + pdbStreamFile.write('''\r\nSRCSRVTRG=%targ%\%var4%\%fnbksl%(%var3%)\r\nSRCSRVCMD=%CVS_EXTRACT_CMD%\r\nSRCSRV: source files ---------------------------------------\r\n''') pdbStreamFile.write(fileStream) # can't do string interpolation because the source server also uses this and so there are % in the above pdbStreamFile.write("SRCSRV: end ------------------------------------------------\r\n\n") pdbStreamFile.close() @@ -406,7 +406,9 @@ class Dumper: in the proper directory structure in |symbol_path|.""" result = False sourceFileStream = '' - cvs_root = '' + # tries to get cvsroot from the .mozconfig first - if it's not set + # the tinderbox cvs_path will be assigned further down + cvs_root = os.environ.get("SRCSRV_ROOT") for arch in self.archs: try: cmd = os.popen("%s %s %s" % (self.dump_syms, arch, file), "r") @@ -443,8 +445,9 @@ class Dumper: if self.vcsinfo: (filename, rootname) = GetVCSFilename(filename, self.srcdir) # sets cvs_root in case the loop through files were to end on an empty rootname - if rootname: - cvs_root = rootname + if cvs_root is None: + if rootname: + cvs_root = rootname # gather up files with cvs for indexing if filename.startswith("cvs"): (ver, checkout, source_file, revision) = filename.split(":", 3)