Bug 609401 - Stop spamming "Section [Build] not found" to the terminal. r=ted
authorJustin Lebar <justin.lebar@gmail.com>
Thu, 19 May 2011 16:29:50 -0400
changeset 69971 99436764a9261c60e758f28be50408b85a26b83a
parent 69970 f1d79c22fd712766d2e030f4677b546e1d286741
child 69972 aad0fbc6ae777080cb6d928056f601fdb85ec710
push idunknown
push userunknown
push dateunknown
reviewersted
bugs609401
milestone6.0a1
Bug 609401 - Stop spamming "Section [Build] not found" to the terminal. r=ted
Makefile.in
toolkit/crashreporter/tools/upload_symbols.sh
--- a/Makefile.in
+++ b/Makefile.in
@@ -157,17 +157,17 @@ endif
 SYM_STORE_SOURCE_DIRS := $(topsrcdir)
 
 include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
 
 ifdef MOZ_SYMBOLS_EXTRA_BUILDID
 EXTRA_BUILDID := -$(MOZ_SYMBOLS_EXTRA_BUILDID)
 endif
 
-export SYMBOL_INDEX_NAME = \
+SYMBOL_INDEX_NAME = \
   $(MOZ_APP_NAME)-$(MOZ_APP_VERSION)-$(OS_TARGET)-$(BUILDID)$(EXTRA_BUILDID)-symbols.txt
 
 buildsymbols:
 ifdef MOZ_CRASHREPORTER
 ifdef USE_ELF_HACK
 	$(MAKE) -C $(MOZ_BUILD_APP)/installer elfhack
 endif
 	echo building symbol store
@@ -189,17 +189,17 @@ endif
 	grep "sym" $(SYMBOL_INDEX_NAME) > $(SYMBOL_INDEX_NAME).tmp && \
 	  mv $(SYMBOL_INDEX_NAME).tmp $(SYMBOL_INDEX_NAME)
 	cd $(DIST)/crashreporter-symbols && \
           zip -r9D "../$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip" . -i "*.sym" -i "*.txt"
 endif # MOZ_CRASHREPORTER
 
 uploadsymbols:
 ifdef MOZ_CRASHREPORTER
-	$(SHELL) $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.sh "$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip"
+	$(SHELL) $(topsrcdir)/toolkit/crashreporter/tools/upload_symbols.sh $(SYMBOL_INDEX_NAME) "$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip"
 endif
 
 # defined in package-name.mk
 export MOZ_SOURCE_STAMP
 
 #XXX: this is a hack, since we don't want to clobber for MSVC
 # PGO support, but we can't do this test in client.mk
 ifneq ($(OS_ARCH)_$(GNU_CC), WINNT_)
--- a/toolkit/crashreporter/tools/upload_symbols.sh
+++ b/toolkit/crashreporter/tools/upload_symbols.sh
@@ -43,24 +43,33 @@
 #
 # And will use the following optional environment variables if set:
 # SYMBOL_SERVER_SSH_KEY : path to a ssh private key to use
 # SYMBOL_SERVER_PORT    : port to use for ssh
 # POST_SYMBOL_UPLOAD_CMD: a commandline to run on the remote host after
 #                         uploading. The full path of the symbol index
 #                         file will be appended to the commandline.
 #
+# The script expects two command-line arguments, in this order:
+#   - The symbol index name
+#   - The symbol archive
+#
+
 set -e
 
-: ${SYMBOL_SERVER_HOST?} ${SYMBOL_SERVER_USER?} ${SYMBOL_SERVER_PATH?} ${1?"You must specify a symbol archive to upload"}
-hash=`openssl dgst -sha1 "$1" | sed 's/^.*)=//' | sed 's/\ //g'`
-archive="${hash}-"`basename "$1" | sed 's/\ //g'`
-echo "Transferring symbols... $1"
+: ${SYMBOL_SERVER_HOST?} ${SYMBOL_SERVER_USER?} ${SYMBOL_SERVER_PATH?} ${1?"You must specify a symbol index name."} ${2?"You must specify a symbol archive to upload"}
+
+SYMBOL_INDEX_NAME="$1"
+SYMBOL_ARCHIVE="$2"
+
+hash=`openssl dgst -sha1 "${SYMBOL_ARCHIVE}" | sed 's/^.*)=//' | sed 's/\ //g'`
+archive="${hash}-"`basename "${SYMBOL_ARCHIVE}" | sed 's/\ //g'`
+echo "Transferring symbols... ${SYMBOL_ARCHIVE}"
 scp ${SYMBOL_SERVER_PORT:+-P $SYMBOL_SERVER_PORT} \
-  ${SYMBOL_SERVER_SSH_KEY:+-i "$SYMBOL_SERVER_SSH_KEY"} "$1" \
+  ${SYMBOL_SERVER_SSH_KEY:+-i "$SYMBOL_SERVER_SSH_KEY"} "${SYMBOL_ARCHIVE}" \
   ${SYMBOL_SERVER_USER}@${SYMBOL_SERVER_HOST}:"${SYMBOL_SERVER_PATH}/${archive}"
 echo "Unpacking symbols on remote host..."
 ssh -2 ${SYMBOL_SERVER_PORT:+-p $SYMBOL_SERVER_PORT} \
   ${SYMBOL_SERVER_SSH_KEY:+-i "$SYMBOL_SERVER_SSH_KEY"} \
   -l ${SYMBOL_SERVER_USER} ${SYMBOL_SERVER_HOST} \
   "set -e;
    umask 0022;
    cd ${SYMBOL_SERVER_PATH};