Changeset 5bcccc1


Ignore:
Timestamp:
04/09/2006 05:17:52 PM (18 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
experimental
Children:
6753ff7
Parents:
d057075
Message:

Clean-up.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extras/do_ica_prep

    rd057075 r5bcccc1  
    1111set -e
    1212
    13   local CMP_DIR=$1
    14   local F L BN
    15   local ALL_FILES=/tmp/allfiles.$$
    16   local UNIQUE_FILES=/tmp/uniquefiles.$$
     13local CMP_DIR=$1
     14local F L BN
    1715
    18   # Run ica_prep if it hasn't been done already
    19   if [ ! -f "$CMP_DIR/icaprep" ]; then
     16# Run ica_prep if it hasn't been done already
     17if [ ! -f "$CMP_DIR/icaprep" ]; then
    2018
    21     echo -n "Removing symbolic links in ${CMP_DIR}... "
    22     find $CMP_DIR -type l | xargs rm -f
    23     echo "done."
     19  echo -n "Removing symbolic links in ${CMP_DIR}... "
     20  find $CMP_DIR -type l | xargs rm -f
     21  echo "done."
    2422
    25     echo -n "Gunzipping \".gz\" files in ${CMP_DIR}... "
    26     find $CMP_DIR -name '*.gz' | xargs gunzip
    27     echo "done."
     23  echo -n "Gunzipping \".gz\" files in ${CMP_DIR}... "
     24  find $CMP_DIR -name '*.gz' | xargs gunzip
     25  echo "done."
    2826
    29     #echo -n "Bunzipping \".bz2\" files in ${CMP_DIR}... "
    30     #find $CMP_DIR -name '*.bz2' | xargs bunzip2
    31     #echo "done."
     27  #echo -n "Bunzipping \".bz2\" files in ${CMP_DIR}... "
     28  #find $CMP_DIR -name '*.bz2' | xargs bunzip2
     29  #echo "done."
    3230
    33     # ar archives contain date & time stamp info that causes us
    34     # grief when trying to find differences. Here we perform some
    35     # hackery to allow easy diffing. Essentially, replace each
    36     # archive with a dir of the same name and extract the object
    37     # files from the archive into this dir. Despite their names,
    38     # libieee.a & libmcheck.a are not actual ar archives.
    39     echo -n "Extracting object files from \".a\" files in ${CMP_DIR}... "
    40     L=$(find $CMP_DIR -name '*.a' ! -name 'libieee.a' ! -name 'libmcheck.a')
    41     for F in $L; do
    42       mv $F ${F}.XX
    43       mkdir $F
    44       cd $F
    45       BN=${F##*/}
    46       ar x ../${BN}.XX || {
    47       echo -e "\nError: ar archive extraction failed!\n" >&2
    48       exit 1
    49       }
    50       rm -f ../${BN}.XX
    51     done
    52     echo "done."
     31  # ar archives contain date & time stamp info that causes us
     32  # grief when trying to find differences. Here we perform some
     33  # hackery to allow easy diffing. Essentially, replace each
     34  # archive with a dir of the same name and extract the object
     35  # files from the archive into this dir. Despite their names,
     36  # libieee.a & libmcheck.a are not actual ar archives.
     37  echo -n "Extracting object files from \".a\" files in ${CMP_DIR}... "
     38  L=$(find $CMP_DIR -name '*.a' ! -name 'libieee.a' ! -name 'libmcheck.a')
     39  for F in $L; do
     40    mv $F ${F}.XX
     41    mkdir $F
     42    cd $F
     43    BN=${F##*/}
     44    ar x ../${BN}.XX || {
     45    echo -e "\nError: ar archive extraction failed!\n" >&2
     46    exit 1
     47    }
     48    rm -f ../${BN}.XX
     49  done
     50  echo "done."
    5351
    54     echo -n "Stripping (debug) symbols from \".o\" files in ${CMP_DIR}... "
    55     find $CMP_DIR -name '*.o' | xargs strip -p -g 2>/dev/null
    56     echo "done."
     52  echo -n "Stripping (debug) symbols from \".o\" files in ${CMP_DIR}... "
     53  find $CMP_DIR -name '*.o' | xargs strip -p -g 2>/dev/null
     54  echo "done."
    5755
    58     echo -n "Stripping (all) symbols from files OTHER THAN \".o\" files in ${CMP_DIR}... "
    59     find $CMP_DIR ! -name '*.o' | xargs strip -p 2>/dev/null || :
    60     echo "done."
     56  echo -n "Stripping (all) symbols from files OTHER THAN \".o\" files in ${CMP_DIR}... "
     57  find $CMP_DIR ! -name '*.o' | xargs strip -p 2>/dev/null || :
     58  echo "done."
    6159
    62     # We're all done
    63     echo -en "\nSuccess: ICA preparation for "
    64     echo -e "${CMP_DIR} complete.\n"
    65     touch $CMP_DIR/icaprep
    66   else
    67    echo -e "\n$CMP_DIR was already processed\n"
    68   fi
     60  # We're all done
     61  echo -en "\nSuccess: ICA preparation for "
     62  echo -e "${CMP_DIR} complete.\n"
     63  touch $CMP_DIR/icaprep
     64else
     65  echo -e "\n$CMP_DIR was already processed\n"
     66fi
    6967
Note: See TracChangeset for help on using the changeset viewer.