Last active
December 16, 2015 02:29
-
-
Save copyninja/5362654 to your computer and use it in GitHub Desktop.
Replaces symbols which varies across the architecture with demangled version. Requires build logs from different buildd's
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set +x | |
if [ $# -lt 3 ]; then | |
echo "Usage: $0 failed_buildlogs_directory symbols_file package_version" | |
exit 2 | |
fi | |
BUILD_LOG_DIRECTORY=$1 | |
SYMBOLS_FILE=$2 | |
PACKAGE_VERSION=$3 | |
VERSION_TO_REPLACE=" $PACKAGE_VERSION\"" | |
for LOGFILE in $(ls $BUILD_LOG_DIRECTORY/*.build); do | |
for i in $(grep '^-\s_Z' $LOGFILE | perl -pe 's/-//g;'); do | |
if [ $i = $PACKAGE_VERSION ];then | |
continue | |
fi | |
demangled_version="\""$(echo $i" "$PACKAGE_VERSION | c++filt)"\"" | |
tagged_version="(c++)"${demangled_version%$VERSION_TO_REPLACE}"\" "$PACKAGE_VERSION | |
escaped_tagged_version=$(echo $tagged_version | sed 's/\&/\\\&/') | |
sed -i "s#$i $PACKAGE_VERSION#$escaped_tagged_version#" $SYMBOLS_FILE | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment