[Libreoffice-commits] core.git: Branch 'feature/cib_contract57' - bin/symstore.sh Makefile.in

Thorsten Behrens Thorsten.Behrens at CIB.de
Sun Jan 15 11:02:33 UTC 2017


 Makefile.in     |    1 
 bin/symstore.sh |   81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 82 insertions(+)

New commits:
commit 283c363f2d914dfd6a2ae0235b7d1a5531cabfcc
Author: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Date:   Sun Jan 15 11:50:27 2017 +0100

    gbuild: populate local symstore on Windows
    
    Script based on Lubos' tb master script from
    http://nabble.documentfoundation.org/Daily-Win32-debug-builds-td4067279.html
    
    Change-Id: I7f3247367a63078881f3cf51cf3e2cad59ad67b5

diff --git a/Makefile.in b/Makefile.in
index 218336f..928deca 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -353,6 +353,7 @@ symbols:
 	mkdir -p $(WORKDIR)/symbols/
 ifeq ($(OS),WNT)
 	$(SRCDIR)/bin/symbolstore.py $(WORKDIR)/UnpackedTarball/breakpad/src/tools/windows/binaries/dump_syms.exe $(WORKDIR)/symbols/ $(INSTDIR)/program/*
+	$(SRCDIR)/bin/symstore.sh
 else
 	$(SRCDIR)/bin/symbolstore.py $(WORKDIR)/UnpackedTarball/breakpad/src/tools/linux/dump_syms/dump_syms $(WORKDIR)/symbols/ $(INSTDIR)/program/*
 endif
diff --git a/bin/symstore.sh b/bin/symstore.sh
new file mode 100755
index 0000000..ca5bd30
--- /dev/null
+++ b/bin/symstore.sh
@@ -0,0 +1,81 @@
+#!/usr/bin/env bash
+
+add_pdb()
+{
+    extension=$1
+    type=$2
+    list=$3
+    for file in `find ${INSTDIR}/ -name *.${extension}`; do
+        filename=`basename $file .${extension}`
+        pdb=`echo ${WORKDIR}/LinkTarget/${type}/${filename}.pdb`
+        if [ -f "$pdb" ]; then
+            echo `cygpath -w $pdb` >>$list
+        fi
+    done
+
+}
+
+# check preconditions
+if [ -z ${INSTDIR} -o -z ${WORKDIR} ]; then
+    echo "INSTDIR or WORKDIR not set - script expects calling inside buildenv"
+    exit 1
+fi
+if [ ! -d ${INSTDIR} -o ! -d ${WORKDIR} ]; then
+    echo "INSTDIR or WORKDIR not present - script expects calling after full build"
+    exit 1
+fi
+which symstore.exe > /dev/null 2>&1 || {
+    echo "symstore.exe is expected in the PATH"
+    exit 1
+}
+
+# defaults
+MAX_KEEP=5
+SYM_PATH=${WORKDIR}/symstore
+
+USAGE="Usage: $0 [-h|-k <keep_num_versions>|-p <symbol_store_path>]
+       -h:         this cruft
+       -k <int>:   keep this number of old symbol versions around
+                   (default: ${MAX_KEEP}. Set to 0 for unlimited)
+       -p <path>:  specify full path to symbol store tree
+If no path is specified, defaults to ${SYM_PATH}.
+"
+
+# process args
+while :
+do
+   case "$1" in
+    -k|--keep) MAX_KEEP="$2"; shift 2;;
+    -p|--path) SYM_PATH="$2"; shift 2;;
+    -h|--help) printf "$USAGE"; exit 0; shift;;
+    -*) echo "$USAGE" >&2; exit 1;;
+    *) break;;
+   esac
+done
+
+if [ $# -gt 0 ]; then
+    echo $usage >&2
+    exit 1
+fi
+
+# populate symbol store from here
+TMPFILE=`mktemp` || exit 1
+trap "{ rm -f $TMPFILE; }" EXIT
+
+# add dlls and executables
+add_pdb dll Library $TMPFILE
+add_pdb exe Executable $TMPFILE
+
+# stick all of it into symbol store
+symstore.exe add /compress /f @${TMPFILE} /s $SYM_PATH /t "${PRODUCTNAME}" /v "${LIBO_VERSION_MAJOR}.${LIBO_VERSION_MINOR}.${LIBO_VERSION_MICRO}.${LIBO_VERSION_PATCH}${LIBO_VERSION_SUFFIX}${LIBO_VERSION_SUFFIX_SUFFIX}"
+rm -f $TMPFILE
+
+# Cleanup symstore, older revisions will be removed.  Unless the
+# .dll/.exe changes, the .pdb should be shared, so with incremental
+# tinderbox several revisions should not be that space-demanding.
+if [ $MAX_KEEP -gt 0 -a -d ${SYM_PATH}/000Admin ]; then
+    to_remove=`ls -1 ${SYM_PATH}/000Admin | grep -v '\.txt' | grep -v '\.deleted' | sort | head -n -${MAX_KEEP}`
+    for revision in $to_remove; do
+        symstore.exe del /i ${revision} /s `cygpath -w $SYM_PATH`
+    done
+fi


More information about the Libreoffice-commits mailing list