3 # Files listed here would not be store in the symbolestore-server.
4 # The format is a string with files e.g.
5 # EXCLUDE_LIST="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 EXCLUDE_LIST
="python.exe"
13 # List files here where it's ok for this script to find more than one
14 # occurrence in the build tree. Files _not_ included here will generate
15 # an error, if duplicates are found.
17 # Same format as for EXCLUDE_LIST above
18 MOREPDBS_OKLIST
="libcurl.dll
50 echo "Collect $extension"
51 ret
=$
(find "${INSTDIR}/" -type f
-name "*.${extension}" |
grep -vF "$EXCLUDE_LIST")
52 while IFS
= read -r file
54 ${VERBOSE} -n "Found: $file"
55 # store dll/exe itself (needed for minidumps)
56 if [ $WITHEXEC == 1 ] ; then
57 cygpath
-w "$file" >> "$list"
64 filename
=$
(basename "$file" ".${extension}")
65 pdball
+=($
(grep -i "/${filename}${pdbext}" <<< ${ALL_PDBS}))
66 if [ -n "${pdball[0]}" ]; then
67 cygpath -w "${pdball[0]}" >> "$list"
70 0) ((++stats_notfound))
71 ${VERBOSE} " PDB not found
"
74 ${VERBOSE} " ${pdball[0]} insert
"
76 *) ((++stats_morefound))
77 if [ -z "$
(echo $file |
grep -F "$MOREPDBS_OKLIST")" ]; then
78 echo "Error
: found duplicate PDBs
:"
79 for morepdbs in ${pdball[@]} ; do
84 ${VERBOSE} " ${pdball[0]} insert
(is
in more okay list
)"
93 echo " Found PDBs
: $stats_found"
94 echo " Missing PDBs
: $stats_notfound"
95 echo " Multiple PDBs
: $stats_morefound"
99 if [ -z "${INSTDIR}" -o -z "${WORKDIR}" ]; then
100 echo "INSTDIR or WORKDIR not
set - script expects calling inside buildenv
"
103 if [ ! -d "${INSTDIR}" -o ! -d "${WORKDIR}" ]; then
104 echo "INSTDIR or WORKDIR not present
- script expects calling after full build
"
107 which symstore.exe > /dev/null 2>&1 || {
108 echo "symstore.exe is expected
in the PATH
"
114 SYM_PATH=${WORKDIR}/symstore
120 USAGE="Usage
: $0 [-h|
-k <keep_num_versions
>|
-p <symbol_store_path
>|
-c <comment
>|
-n|
-v]
122 -c <comment
> specifies a comment
for the transaction
123 -n do not store exe
/dll on the symbole server
124 -k <int
>: keep this number of old symbol versions around
125 (default
: ${MAX_KEEP}. Set to
0 for unlimited
)
126 -v verbose mode
, output detail report of files
127 -p <path
>: specify full path to symbol store tree
128 If no path is specified
, defaults to
${SYM_PATH}.
135 -k|--keep) MAX_KEEP="$2"; shift 2;;
136 -p|--path) SYM_PATH="$2"; shift 2;;
137 -c|--comment) COMCMD="/c
"; COMMENT="$2"; shift 2;;
138 -n|--noexec) WITHEXEC=0; shift ;;
139 -v|--verbose) VERBOSE=echo; shift ;;
140 -h|--help) echo "${USAGE}"; exit 0;;
141 -*) echo "${USAGE}" >&2; exit 1;;
146 if [ $# -gt 0 ]; then
151 # populate symbol store from here
152 TMPFILE=$(mktemp) || exit 1
153 trap '{ rm -f ${TMPFILE}; }' EXIT
156 ALL_PDBS=$(find "${WORKDIR}/" -type f -name "*.pdb
")
158 # add dlls and executables
159 add_pdb dll .pdb "${TMPFILE}"
160 add_pdb exe .pdb "${TMPFILE}"
161 add_pdb bin .bin.pdb "${TMPFILE}"
163 # stick all of it into symbol store
164 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}"
167 # Cleanup symstore, older revisions will be removed. Unless the
168 # .dll/.exe changes, the .pdb should be shared, so with incremental
169 # tinderbox several revisions should not be that space-demanding.
170 if [ "${MAX_KEEP}" -gt 0 -a -d "${SYM_PATH}/000Admin" ]; then
171 to_remove
=$
(ls -1 "${SYM_PATH}/000Admin" |
grep -v '\.txt' |
grep -v '\.deleted' |
sort |
head -n "-${MAX_KEEP}")
172 for revision
in $to_remove; do
173 echo "Remove $revision from symstore"
174 symstore.exe del
/i
"${revision}" /s
"$(cygpath -w "${SYM_PATH}")"