source: extras/do_ica_prep@ 89a2b70

experimental
Last change on this file since 89a2b70 was eddf89f5, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Added inline_doc fragments.

  • 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
[5bcccc1]24local CMP_DIR=$1
25local F L BN
[d057075]26
[5bcccc1]27# Run ica_prep if it hasn't been done already
28if [ ! -f "$CMP_DIR/icaprep" ]; then
[d057075]29
[5bcccc1]30 echo -n "Removing symbolic links in ${CMP_DIR}... "
31 find $CMP_DIR -type l | xargs rm -f
32 echo "done."
[d057075]33
[5bcccc1]34 echo -n "Gunzipping \".gz\" files in ${CMP_DIR}... "
35 find $CMP_DIR -name '*.gz' | xargs gunzip
36 echo "done."
[d057075]37
[5bcccc1]38 #echo -n "Bunzipping \".bz2\" files in ${CMP_DIR}... "
39 #find $CMP_DIR -name '*.bz2' | xargs bunzip2
40 #echo "done."
[d057075]41
[5bcccc1]42 # ar archives contain date & time stamp info that causes us
43 # grief when trying to find differences. Here we perform some
44 # hackery to allow easy diffing. Essentially, replace each
45 # archive with a dir of the same name and extract the object
46 # files from the archive into this dir. Despite their names,
47 # libieee.a & libmcheck.a are not actual ar archives.
48 echo -n "Extracting object files from \".a\" files in ${CMP_DIR}... "
49 L=$(find $CMP_DIR -name '*.a' ! -name 'libieee.a' ! -name 'libmcheck.a')
50 for F in $L; do
51 mv $F ${F}.XX
52 mkdir $F
53 cd $F
54 BN=${F##*/}
55 ar x ../${BN}.XX || {
56 echo -e "\nError: ar archive extraction failed!\n" >&2
57 exit 1
58 }
59 rm -f ../${BN}.XX
60 done
61 echo "done."
[d057075]62
[5bcccc1]63 echo -n "Stripping (debug) symbols from \".o\" files in ${CMP_DIR}... "
64 find $CMP_DIR -name '*.o' | xargs strip -p -g 2>/dev/null
65 echo "done."
[d057075]66
[5bcccc1]67 echo -n "Stripping (all) symbols from files OTHER THAN \".o\" files in ${CMP_DIR}... "
68 find $CMP_DIR ! -name '*.o' | xargs strip -p 2>/dev/null || :
69 echo "done."
[d057075]70
[5bcccc1]71 # We're all done
72 echo -en "\nSuccess: ICA preparation for "
73 echo -e "${CMP_DIR} complete.\n"
74 touch $CMP_DIR/icaprep
75else
76 echo -e "\n$CMP_DIR was already processed\n"
77fi
[ed0a142]78
Note: See TracBrowser for help on using the repository browser.