python-dataproperty: bump version to 0.17.0
[buildroot-gz.git] / package / google-breakpad / gen-syms.sh
blob2bc0afafb6fe0cdb74fe1e0c88f880126006cef8
1 #!/bin/sh
2 NAME="${0##*/}"
3 STAGING_DIR="${1}"
4 TARGET_DIR="${2}"
5 shift 2
7 SYMBOLS_DIR="${STAGING_DIR}/usr/share/google-breakpad-symbols"
8 rm -rf "${SYMBOLS_DIR}"
9 mkdir -p "${SYMBOLS_DIR}"
11 error() {
12 fmt="${1}"; shift
13 printf "%s: ${fmt}" "${NAME}" "${@}" >&2
14 exit 1
17 for FILE in ${@}; do
18 f="${TARGET_DIR}${FILE}"
19 if [ ! -e "${f}" ]; then
20 error "%s: No such file or directory\n" "${FILE}"
22 if [ -d "${f}" ]; then
23 error "%s: Is a directory\n" "${FILE}"
25 if dump_syms "${f}" > "${SYMBOLS_DIR}/tmp.sym" 2>/dev/null; then
26 hash=$(head -n1 "${SYMBOLS_DIR}/tmp.sym" | cut -d ' ' -f 4);
27 filename=$(basename "${FILE}");
28 mkdir -p "${SYMBOLS_DIR}/${filename}/${hash}"
29 mv "${SYMBOLS_DIR}/tmp.sym" "${SYMBOLS_DIR}/${filename}/${hash}/${filename}.sym";
30 else
31 error "Error dumping symbols for: '%s'\n" "${FILE}"
33 done
34 rm -rf "${SYMBOLS_DIR}/tmp"