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
48 echo "Collect $extension"
49 ret
=$
(find "${INSTDIR}/" -type f
-name "*.${extension}" |
grep -vF "$EXCLUDE_LIST")
50 while IFS
= read -r file
52 ${VERBOSE} -n "Found: $file"
53 # store dll/exe itself (needed for minidumps)
54 if [ $WITHEXEC == 1 ] ; then
55 cygpath
-w "$file" >> "$list"
62 filename
=$
(basename "$file" ".${extension}")
63 pdball
+=($
(grep -i "/${filename}${pdbext}" <<< ${ALL_PDBS}))
64 if [ -n "${pdball[0]}" ]; then
65 cygpath -w "${pdball[0]}" >> "$list"
68 0) ((++stats_notfound))
69 ${VERBOSE} " PDB not found
"
72 ${VERBOSE} " ${pdball[0]} insert
"
74 *) ((++stats_morefound))
75 if [ -z "$
(echo $file |
grep -F "$MOREPDBS_OKLIST")" ]; then
76 echo "Error
: found duplicate PDBs
:"
77 for morepdbs in ${pdball[@]} ; do
82 ${VERBOSE} " ${pdball[0]} insert
(is
in more okay list
)"
91 echo " Found PDBs
: $stats_found"
92 echo " Missing PDBs
: $stats_notfound"
93 echo " Multiple PDBs
: $stats_morefound"
97 if [ -z "${INSTDIR}" -o -z "${WORKDIR}" ]; then
98 echo "INSTDIR or WORKDIR not
set - script expects calling inside buildenv
"
101 if [ ! -d "${INSTDIR}" -o ! -d "${WORKDIR}" ]; then
102 echo "INSTDIR or WORKDIR not present
- script expects calling after full build
"
105 which symstore.exe > /dev/null 2>&1 || {
106 echo "symstore.exe is expected
in the PATH
"
112 SYM_PATH=${WORKDIR}/symstore
118 USAGE="Usage
: $0 [-h|
-k <keep_num_versions
>|
-p <symbol_store_path
>|
-c <comment
>|
-n|
-v]
120 -c <comment
> specifies a comment
for the transaction
121 -n do not store exe
/dll on the symbole server
122 -k <int
>: keep this number of old symbol versions around
123 (default
: ${MAX_KEEP}. Set to
0 for unlimited
)
124 -v verbose mode
, output detail report of files
125 -p <path
>: specify full path to symbol store tree
126 If no path is specified
, defaults to
${SYM_PATH}.
133 -k|--keep) MAX_KEEP="$2"; shift 2;;
134 -p|--path) SYM_PATH="$2"; shift 2;;
135 -c|--comment) COMCMD="/c
"; COMMENT="$2"; shift 2;;
136 -n|--noexec) WITHEXEC=0; shift ;;
137 -v|--verbose) VERBOSE=echo; shift ;;
138 -h|--help) echo "${USAGE}"; exit 0;;
139 -*) echo "${USAGE}" >&2; exit 1;;
144 if [ $# -gt 0 ]; then
149 # populate symbol store from here
150 TMPFILE=$(mktemp) || exit 1
151 trap '{ rm -f ${TMPFILE}; }' EXIT
154 ALL_PDBS=$(find "${WORKDIR}/" -type f -name "*.pdb
")
156 # add dlls and executables
157 add_pdb dll .pdb "${TMPFILE}"
158 add_pdb exe .pdb "${TMPFILE}"
159 add_pdb bin .bin.pdb "${TMPFILE}"
161 # stick all of it into symbol store
162 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}"
165 # Cleanup symstore, older revisions will be removed. Unless the
166 # .dll/.exe changes, the .pdb should be shared, so with incremental
167 # tinderbox several revisions should not be that space-demanding.
168 if [ "${MAX_KEEP}" -gt 0 -a -d "${SYM_PATH}/000Admin" ]; then
169 to_remove
=$
(ls -1 "${SYM_PATH}/000Admin" |
grep -v '\.txt' |
grep -v '\.deleted' |
sort |
head -n "-${MAX_KEEP}")
170 for revision
in $to_remove; do
171 echo "Remove $revision from symstore"
172 symstore.exe del
/i
"${revision}" /s
"$(cygpath -w "${SYM_PATH}")"