source: extras/do_ica_prep@ 8806d60

experimental
Last change on this file since 8806d60 was 34cabf6, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Creating iteration-N.log files to keep clean Makefile output.

  • Property mode set to 100755
File size: 2.2 KB
RevLine 
[ed0a142]1#!/bin/bash
2# $Id$
[d057075]3
4# Acknowledgment:
5# The following code is a modified version of an original work written by
6# Greg Schafer for the "DIY Linux" project and is included here with his
7# permission.
8# ref: http://www.diy-linux.org
9#
10
[ed0a142]11set -e
12
[eddf89f5]13: <<inline_doc
14 desc: prepare current iteration files for ICA report
15 usage: do_ica_prep $DEST_ICA/$ITERATION
16 input vars: $1 directory where files from current iteration are stored
17 externals: --
18 modifies: --
19 returns: --
20 on error:
21 on success:
22inline_doc
23
[7fa1d20]24CMP_DIR=$1
[d057075]25
[5bcccc1]26# Run ica_prep if it hasn't been done already
27if [ ! -f "$CMP_DIR/icaprep" ]; then
[d057075]28
[34cabf6]29 echo -en "\nRemoving symbolic links in ${CMP_DIR}... "
[5bcccc1]30 find $CMP_DIR -type l | xargs rm -f
31 echo "done."
[d057075]32
[5bcccc1]33 echo -n "Gunzipping \".gz\" files in ${CMP_DIR}... "
34 find $CMP_DIR -name '*.gz' | xargs gunzip
35 echo "done."
[d057075]36
[5bcccc1]37 #echo -n "Bunzipping \".bz2\" files in ${CMP_DIR}... "
38 #find $CMP_DIR -name '*.bz2' | xargs bunzip2
39 #echo "done."
[d057075]40
[5bcccc1]41 # ar archives contain date & time stamp info that causes us
42 # grief when trying to find differences. Here we perform some
43 # hackery to allow easy diffing. Essentially, replace each
44 # archive with a dir of the same name and extract the object
45 # files from the archive into this dir. Despite their names,
46 # libieee.a & libmcheck.a are not actual ar archives.
47 echo -n "Extracting object files from \".a\" files in ${CMP_DIR}... "
48 L=$(find $CMP_DIR -name '*.a' ! -name 'libieee.a' ! -name 'libmcheck.a')
49 for F in $L; do
50 mv $F ${F}.XX
51 mkdir $F
52 cd $F
53 BN=${F##*/}
54 ar x ../${BN}.XX || {
55 echo -e "\nError: ar archive extraction failed!\n" >&2
56 exit 1
57 }
58 rm -f ../${BN}.XX
59 done
60 echo "done."
[d057075]61
[5bcccc1]62 echo -n "Stripping (debug) symbols from \".o\" files in ${CMP_DIR}... "
63 find $CMP_DIR -name '*.o' | xargs strip -p -g 2>/dev/null
64 echo "done."
[d057075]65
[5bcccc1]66 echo -n "Stripping (all) symbols from files OTHER THAN \".o\" files in ${CMP_DIR}... "
67 find $CMP_DIR ! -name '*.o' | xargs strip -p 2>/dev/null || :
68 echo "done."
[d057075]69
[5bcccc1]70 # We're all done
71 echo -en "\nSuccess: ICA preparation for "
[34cabf6]72 echo -e "${CMP_DIR} complete."
[5bcccc1]73 touch $CMP_DIR/icaprep
74else
75 echo -e "\n$CMP_DIR was already processed\n"
76fi
[ed0a142]77
Note: See TracBrowser for help on using the repository browser.