3 # Files listed here would not be store in the symbolestore-server.
4 # The format is a string with files e.g.
5 # BLACKLIST="python.exe
9 # It removes "python.exe", "file.dll", and "next_file.exe" from what's
10 # added to the symstore. Separator is the newline
11 BLACK_LIST
="python.exe"
13 # List files here where it's ok for this script to find more than one
14 # occurence in the build tree. Files _not_ included here will generate
15 # an error, if duplicates are found.
17 # Same format as for BLACK_LIST above above
18 MOREPDBS_OKLIST
="libcurl.dll"
30 echo "Collect $extension"
31 ret
=$
(find "${INSTDIR}/" -type f
-name "*.${extension}" |
grep -vF "$BLACK_LIST")
32 while IFS
= read -r file
34 # store dll/exe itself (needed for minidumps)
35 if [ $WITHEXEC == 1 ] ; then
36 cygpath
-w "$file" >> "$list"
39 filename
=$
(basename "$file" ".${extension}")
40 pdball
+=($
(grep -i "/${filename}${pdbext}" <<< ${ALL_PDBS}))
41 if [ -n "${pdball[0]}" ]; then
42 cygpath -w "${pdball[0]}" >> "$list"
45 0) ((++stats_notfound)) ;;
46 1) ((++stats_found)) ;;
47 *) ((++stats_morefound))
48 if [ -z "$
(echo $file |
grep -F "$MOREPDBS_OKLIST")" ]; then
49 echo "Error
: found duplicate PDBs
:"
50 for morepdbs in ${pdball[@]} ; do
62 echo " Found PDBs
: $stats_found"
63 echo " Missing PDBs
: $stats_notfound"
64 echo " Multiple PDBs
: $stats_morefound"
68 if [ -z "${INSTDIR}" -o -z "${WORKDIR}" ]; then
69 echo "INSTDIR or WORKDIR not
set - script expects calling inside buildenv
"
72 if [ ! -d "${INSTDIR}" -o ! -d "${WORKDIR}" ]; then
73 echo "INSTDIR or WORKDIR not present
- script expects calling after full build
"
76 which symstore.exe > /dev/null 2>&1 || {
77 echo "symstore.exe is expected
in the PATH
"
83 SYM_PATH=${WORKDIR}/symstore
88 USAGE="Usage
: $0 [-h|
-k <keep_num_versions
>|
-p <symbol_store_path
>]
90 -c <comment
> specifies a comment
for the transaction
91 -n do not store exe
/dll on the symbole server
92 -k <int
>: keep this number of old symbol versions around
93 (default
: ${MAX_KEEP}. Set to
0 for unlimited
)
94 -p <path
>: specify full path to symbol store tree
95 If no path is specified
, defaults to
${SYM_PATH}.
102 -k|--keep) MAX_KEEP="$2"; shift 2;;
103 -p|--path) SYM_PATH="$2"; shift 2;;
104 -c|--comment) COMCMD="/c
"; COMMENT="$2"; shift 2;;
105 -n|--noexec) WITHEXEC=0; shift ;;
106 -h|--help) echo "${USAGE}"; exit 0;;
107 -*) echo "${USAGE}" >&2; exit 1;;
112 if [ $# -gt 0 ]; then
117 # populate symbol store from here
118 TMPFILE=$(mktemp) || exit 1
119 trap '{ rm -f ${TMPFILE}; }' EXIT
122 ALL_PDBS=$(find "${WORKDIR}/" -type f -name "*.pdb
")
124 # add dlls and executables
125 add_pdb dll .pdb "${TMPFILE}"
126 add_pdb exe .pdb "${TMPFILE}"
127 add_pdb bin .bin.pdb "${TMPFILE}"
129 # stick all of it into symbol store
130 symstore.exe add /compress /f "@$
(cygpath
-w "${TMPFILE}")" /s "$(cygpath -w "${SYM_PATH}")" /t "${PRODUCTNAME}" /v "${LIBO_VERSION_MAJOR}.${LIBO_VERSION_MINOR}.${LIBO_VERSION_MICRO}.${LIBO_VERSION_PATCH}${LIBO_VERSION_SUFFIX}${LIBO_VERSION_SUFFIX_SUFFIX}" "${COMCMD}" "${COMMENT}"
133 # Cleanup symstore, older revisions will be removed. Unless the
134 # .dll/.exe changes, the .pdb should be shared, so with incremental
135 # tinderbox several revisions should not be that space-demanding.
136 if [ "${MAX_KEEP}" -gt 0 -a -d "${SYM_PATH}/000Admin" ]; then
137 to_remove
=$
(ls -1 "${SYM_PATH}/000Admin" |
grep -v '\.txt' |
grep -v '\.deleted' |
sort |
head -n "-${MAX_KEEP}")
138 for revision
in $to_remove; do
139 echo "Remove $revision from symstore"
140 symstore.exe del
/i
"${revision}" /s
"$(cygpath -w "${SYM_PATH}")"