Changeset 708

Show
Ignore:
Timestamp:
12/05/06 08:09:45 (2 years ago)
Author:
chengyu
Message:

filtrate function

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/mwfetcher/CHANGELOG

    r707 r708  
    11v0.1.0 
     2* Added filtrate_sample function to ease filter adding. 
    23* Added "-t vfat" option since the vfat file system mount option is not compatible 
    34  with ntfs or other file system.  
  • trunk/mwfetcher/src/mwfetcher

    r707 r708  
    173173                new_file_name=`echo "$line" | sed '{s/\//_/g}'` 
    174174                new_file_name=`echo "$new_file_name" | sed '{s/ /_/g}'` 
    175                 if [ -n "$(file "$mount_dir/$line" | grep executable | grep MS)" ]; then 
     175                #if [ -n "$(file "$mount_dir/$line" | grep executable | grep MS)" ]; then 
     176                if filtrate_sample "$mount_dir/$line" 
     177                then 
    176178                        /bin/cp -u "$mount_dir/$line" "$submit_dir/$new_file_name" 
    177179                        echo `date`" $line" 
     
    180182 
    181183        #echo "Finished" 
     184} 
     185 
     186# filtrate_sample 
     187# Filtrate unwanted sample, add your own filter here. 
     188# $1: sample path 
     189 
     190filtrate_sample() { 
     191        local sample_path="$1" 
     192 
     193        if [ -n "$(file "$sample_path" | grep executable | grep MS)" ]; then 
     194                return 0 
     195        else 
     196                return 1 
     197        fi 
    182198} 
    183199